diff options
author | Lluis Sanchez <lluis@novell.com> | 2010-02-03 02:32:59 +0300 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2010-02-03 02:32:59 +0300 |
commit | 1c76042a1534a4590b64518ff5f1528da8b74416 (patch) | |
tree | 8cc458375527ba79b9e9a421ce30b6dec53de591 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution | |
parent | 2a22d72b77c8e63ed5d840c803109c6a3b96e959 (diff) |
* MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs: Make
sure the Run With menu is hidden when there are no handlers that can
run a project. Fixes bug #575657 - Crash is custom execution modes.
svn path=/trunk/monodevelop/; revision=150751
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs index 7353babaaf..3f16a70563 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs @@ -81,10 +81,13 @@ namespace MonoDevelop.Ide.Execution ci.Description = ci.Text + " - " + GettextCatalog.GetString ("Hold Control key to display the execution parameters dialog."); } } + if (info.Count > 0) + info.AddSeparator (); + } + if (info.Count > 0) { info.AddSeparator (); + info.Add (GettextCatalog.GetString ("Edit Custom Modes..."), new CommandItem (ctx, null)); } - info.AddSeparator (); - info.Add (GettextCatalog.GetString ("Edit Custom Modes..."), new CommandItem (ctx, null)); } public static IExecutionHandler GetExecutionModeForCommand (object data) @@ -132,8 +135,10 @@ namespace MonoDevelop.Ide.Execution List<IExecutionMode> items = new List<IExecutionMode> (); HashSet<string> setModes = new HashSet<string> (); foreach (IExecutionMode mode in mset.ExecutionModes) { + if (!ctx.CanExecute (mode.ExecutionHandler)) + continue; setModes.Add (mode.Id); - if (ctx.CanExecute (mode.ExecutionHandler) && (mode.Id != "Default" || includeDefault)) + if (mode.Id != "Default" || includeDefault) items.Add (mode); if (mode.Id == "Default" && includeDefaultCustomizer) { CustomExecutionMode cmode = new CustomExecutionMode (); |