X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/45a1074b0a38f38cfebde8bb65d5a6520b2db3e8..29c5ab3b74d26657c60b40770676be082caa953d:/src/dolphinviewactionhandler.h diff --git a/src/dolphinviewactionhandler.h b/src/dolphinviewactionhandler.h index a11d19bb1..91875ec0c 100644 --- a/src/dolphinviewactionhandler.h +++ b/src/dolphinviewactionhandler.h @@ -21,8 +21,10 @@ #ifndef DOLPHINVIEWACTIONHANDLER_H #define DOLPHINVIEWACTIONHANDLER_H +#include "dolphinview.h" #include "libdolphin_export.h" #include +class KToggleAction; class QAction; class QActionGroup; class DolphinView; @@ -54,6 +56,22 @@ public: */ void setCurrentView(DolphinView* view); + /** + * Returns the view that this action handler should work on. + */ + DolphinView* currentView(); + + /** + * Returns the name of the action for the current viewmode + */ + QString currentViewModeActionName() const; + + /** + * Returns m_actionCollection + */ + KActionCollection* actionCollection(); + +public Q_SLOTS: /** * Update all actions in the 'View' menu, i.e. those that depend on the * settings in the current view. @@ -67,12 +85,18 @@ Q_SIGNALS: */ void actionBeingHandled(); + /** + * Emitted if the user requested creating a new directory by the F10 key. + * The receiver of the signal (DolphinMainWindow or DolphinPart) invokes + * the method createDirectory of their KNewMenu instance. + */ + void createDirectory(); + private Q_SLOTS: /** - * Opens the dialog for creating a directory. Is connected - * with the key shortcut for "new directory" (F10). + * Emitted when the user requested a change of view mode */ - void slotCreateDir(); + void slotViewModeActionTriggered(QAction*); /** * Let the user input a name for the selected item(s) and trigger @@ -108,17 +132,40 @@ private Q_SLOTS: /** Switches between an ascending and descending sorting order. */ void toggleSortOrder(); + /** Switches between a separate sorting and a mixed sorting of files and folders. */ + void toggleSortFoldersFirst(); + /** * Updates the state of the 'Sort Ascending/Descending' action. */ void slotSortOrderChanged(Qt::SortOrder order); + /** + * Updates the state of the 'Sort Folders First' action. + */ + void slotSortFoldersFirstChanged(bool foldersFirst); + + /** + * Updates the state of the 'Sort by' actions. + */ + void slotSortingChanged(DolphinView::Sorting sorting); + + /** + * Updates the state of the 'Zoom In' and 'Zoom Out' actions. + */ + void slotZoomLevelChanged(int level); + /** * Switches on or off the displaying of additional information * as specified by \a action. */ void toggleAdditionalInfo(QAction* action); + /** + * Changes the sorting of the current view. + */ + void slotSortTriggered(QAction*); + /** * Updates the state of the 'Additional Information' actions. */ @@ -144,6 +191,25 @@ private Q_SLOTS: */ void slotShowHiddenFilesChanged(); + /** + * Opens the view properties dialog, which allows to modify the properties + * of the currently active view. + */ + void slotAdjustViewProperties(); + + /** + * Opens the Find File dialog for the currently shown directory. + */ + void slotFindFile(); + + /** + * Connected to the "properties" action. + * Opens the properties dialog for the selected items of the + * active view. The properties dialog shows information + * like name, size and permissions. + */ + void slotProperties(); + private: /** * Create all the actions. @@ -156,10 +222,33 @@ private: */ QActionGroup* createAdditionalInformationActionGroup(); + /** + * Creates an action group with all the "sort by" actions in it. + * Helper method for createActions(); + */ + QActionGroup* createSortByActionGroup(); + + /** + * 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 */ -