diff options
| author | Peter Penz <[email protected]> | 2008-04-12 15:09:46 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-04-12 15:09:46 +0000 |
| commit | 3b06c2120dad8efc79471a82b81c08f2d5834062 (patch) | |
| tree | 9b610f58291b9748c80dd25e215e82da6b247d94 /src/dolphinmainwindow.h | |
| parent | 99686f7fe2bae1157b99496cff3b42b16a19dd0a (diff) | |
"New Tab" menu + some related code ;-)
BUG: 143995
svn path=/trunk/KDE/kdebase/apps/; revision=796101
Diffstat (limited to 'src/dolphinmainwindow.h')
| -rw-r--r-- | src/dolphinmainwindow.h | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 2fbb742fd..5a50f3dbf 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -39,6 +39,7 @@ class DolphinViewActionHandler; class DolphinApplication; class DolphinViewContainer; class KNewMenu; +class KTabBar; class KUrl; class QSplitter; @@ -310,12 +311,21 @@ private slots: /** Open a new main window. */ void openNewMainWindow(); + /** Opens a new empty view that is part of a tab. */ + void openNewTab(); + /** Toggles the active view if two views are shown within the main window. */ void toggleActiveView(); /** Called when the view is doing a file operation, like renaming, copying, moving etc. */ void slotDoingOperation(KonqFileUndoManager::CommandType type); + /** + * Activates the tab with the index \a index, which means that the current view + * is replaced by the view of the given tab. + */ + void setActiveTab(int index); + private: DolphinMainWindow(int id); void init(); @@ -336,11 +346,11 @@ private: /** * Connects the signals from the created DolphinView with - * the index \a viewIndex with the corresponding slots of + * the DolphinViewContainer \a container with the corresponding slots of * the DolphinMainWindow. This method must be invoked each * time a DolphinView has been created. */ - void connectViewSignals(int viewIndex); + void connectViewSignals(DolphinViewContainer* container); /** * Updates the text of the split action: @@ -350,16 +360,12 @@ private: */ void updateSplitAction(); -private: /** - * DolphinMainWindow supports up to two views beside each other. + * Opens a new tab showing the URL \a url. */ - enum ViewIndex - { - PrimaryView = 0, ///< View shown on the left side of the main window. - SecondaryView = 1 ///< View shown on the left side of the main window. - }; + void openNewTab(const KUrl& url); +private: /** * Implements a custom error handling for the undo manager. This * assures that all errors are shown in the status bar of Dolphin @@ -378,11 +384,21 @@ private: KNewMenu* m_newMenu; KAction* m_showMenuBar; - QSplitter* m_splitter; + KTabBar* m_tabBar; DolphinViewContainer* m_activeViewContainer; + QVBoxLayout* m_centralWidgetLayout; int m_id; - DolphinViewContainer* m_viewContainer[SecondaryView + 1]; + struct ViewTab + { + ViewTab() : primaryView(0), secondaryView(0), splitter(0) {} + DolphinViewContainer* primaryView; + DolphinViewContainer* secondaryView; + QSplitter* splitter; + }; + + int m_tabIndex; + QList<ViewTab> m_viewTab; DolphinViewActionHandler* m_actionHandler; @@ -397,7 +413,7 @@ inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const inline bool DolphinMainWindow::isSplit() const { - return m_viewContainer[SecondaryView] != 0; + return m_viewTab[m_tabIndex].secondaryView != 0; } inline KNewMenu* DolphinMainWindow::newMenu() const |
