X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/cd2e64154fd5446a7e19aff4cb147efe2f2ba31e..ffce84e759714e94de01a546009b4b41c64cdf28:/src/dolphinmainwindow.h diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 5bb17e79a..5f2ed20ca 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -10,8 +10,10 @@ #define DOLPHIN_MAINWINDOW_H #include "config-dolphin.h" +#include "disabledactionnotifier.h" #include "dolphintabwidget.h" #include "selectionmode/bottombar.h" +#include #include #include #include @@ -20,6 +22,7 @@ #include "panels/information/informationpanel.h" #endif +#include #include #include #include @@ -39,14 +42,19 @@ class KFileItem; class KFileItemList; class KJob; class KNewFileMenu; +class KRecentFilesAction; class KToolBarPopupAction; 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 +124,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 +355,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(); @@ -476,6 +504,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 */ @@ -614,6 +647,11 @@ private Q_SLOTS: */ void slotKeyBindings(); + /** + * Saves the session. + */ + void slotSaveSession(); + private: /** * Sets up the various menus and actions and connects them. @@ -643,7 +681,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. @@ -654,11 +692,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(); @@ -702,6 +738,7 @@ private: QPointer m_settingsDialog; DolphinBookmarkHandler *m_bookmarkHandler; SelectionMode::ActionTextHelper *m_actionTextHelper; + DisabledActionNotifier *m_disabledActionNotifier; KIO::OpenUrlJob *m_lastHandleUrlOpenJob; @@ -711,10 +748,20 @@ private: KToolBarPopupAction *m_backAction; KToolBarPopupAction *m_forwardAction; + KActionMenu *m_splitViewAction; + QAction *m_splitViewMenuAction; QMenu m_searchTools; KFileItemActions m_fileItemActions; + QTimer *m_sessionSaveTimer; + QFutureWatcher *m_sessionSaveWatcher; + bool m_sessionSaveScheduled; + + KIO::CommandLauncherJob *m_job; + + KRecentFilesAction *m_recentFiles = nullptr; + friend class DolphinMainWindowTest; };