]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
Remove popout action from toolbar when split screen is closed
[dolphin.git] / src / dolphinmainwindow.h
index 92ddb24c37420b1ca0a57a89eef66d931705b6eb..62f8ceb6e489422cbce04f5902f160c6aced8d3f 100644 (file)
@@ -12,6 +12,7 @@
 #include "config-dolphin.h"
 #include "dolphintabwidget.h"
 #include "selectionmode/bottombar.h"
+#include <KActionMenu>
 #include <KFileItemActions>
 #include <kio/fileundomanager.h>
 #include <kxmlguiwindow.h>
@@ -20,6 +21,7 @@
 #include "panels/information/informationpanel.h"
 #endif
 
+#include <QFutureWatcher>
 #include <QIcon>
 #include <QList>
 #include <QMenu>
@@ -116,6 +118,14 @@ public:
      */
     void setViewsToHomeIfMountPathOpen(const QString &mountPath);
 
+    /**
+     * Enables or disables the session autosaving feature.
+     *
+     * @param enable If true, saves the session automatically after a fixed
+     *               time interval from the last state change.
+     */
+    void setSessionAutoSaveEnabled(bool enable);
+
     bool isFoldersPanelEnabled() const;
     bool isInformationPanelEnabled() const;
     bool isSplitViewEnabledInCurrentTab() const;
@@ -204,9 +214,6 @@ public Q_SLOTS:
     /** @see GeneralSettings::splitViewChanged() */
     void slotSplitViewChanged();
 
-    bool isOnActivity(const QString &activityId) const;
-    bool isOnCurrentDesktop() const;
-
 Q_SIGNALS:
     /**
      * Is sent if the selection of the currently active view has
@@ -337,6 +344,13 @@ private Q_SLOTS:
      */
     void toggleSplitView();
 
+    /**
+     * Pops out a split view.
+     * The active view will be popped out, unless the view is not split,
+     * in which case nothing will happen.
+     */
+    void popoutSplitView();
+
     /** Dedicated action to open the stash:/ ioslave in split view. */
     void toggleSplitStash();
 
@@ -479,6 +493,11 @@ private Q_SLOTS:
      */
     void openInNewWindow();
 
+    /**
+     * Opens the selected folder in the other inactive split view, enables split view if necessary.
+     */
+    void openInSplitView(const QUrl &url);
+
     /**
      * Show the target of the selected symlink
      */
@@ -617,6 +636,11 @@ private Q_SLOTS:
      */
     void slotKeyBindings();
 
+    /**
+     * Saves the session.
+     */
+    void slotSaveSession();
+
 private:
     /**
      * Sets up the various menus and actions and connects them.
@@ -646,7 +670,7 @@ private:
      * otherwise the text is set to "Join". The icon
      * is updated to match with the text and the currently active view.
      */
-    void updateSplitAction();
+    void updateSplitActions();
 
     /**
      * Sets the window sides the toolbar may be moved to based on toolbar contents.
@@ -657,11 +681,9 @@ private:
 
     /**
      * Creates an action for showing/hiding a panel, that is accessible
-     * in "Configure toolbars..." and "Configure shortcuts...". This is necessary
-     * as the action for toggling the dock visibility is done by Qt which
-     * is no KAction instance.
+     * in "Configure toolbars..." and "Configure shortcuts...".
      */
-    void createPanelAction(const QIcon &icon, const QKeySequence &shortcut, QAction *dockAction, const QString &actionName);
+    void createPanelAction(const QIcon &icon, const QKeySequence &shortcut, QDockWidget *dockAction, const QString &actionName);
 
     /** Adds "What's This?" texts to many widgets and StandardActions. */
     void setupWhatsThis();
@@ -714,10 +736,16 @@ private:
 
     KToolBarPopupAction *m_backAction;
     KToolBarPopupAction *m_forwardAction;
+    KActionMenu *m_splitViewAction;
+    QAction *m_splitViewMenuAction;
 
     QMenu m_searchTools;
     KFileItemActions m_fileItemActions;
 
+    QTimer *m_sessionSaveTimer;
+    QFutureWatcher<void> *m_sessionSaveWatcher;
+    bool m_sessionSaveScheduled;
+
     friend class DolphinMainWindowTest;
 };