diff options
author | Matt Ward <matt.ward@xamarin.com> | 2017-07-06 14:41:49 +0300 |
---|---|---|
committer | Matt Ward <ward.matt@gmail.com> | 2017-07-06 15:28:02 +0300 |
commit | d8957188af49660fb5e7106b12a0a6706af11254 (patch) | |
tree | bdd261590484e0929f557cd529bf55efee22c686 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui | |
parent | 3cbf95f6629843d74a248ac48d5161619655de50 (diff) |
[Ide] Support not saving files when creating new project
Fixed bug #55351 - Dirty file interferes with creating new project
https://bugzilla.xamarin.com/show_bug.cgi?id=55351
With unsaved files open in the IDE, creating a new project would
show a dialog prompt asking to save changes. This dialog had two
buttons Cancel and Save (or Save As). Now the dialog also has a
Don't Save button which will discard the changes and close the unsaved
file. Also the dialog now has a message saying that not saving will
cause the changes to be permanently lost.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs index 509e56c695..9a9944290d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs @@ -369,6 +369,12 @@ namespace MonoDevelop.Ide.Gui if (result == AlertButton.Cancel) return false; + if (result == AlertButton.CloseWithoutSave) { + doc.Window.ViewContent.DiscardChanges (); + await doc.Window.CloseWindow (true); + continue; + } + await doc.Save (); if (doc.IsDirty) { doc.Select (); @@ -385,8 +391,8 @@ namespace MonoDevelop.Ide.Gui (object)(doc.Window.ViewContent.IsUntitled ? doc.Window.ViewContent.UntitledName : System.IO.Path.GetFileName (doc.Window.ViewContent.ContentName))), - "", - AlertButton.Cancel, doc.Window.ViewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save); + GettextCatalog.GetString ("If you don't save, all changes will be permanently lost."), + AlertButton.CloseWithoutSave, AlertButton.Cancel, doc.Window.ViewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save); } public void CloseAllDocuments (bool leaveActiveDocumentOpen) |