From 905277aac40f2a55daa5bb2925acb6d4046dacfd Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 13 Feb 2008 18:07:34 +0000 Subject: Provide the dolphinpart view modes (Icons, Details, Columns) in konqueror's View Modes menu. (this is done using a Q_PROPERTY in the dolphin part and a signal; the available view modes for creating the menu in the first place are listed in dolphinpart.desktop) Konqueror: cleaned up the old (complex) handling of view modes as N toolbar buttons from M services grouped by library. Dolphin: moved view mode handling to DolphinViewActionHandler, removes duplication between part and mainwindow. BUG: 157424 svn path=/branches/KDE/4.0/kdebase/apps/; revision=774632 --- src/dolphinviewactionhandler.h | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'src/dolphinviewactionhandler.h') diff --git a/src/dolphinviewactionhandler.h b/src/dolphinviewactionhandler.h index a11d19bb1..d4790a38d 100644 --- a/src/dolphinviewactionhandler.h +++ b/src/dolphinviewactionhandler.h @@ -23,6 +23,7 @@ #include "libdolphin_export.h" #include +class KToggleAction; class QAction; class QActionGroup; class DolphinView; @@ -54,6 +55,12 @@ public: */ void setCurrentView(DolphinView* view); + /** + * Returns the name of the action for the current viewmode + */ + QString currentViewModeActionName() const; + +public Q_SLOTS: /** * Update all actions in the 'View' menu, i.e. those that depend on the * settings in the current view. @@ -74,6 +81,11 @@ private Q_SLOTS: */ void slotCreateDir(); + /** + * Emitted when the user requested a change of view mode + */ + void slotViewModeActionTriggered(QAction*); + /** * Let the user input a name for the selected item(s) and trigger * a renaming afterwards. @@ -156,10 +168,27 @@ private: */ QActionGroup* createAdditionalInformationActionGroup(); + /** + * Returns the "switch to icons mode" action. + * Helper method for createActions(); + */ + KToggleAction* iconsModeAction(); + + /** + * Returns the "switch to details mode" action. + * Helper method for createActions(); + */ + KToggleAction* detailsModeAction(); + + /** + * Returns the "switch to columns mode" action. + * Helper method for createActions(); + */ + KToggleAction* columnsModeAction(); + + KActionCollection* m_actionCollection; DolphinView* m_currentView; }; - #endif /* DOLPHINVIEWACTIONHANDLER_H */ - -- cgit v1.3