X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c035e95e1d74fecd8267b08009c616232e2c16b0..594e0a394341e92069dc16aa0aca5f42ac362274:/src/dolphinmainwindow.h diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index bff0ef4de..ecc84b971 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 @@ -40,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 { @@ -129,6 +136,11 @@ public: 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, @@ -197,8 +209,9 @@ public Q_SLOTS: /** * Opens a new tab in the background showing the URL \a url. + * @return A pointer to the opened DolphinTabPage. */ - void openNewTab(const QUrl &url); + DolphinTabPage *openNewTab(const QUrl &url); /** * Opens a new tab showing the URL \a url and activate it. @@ -283,6 +296,7 @@ private Q_SLOTS: void updateNewMenu(); void createDirectory(); + void createFile(); /** Shows the error message in the status bar of the active view. */ void showErrorMessage(const QString &message); @@ -343,6 +357,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(); @@ -384,10 +405,21 @@ private Q_SLOTS: void togglePanelLockState(); /** - * Is invoked if the Terminal panel got visible/invisible and takes care - * that the active view has the focus if the Terminal panel is invisible. + * Is invoked whenever the Terminal panel visibility is changed by the user and then moves the focus + * to the active view if the panel was hidden. + * @note The opposite action (putting focus to the Terminal) is not handled + * here but in TerminalPanel::showEvent(). + * @param visible the new visibility state of the terminal panel */ - void slotTerminalPanelVisibilityChanged(); + void slotTerminalPanelVisibilityChanged(bool visible); + + /** + * Is invoked whenever the Places panel visibility is changed by the user and then either moves the focus + * - to the Places panel if it was made visible, or + * - to the active view if the panel was hidden. + * @param visible the new visibility state of the Places panel + */ + void slotPlacesPanelVisibilityChanged(bool visible); /** Goes back one step of the URL history. */ void goBack(); @@ -437,8 +469,11 @@ private Q_SLOTS: /** Opens a terminal window for the URL. */ void openTerminalJob(const QUrl &url); - /** Focus a Terminal Panel. */ - void focusTerminalPanel(); + /** Toggles focus to/from a Terminal Panel. */ + void toggleTerminalPanelFocus(); + + /** Toggles focus to/from the Places Panel. */ + void togglePlacesPanelFocus(); /** Opens the settings dialog for Dolphin. */ void editSettings(); @@ -662,7 +697,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. @@ -719,6 +754,7 @@ private: QPointer m_settingsDialog; DolphinBookmarkHandler *m_bookmarkHandler; SelectionMode::ActionTextHelper *m_actionTextHelper; + DisabledActionNotifier *m_disabledActionNotifier; KIO::OpenUrlJob *m_lastHandleUrlOpenJob; @@ -728,6 +764,8 @@ private: KToolBarPopupAction *m_backAction; KToolBarPopupAction *m_forwardAction; + KActionMenu *m_splitViewAction; + QAction *m_splitViewMenuAction; QMenu m_searchTools; KFileItemActions m_fileItemActions; @@ -736,6 +774,10 @@ private: QFutureWatcher *m_sessionSaveWatcher; bool m_sessionSaveScheduled; + KIO::CommandLauncherJob *m_job; + + KRecentFilesAction *m_recentFiles = nullptr; + friend class DolphinMainWindowTest; };