X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/dbc8874c00c35aaefacdd03f8aef9e4ac4e2be01..ac73af7bedeebe2afa451249e8a6500651a6ec00:/src/dolphinmainwindow.h diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 8970b89cb..f757520c3 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -27,9 +27,10 @@ #include -#include +#include +#include #include -#include +#include #include @@ -92,17 +93,16 @@ public: */ KNewMenu* newMenu() const; + /** + * Returns the 'Show Menubar' action which can be shared with + * other menus (e. g. a context menu). + */ + KAction* showMenuBarAction() const; + public slots: /** * Handles the dropping of URLs to the given - * destination. A context menu with the options - * 'Move Here', 'Copy Here', 'Link Here' and - * 'Cancel' is offered to the user. - * @param urls List of URLs which have been - * dropped. - * @param destination Destination URL, where the - * list or URLs should be moved, - * copied or linked to. + * destination. This is only called by the TreeViewSidebarPage. */ void dropUrls(const KUrl::List& urls, const KUrl& destination); @@ -122,7 +122,7 @@ public slots: * Inform all affected dolphin components that a selection change is * requested. */ - void changeSelection(const QList& selection); + void changeSelection(const KFileItemList& selection); /** Stores all settings and quits Dolphin. */ void quit(); @@ -138,7 +138,7 @@ signals: * Is sent if the selection of the currently active view has * been changed. */ - void selectionChanged(const QList& selection); + void selectionChanged(const KFileItemList& selection); /** * Is sent if the url of the currently active view has @@ -153,21 +153,14 @@ signals: void requestItemInfo(const KFileItem& item); protected: - /** @see QMainWindow::closeEvent */ + /** @see QMainWindow::closeEvent() */ virtual void closeEvent(QCloseEvent* event); - /** - * This method is called when it is time for the app to save its - * properties for session management purposes. - */ - void saveProperties(KConfig*); + /** @see KMainWindow::saveProperties() */ + virtual void saveProperties(KConfigGroup& group); - /** - * This method is called when this app is restored. The KConfig - * object points to the session management config file that was saved - * with @ref saveProperties - */ - void readProperties(KConfig*); + /** @see KMainWindow::readProperties() */ + virtual void readProperties(const KConfigGroup& group); private slots: /** Updates the 'Create New...' sub menu. */ @@ -198,18 +191,6 @@ private slots: */ void slotHandlePlacesError(const QString &message); - /** - * Shows the error information of the job \a job - * in the status bar. - */ - void slotHandleJobError(KJob* job); - - /** - * Indicates in the status bar that the delete operation - * of the job \a job has been finished. - */ - void slotDeleteFileFinished(KJob* job); - /** * Updates the state of the 'Undo' menu action dependent * from the parameter \a available. @@ -250,14 +231,8 @@ private slots: */ void invertSelection(); - /** The current active view is switched to the icons mode. */ - void setIconsView(); - - /** The current active view is switched to the details mode. */ - void setDetailsView(); - - /** The current active view is switched to the column mode. */ - void setColumnView(); + /** The current active view is switched to a new view mode. */ + void setViewMode(QAction *); /** The sorting of the current view should be done by the name. */ void sortByName(); @@ -292,20 +267,23 @@ private slots: /** Switches between sorting by categories or not. */ void toggleSortCategorization(); - /** - * Clears any additional information for an item except for the - * name and the icon. - */ - void clearInfo(); + /** Switches between showing the size as additional information for the item or not. */ + void toggleSizeInfo(); - /** Shows the MIME type as additional information for the item. */ - void showMimeInfo(); + /** Switchtes between showing the date as additional information for the item or not. */ + void toggleDateInfo(); - /** Shows the size as additional information for the item. */ - void showSizeInfo(); + /** Switchtes between showing the permissions as additional information for the item or not. */ + void togglePermissionsInfo(); - /** Shows the date as additional information for the item. */ - void showDateInfo(); + /** Switchtes between showing the owner as additional information for the item or not. */ + void toggleOwnerInfo(); + + /** Switchtes between showing the group as additional information for the item or not. */ + void toggleGroupInfo(); + + /** Switches between showing the MIME type as additional information for the item or not. */ + void toggleMimeInfo(); /** * Switches between one and two views: @@ -376,6 +354,12 @@ private slots: /** Opens Kompare for 2 selected files. */ void compareFiles(); + /** + * Hides the menu bar if it is visible, makes the menu bar + * visible if it is hidden. + */ + void toggleShowMenuBar(); + /** Opens the settings dialog for Dolphin. */ void editSettings(); @@ -404,7 +388,7 @@ private slots: * Updates the state of the 'Edit' menu actions and emits * the signal selectionChanged(). */ - void slotSelectionChanged(const QList& selection); + void slotSelectionChanged(const KFileItemList& selection); /** Emits the signal requestItemInfo(). */ void slotRequestItemInfo(const KFileItem&); @@ -424,6 +408,9 @@ private slots: /** 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); + private: DolphinMainWindow(int id); void init(); @@ -442,9 +429,6 @@ private: void updateEditActions(); void updateViewActions(); void updateGoActions(); - void copyUrls(const KUrl::List& source, const KUrl& dest); - void moveUrls(const KUrl::List& source, const KUrl& dest); - void linkUrls(const KUrl::List& source, const KUrl& dest); void clearStatusBar(); /** @@ -463,6 +447,14 @@ private: */ void updateSplitAction(); + /** + * Helper method for the slots toggleDateInfo(), toggleSizeInfo() + * and toggleMimeInfo(). Applies \a info dependent from the current + * checked state of the action \a actionName to the file item delegate. + */ + void toggleAdditionalInfo(const char* actionName, + KFileItemDelegate::Information info); + private: /** * DolphinMainWindow supports up to two views beside each other. @@ -478,7 +470,7 @@ private: * assures that all errors are shown in the status bar of Dolphin * instead as modal error dialog with an OK button. */ - class UndoUiInterface : public KonqUndoManager::UiInterface + class UndoUiInterface : public KonqFileUndoManager::UiInterface { public: UndoUiInterface(DolphinMainWindow* mainWin); @@ -490,6 +482,7 @@ private: }; KNewMenu* m_newMenu; + KAction* m_showMenuBar; QSplitter* m_splitter; DolphinViewContainer* m_activeViewContainer; int m_id; @@ -497,7 +490,7 @@ private: DolphinViewContainer* m_viewContainer[SecondaryView + 1]; /// remember pending undo operations until they are finished - QList m_undoCommandTypes; + QList m_undoCommandTypes; }; inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const @@ -515,6 +508,11 @@ inline KNewMenu* DolphinMainWindow::newMenu() const return m_newMenu; } +inline KAction* DolphinMainWindow::showMenuBarAction() const +{ + return m_showMenuBar; +} + inline int DolphinMainWindow::getId() const { return m_id;