From 78e9cc506f90eb862f032154199331b5e5e6dffb Mon Sep 17 00:00:00 2001 From: Shaun Reich Date: Sun, 1 Mar 2009 01:38:20 +0000 Subject: Closed tabs are now remembered within Dolphin, so if you accidentally close them, or need to reopen a previous one-go crazy. Closed tabs now become stored in the "Go"->"Recently Closed Tabs" menu. To clear this list, there is an action within that menu. Clicking on a remembered tab's action, will remove that entry, restore that tab, and focus it. svn path=/trunk/KDE/kdebase/apps/; revision=933483 --- src/dolphinmainwindow.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/dolphinmainwindow.h') diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 2e49cc67a..8fe9e350a 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -62,6 +63,14 @@ class DolphinMainWindow: public KXmlGuiWindow public: virtual ~DolphinMainWindow(); + //TODO: This struct should be private, but I couldn't figure out how to make it that way + //when using Q_DECLARE_METATYPE(), which is a needed macro. + struct ClosedTab + { + KUrl primaryUrl; + KUrl secondaryUrl; + bool isSplit; + }; /** * Returns the currently active view. @@ -179,6 +188,9 @@ private slots: */ void slotUndoAvailable(bool available); + /** Invoked when an action in the recent tabs menu is clicked. */ + void restoreClosedTab(QAction* action); + /** Sets the text of the 'Undo' menu action to \a text. */ void slotUndoTextChanged(const QString& text); @@ -389,6 +401,11 @@ private: void updateViewActions(); void updateGoActions(); + /** + * Adds the tab[\a index] to the closed tab menu's list of actions. + */ + void rememberClosedTab(int index); + /** * Connects the signals from the created DolphinView with * the DolphinViewContainer \a container with the corresponding slots of @@ -427,6 +444,7 @@ private: }; KNewMenu* m_newMenu; + KActionMenu* m_recentTabsMenu; KAction* m_showMenuBar; KTabBar* m_tabBar; DolphinViewContainer* m_activeViewContainer; @@ -450,6 +468,8 @@ private: QPointer m_settingsDialog; }; +Q_DECLARE_METATYPE(DolphinMainWindow::ClosedTab) + inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const { return m_activeViewContainer; -- cgit v1.3