diff options
author | Marius Ungureanu <teromario@yahoo.com> | 2013-05-14 22:43:43 +0400 |
---|---|---|
committer | Marius Ungureanu <teromario@yahoo.com> | 2013-05-14 22:43:43 +0400 |
commit | 267efbe568d3ae443fe973a72c3bbbc56f2d9b78 (patch) | |
tree | d2325ba14de01d80bfc2bbae742a858f166e46ea /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands | |
parent | 8105f814d863b0efa927b4e86490eff98fc9ce86 (diff) |
Bug 8541 - Reopen Closed Tab
This adds a feature Open Last Closed Tab similar to Google Chrome.
This acts like a backwards linked-list which opens documents in the order of closing.
ClosedDocumentNavigationPoint is a type specifically for this action.
This required an enhancement to the NavigationHistoryService to support this new kind of items.
*Should I have split this to a new service?
The need of the ReorderTab to fix visual appearance of tabs when reopening.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs | 1 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs index 360b044631..e3f28cea05 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs @@ -403,4 +403,5 @@ namespace MonoDevelop.Ide.Commands // MonoDevelop.Ide.Commands.FileTabCommands.CloseAllButThis Implemented in FileTabCommands.cs // MonoDevelop.Ide.Commands.CopyPathNameHandler Implemented in FileTabCommands.cs // MonoDevelop.Ide.Commands.FileTabCommands.ToggleMaximize Implemented in FileTabCommands.cs + // MonoDevelop.Ide.Commands.FileTabCommands.ReopenClosedTab Implemented in FileTabCommands.cs } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs index 87b46c16e8..97347d6e47 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs @@ -32,6 +32,7 @@ using Gtk; using MonoDevelop.Components.Commands; using MonoDevelop.Ide.Gui; +using MonoDevelop.Ide.Navigation; namespace MonoDevelop.Ide.Commands { @@ -39,7 +40,8 @@ namespace MonoDevelop.Ide.Commands { CloseAllButThis, CopyPathName, - ToggleMaximize + ToggleMaximize, + OpenLastTab } class CloseAllButThisHandler : CommandHandler @@ -72,4 +74,17 @@ namespace MonoDevelop.Ide.Commands clipboard.Text = document.FileName; } } + + class ReopenClosedTabHandler : CommandHandler + { + protected override void Run () + { + NavigationHistoryService.OpenLastClosedDocument (); + } + + protected override void Update (CommandInfo info) + { + info.Enabled = NavigationHistoryService.HasClosedDocuments; + } + } } |