diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs index b1ca6d43d4..3f758fce2e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs @@ -37,8 +37,9 @@ namespace MonoDevelop.Ide.Commands { public enum WindowCommands { - NextWindow, - PrevWindow, + NextDocument, + PrevDocument, + OpenDocumentList, OpenWindowList, SplitWindowVertically, SplitWindowHorizontally, @@ -48,7 +49,7 @@ namespace MonoDevelop.Ide.Commands SwitchPreviousDocument } - internal class NextWindowHandler : CommandHandler + internal class NextDocumentHandler : CommandHandler { protected override void Update (CommandInfo info) { @@ -70,7 +71,7 @@ namespace MonoDevelop.Ide.Commands } } - internal class PrevWindowHandler : CommandHandler + internal class PrevDocumentHandler : CommandHandler { protected override void Update (CommandInfo info) { @@ -91,7 +92,7 @@ namespace MonoDevelop.Ide.Commands } } - internal class OpenWindowListHandler : CommandHandler + internal class OpenDocumentListHandler : CommandHandler { protected override void Update (CommandArrayInfo info) { @@ -103,7 +104,7 @@ namespace MonoDevelop.Ide.Commands commandInfo.Text = document.Window.Title.Replace ("_", "__"); if (document == IdeApp.Workbench.ActiveDocument) commandInfo.Checked = true; - commandInfo.Description = GettextCatalog.GetString ("Activate window '{0}'", commandInfo.Text); + commandInfo.Description = GettextCatalog.GetString ("Activate document '{0}'", commandInfo.Text); if (document.Window.ShowNotification) { commandInfo.UseMarkup = true; commandInfo.Text = "<span foreground=" + '"' + "blue" + '"' + ">" + commandInfo.Text + "</span>"; @@ -129,6 +130,34 @@ namespace MonoDevelop.Ide.Commands } } + internal class OpenWindowListHandler : CommandHandler + { + protected override void Update (CommandArrayInfo info) + { + int i = 0; + foreach (Gtk.Window window in IdeApp.CommandService.TopLevelWindowStack) { + + //Create CommandInfo object + CommandInfo commandInfo = new CommandInfo (); + commandInfo.Text = window.Title.Replace ("_", "__"); + if (window.HasToplevelFocus) + commandInfo.Checked = true; + commandInfo.Description = GettextCatalog.GetString ("Activate window '{0}'", commandInfo.Text); + + //Add menu item + info.Add (commandInfo, window); + + i++; + } + } + + protected override void Run (object dataItem) + { + Window window = (Window)dataItem; + window.Present (); + } + } + internal class SplitWindowVertically : CommandHandler { protected override void Update (CommandInfo info) @@ -223,7 +252,7 @@ namespace MonoDevelop.Ide.Commands { //FIXME: does this option need to exist? if (!PropertyService.Get ("MonoDevelop.Core.Gui.EnableDocumentSwitchDialog", true)) { - IdeApp.CommandService.DispatchCommand (next? WindowCommands.NextWindow : WindowCommands.PrevWindow); + IdeApp.CommandService.DispatchCommand (next? WindowCommands.NextDocument : WindowCommands.PrevDocument); return; } |