Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez Gual <lluis@novell.com>2011-04-14 12:42:35 +0400
committerLluis Sanchez Gual <lluis@novell.com>2011-04-14 12:42:35 +0400
commit701dbd65c7139f83a77c7851783ad051e72db10c (patch)
tree3d1494f59fb8d841cf307b694a1377c573cc564a /main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions
parente0c109a1b5d586020714a889add5ce497842f174 (diff)
[Ide] Fix issue when closing msg dialogs with Escape
If the dialog is closed clicking the close window button we may have no result. In that case, try to find a cancelling button
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/AlertDialog.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/AlertDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/AlertDialog.cs
index 47665d24ac..5d02f821f6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/AlertDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/AlertDialog.cs
@@ -72,6 +72,17 @@ namespace MonoDevelop.Components.Extensions
if (alertDialog.ApplyToAll)
data.ApplyToAll = true;
data.ResultButton = alertDialog.ResultButton;
+
+ if (data.ResultButton == null) {
+ // If the dialog is closed clicking the close window button we may have no result.
+ // In that case, try to find a cancelling button
+ if (data.Buttons.Contains (AlertButton.Cancel))
+ data.ResultButton = AlertButton.Cancel;
+ else if (data.Buttons.Contains (AlertButton.No))
+ data.ResultButton = AlertButton.No;
+ else if (data.Buttons.Contains (AlertButton.Close))
+ data.ResultButton = AlertButton.Close;
+ }
return true;
}
}