This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create projects without explicit path (#605)
* feat: create projects without explicit path * fix: assume draft status for all files in app path * chore: update testing deps * fix: determine draft save location correctly
- Loading branch information
1 parent
7a7186b
commit 9612f21
Showing
26 changed files
with
913 additions
and
968 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as Electron from 'electron'; | ||
import { Project } from '../model'; | ||
|
||
export enum DiscardDialogResult { | ||
Save, | ||
Cancel, | ||
Discard | ||
} | ||
|
||
export async function showDiscardDialog(project: Project): Promise<DiscardDialogResult> { | ||
return new Promise<DiscardDialogResult>(resolve => { | ||
Electron.dialog.showMessageBox( | ||
Electron.BrowserWindow.getFocusedWindow(), | ||
{ | ||
type: 'warning', | ||
message: `Do you want to save the changes you made to ${project.getName()}?`, | ||
detail: "Your changes will be lost if you don't save them.", | ||
buttons: ['Save', 'Cancel', "Don't Save"] | ||
}, | ||
response => { | ||
switch (response) { | ||
case 0: | ||
return resolve(DiscardDialogResult.Save); | ||
case 2: | ||
return resolve(DiscardDialogResult.Discard); | ||
case 1: | ||
default: | ||
return resolve(DiscardDialogResult.Cancel); | ||
} | ||
} | ||
); | ||
}); | ||
} |
Oops, something went wrong.