]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
fix information panel icon
[dolphin.git] / src / dolphinmainwindow.h
index 551e28192700373103edce3709b39675e2f9ebdc..5f96ca3b621fbb04ea7cabbd870513c6f39df468 100644 (file)
 #define DOLPHIN_MAINWINDOW_H
 
 #include "config-dolphin.h"
+#include "disabledactionnotifier.h"
 #include "dolphintabwidget.h"
 #include "selectionmode/bottombar.h"
+#include <KActionMenu>
 #include <KFileItemActions>
 #include <kio/fileundomanager.h>
 #include <kxmlguiwindow.h>
@@ -20,6 +22,7 @@
 #include "panels/information/informationpanel.h"
 #endif
 
+#include <QFutureWatcher>
 #include <QIcon>
 #include <QList>
 #include <QMenu>
@@ -44,9 +47,13 @@ class QToolButton;
 class PlacesPanel;
 class TerminalPanel;
 
+/** Used to identify that a custom command should be triggered on a view background double-click.*/
+constexpr QLatin1String customCommand{"CUSTOM_COMMAND"};
+
 namespace KIO
 {
 class OpenUrlJob;
+class CommandLauncherJob;
 }
 namespace SelectionMode
 {
@@ -116,10 +123,23 @@ 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;
 
+    /**
+     * Activates a user set action when double clicking the view's background.
+     */
+    void slotDoubleClickViewBackground(Qt::MouseButton button);
+
 public Q_SLOTS:
     /**
      * Opens each directory in \p dirs in a separate tab. If \a splitView is set,
@@ -334,6 +354,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();
 
@@ -619,6 +646,11 @@ private Q_SLOTS:
      */
     void slotKeyBindings();
 
+    /**
+     * Saves the session.
+     */
+    void slotSaveSession();
+
 private:
     /**
      * Sets up the various menus and actions and connects them.
@@ -648,7 +680,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.
@@ -705,6 +737,7 @@ private:
     QPointer<DolphinSettingsDialog> m_settingsDialog;
     DolphinBookmarkHandler *m_bookmarkHandler;
     SelectionMode::ActionTextHelper *m_actionTextHelper;
+    DisabledActionNotifier *m_disabledActionNotifier;
 
     KIO::OpenUrlJob *m_lastHandleUrlOpenJob;
 
@@ -714,10 +747,18 @@ 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;
+
+    KIO::CommandLauncherJob *m_job;
+
     friend class DolphinMainWindowTest;
 };