X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/1c5b6d4d1042877863801e3c0b683e8a9c41be18..8e55f2c2409fd6ca9ebc66a6568f4d3bcbef7576:/src/dolphinmainwindow.h diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 1a3ec4efb..fe844ad1b 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -10,12 +10,13 @@ #define DOLPHIN_MAINWINDOW_H #include "dolphintabwidget.h" -#include +#include "selectionmode/bottombar.h" +#include "config-dolphin.h" #include #include #include -#ifdef HAVE_BALOO +#if HAVE_BALOO #include "panels/information/informationpanel.h" #endif @@ -47,6 +48,9 @@ class TerminalPanel; namespace KIO { class OpenUrlJob; } +namespace SelectionMode { + class ActionTextHelper; +} /** * @short Main window for Dolphin. @@ -138,6 +142,8 @@ public Q_SLOTS: */ void activateWindow(); + bool isActiveWindow(); + /** * Determines if a URL is open in any tab. * @note Use of QString instead of QUrl is required to be callable via DBus. @@ -147,6 +153,15 @@ public Q_SLOTS: */ bool isUrlOpen(const QString &url); + /** + * Determines if a URL or it's parent is open in any tab. + * @note Use of QString instead of QUrl is required to be callable via DBus. + * + * @param url URL to look for + * @returns true if url or it's parent is currently open in a tab, false otherwise. + */ + bool isUrlOrParentOpen(const QString &url); + /** * Pastes the clipboard data into the currently selected folder @@ -302,6 +317,9 @@ private Q_SLOTS: */ void updatePasteAction(); + /** Calls DolphinViewContainer::setSelectionMode() for m_activeViewContainer. */ + void slotSetSelectionMode(bool enabled, SelectionMode::BottomBar::Contents bottomBarContents); + /** Selects all items from the active view. */ void selectAll(); @@ -322,6 +340,12 @@ private Q_SLOTS: /** Dedicated action to open the stash:/ ioslave in split view. */ void toggleSplitStash(); + /** Copies all selected items to the inactive view. */ + void copyToInactiveSplitView(); + + /** Moves all selected items to the inactive view. */ + void moveToInactiveSplitView(); + /** Reloads the currently active view. */ void reloadView(); @@ -331,6 +355,8 @@ private Q_SLOTS: void enableStopAction(); void disableStopAction(); + void toggleSelectionMode(); + void showFilterBar(); void toggleFilterBar(); @@ -399,6 +425,12 @@ private Q_SLOTS: /** Opens a terminal window for the current location. */ void openTerminal(); + /** Opens terminal windows for the selected items' locations. */ + void openTerminalHere(); + + /** Opens a terminal window for the URL. */ + void openTerminalJob(const QUrl& url); + /** Focus a Terminal Panel. */ void focusTerminalPanel(); @@ -475,14 +507,11 @@ private Q_SLOTS: * @pos Position in screen coordinates. * @item File item context. If item is null, the context menu * should be applied to \a url. + * @selectedItems The selected items for which the context menu + * is opened. This list generally includes \a item. * @url URL which contains \a item. - * @customActions Actions that should be added to the context menu, - * if the file item is null. */ - void openContextMenu(const QPoint& pos, - const KFileItem& item, - const QUrl& url, - const QList& customActions); + void openContextMenu(const QPoint& pos, const KFileItem& item, const KFileItemList &selectedItems, const QUrl& url); /** * Updates the menu that is by default at the right end of the toolbar. @@ -653,6 +682,9 @@ private: */ bool addHamburgerMenuToToolbar(); + /** Creates an action representing an item in the URL navigator history */ + static QAction *urlNavigatorHistoryAction(const KUrlNavigator *urlNavigator, int historyIndex, QObject *parent = nullptr); + private: /** * Implements a custom error handling for the undo manager. This @@ -676,6 +708,7 @@ private: DolphinRemoteEncoding* m_remoteEncoding; QPointer m_settingsDialog; DolphinBookmarkHandler* m_bookmarkHandler; + SelectionMode::ActionTextHelper* m_actionTextHelper; // Members for the toolbar menu that is shown when the menubar is hidden: QToolButton* m_controlButton; @@ -693,6 +726,7 @@ private: QMenu m_searchTools; KFileItemActions m_fileItemActions; + friend class DolphinMainWindowTest; }; inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const