]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
Move the code handling the additional-info-actions to DolphinView; simplify signal...
[dolphin.git] / src / dolphinmainwindow.h
index 8c79200faa109d0963c27a7914fb0432b763223f..444a4a94687023ffb048eab3d06047e04239d070 100644 (file)
 
 #include <config-nepomuk.h>
 
-#include <kxmlguiwindow.h>
+#include <kfileitemdelegate.h>
+#include <konq_fileundomanager.h>
 #include <ksortablelist.h>
-#include <konq_undo.h>
+#include <kxmlguiwindow.h>
 
 #include <QtCore/QList>
 
@@ -60,14 +61,14 @@ public:
      * having a split view setup, the nonactive view
      * is usually shown in darker colors.
      */
-    inline DolphinViewContainer* activeViewContainer() const;
+    DolphinViewContainer* activeViewContainer() const;
 
     /**
      * Returns true, if the main window contains two instances
      * of a view container. The active view constainer can be
      * accessed by DolphinMainWindow::activeViewContainer().
      */
-    inline bool isSplit() const;
+    bool isSplit() const;
 
     /**
      * If the main window contains two instances of a view container
@@ -81,7 +82,7 @@ public:
     void rename(const KUrl& oldUrl, const KUrl& newUrl);
 
     /**
-     * Refreshs the views of the main window by recreating them dependent from
+     * Refreshes the views of the main window by recreating them dependent from
      * the given Dolphin settings.
      */
     void refreshViews();
@@ -90,19 +91,18 @@ public:
      * Returns the 'Create New...' sub menu which also can be shared
      * with other menus (e. g. a context menu).
      */
-    inline KNewMenu* newMenu() const;
+    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);
@@ -110,7 +110,7 @@ public slots:
     /**
      * Returns the main window ID used through DBus.
      */
-    inline int getId() const;
+    int getId() const;
 
     /**
      * Inform all affected dolphin components (sidebars, views) of an URL
@@ -122,7 +122,7 @@ public slots:
      * Inform all affected dolphin components that a selection change is
      * requested.
      */
-    void changeSelection(const QList<KFileItem>& 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<KFileItem>& selection);
+    void selectionChanged(const KFileItemList& selection);
 
     /**
      * Is sent if the url of the currently active view has
@@ -153,23 +153,22 @@ 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);
+
+    /** @see KMainWindow::readProperties() */
+    virtual void readProperties(const KConfigGroup& group);
 
+private slots:
     /**
-     * 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
+     * Opens the dialog for creating a directory. Is connected
+     * with the key shortcut for "new directory" (F10).
      */
-    void readProperties(KConfig*);
+    void createDir();
 
-private slots:
     /** Updates the 'Create New...' sub menu. */
     void updateNewMenu();
 
@@ -198,18 +197,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 +237,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();
@@ -293,19 +274,10 @@ private slots:
     void toggleSortCategorization();
 
     /**
-     * Clears any additional information for an item except for the
-     * name and the icon.
+     * Switches on or off the displaying of additional information
+     * as specified by \a action.
      */
-    void clearInfo();
-
-    /** Shows the MIME type as additional information for the item. */
-    void showMimeInfo();
-
-    /** Shows the size as additional information for the item. */
-    void showSizeInfo();
-
-    /** Shows the date as additional information for the item. */
-    void showDateInfo();
+    void toggleAdditionalInfo(QAction* action);
 
     /**
      * Switches between one and two views:
@@ -376,6 +348,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();
 
@@ -398,13 +376,13 @@ private slots:
     void slotSortOrderChanged(Qt::SortOrder order);
 
     /** Updates the state of the 'Additional Information' actions. */
-    void slotAdditionalInfoChanged(KFileItemDelegate::AdditionalInformation info);
+    void slotAdditionalInfoChanged();
 
     /**
      * Updates the state of the 'Edit' menu actions and emits
      * the signal selectionChanged().
      */
-    void slotSelectionChanged(const QList<KFileItem>& selection);
+    void slotSelectionChanged(const KFileItemList& selection);
 
     /** Emits the signal requestItemInfo(). */
     void slotRequestItemInfo(const KFileItem&);
@@ -424,6 +402,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 +423,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();
 
     /**
@@ -478,7 +456,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 +468,7 @@ private:
     };
 
     KNewMenu* m_newMenu;
+    KAction* m_showMenuBar;
     QSplitter* m_splitter;
     DolphinViewContainer* m_activeViewContainer;
     int m_id;
@@ -497,25 +476,30 @@ private:
     DolphinViewContainer* m_viewContainer[SecondaryView + 1];
 
     /// remember pending undo operations until they are finished
-    QList<KonqUndoManager::CommandType> m_undoCommandTypes;
+    QList<KonqFileUndoManager::CommandType> m_undoCommandTypes;
 };
 
-DolphinViewContainer* DolphinMainWindow::activeViewContainer() const
+inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const
 {
     return m_activeViewContainer;
 }
 
-bool DolphinMainWindow::isSplit() const
+inline bool DolphinMainWindow::isSplit() const
 {
     return m_viewContainer[SecondaryView] != 0;
 }
 
-KNewMenu* DolphinMainWindow::newMenu() const
+inline KNewMenu* DolphinMainWindow::newMenu() const
 {
     return m_newMenu;
 }
 
-int DolphinMainWindow::getId() const
+inline KAction* DolphinMainWindow::showMenuBarAction() const
+{
+    return m_showMenuBar;
+}
+
+inline int DolphinMainWindow::getId() const
 {
     return m_id;
 }