]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
Fix view mode-specific settings not always applying
[dolphin.git] / src / dolphinmainwindow.h
index e26bf50dd40a4e2d5f0493be29ff87451adb4a16..bf74b77b72a9fbaf730b55742e5baac9b51b0b01 100644 (file)
@@ -10,6 +10,7 @@
 #define DOLPHIN_MAINWINDOW_H
 
 #include "dolphintabwidget.h"
+#include "selectionmode/bottombar.h"
 #include "config-dolphin.h"
 #include <KFileItemActions>
 #include <kio/fileundomanager.h>
@@ -38,7 +39,6 @@ class KFileItem;
 class KFileItemList;
 class KJob;
 class KNewFileMenu;
-class KHelpMenu;
 class KToolBarPopupAction;
 class QToolButton;
 class PlacesPanel;
@@ -47,6 +47,9 @@ class TerminalPanel;
 namespace KIO {
     class OpenUrlJob;
 }
+namespace SelectionMode {
+    class ActionTextHelper;
+}
 
 /**
  * @short Main window for Dolphin.
@@ -136,7 +139,7 @@ public Q_SLOTS:
     /**
      * Tries to raise/activate the Dolphin window.
      */
-    void activateWindow();
+    void activateWindow(const QString &activationToken);
 
     bool isActiveWindow();
 
@@ -150,13 +153,11 @@ public Q_SLOTS:
     bool isUrlOpen(const QString &url);
 
     /**
-     * Determines if a URL or it's parent is open in any tab.
+     * @return Whether the item with @p url can be found in any view only by switching
+     * between already open tabs and scrolling in their primary or secondary view.
      * @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);
+    bool isItemVisibleInAnyView(const QString &urlOfItem);
 
 
     /**
@@ -244,11 +245,6 @@ protected:
     /** @see KMainWindow::readProperties() */
     void readProperties(const KConfigGroup& group) override;
 
-    /** Handles QWhatsThisClickedEvent and passes all others on. */
-    bool event(QEvent* event) override;
-    /** Handles QWhatsThisClickedEvent and passes all others on. */
-    bool eventFilter(QObject*, QEvent*) override;
-
     /** Sets a sane initial window size **/
     QSize sizeHint() const override;
 
@@ -313,6 +309,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();
 
@@ -333,6 +332,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();
 
@@ -342,6 +347,8 @@ private Q_SLOTS:
     void enableStopAction();
     void disableStopAction();
 
+    void toggleSelectionMode();
+
     void showFilterBar();
     void toggleFilterBar();
 
@@ -685,7 +692,6 @@ private:
     };
 
     KNewFileMenu* m_newFileMenu;
-    KHelpMenu* m_helpMenu;
     DolphinTabWidget* m_tabWidget;
     DolphinViewContainer* m_activeViewContainer;
 
@@ -693,10 +699,7 @@ private:
     DolphinRemoteEncoding* m_remoteEncoding;
     QPointer<DolphinSettingsDialog> m_settingsDialog;
     DolphinBookmarkHandler* m_bookmarkHandler;
-
-    // Members for the toolbar menu that is shown when the menubar is hidden:
-    QToolButton* m_controlButton;
-    QTimer* m_updateToolBarTimer;
+    SelectionMode::ActionTextHelper* m_actionTextHelper;
 
     KIO::OpenUrlJob *m_lastHandleUrlOpenJob;
 
@@ -710,6 +713,7 @@ private:
     QMenu m_searchTools;
     KFileItemActions m_fileItemActions;
 
+    friend class DolphinMainWindowTest;
 };
 
 inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const