]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
Restore the "Edit->Selection" menu from Konqueror 3 for file
[dolphin.git] / src / dolphinmainwindow.h
index 1676afb7e1e49e3560f8d7c80444993e50a6223e..e9332194f544cc1e1b039036f9eec1e13c5b3e1a 100644 (file)
@@ -23,7 +23,7 @@
 #define DOLPHIN_MAINWINDOW_H
 
 #include "dolphinview.h"
-#include "sidebarpage.h"
+#include "panels/panel.h"
 
 #include <config-nepomuk.h>
 
 #include <kio/fileundomanager.h>
 #include <ksortablelist.h>
 #include <kxmlguiwindow.h>
+#include <kactionmenu.h>
 
 #include <QtCore/QList>
 
+typedef KIO::FileUndoManager::CommandType CommandType;
+
 class KAction;
 class DolphinViewActionHandler;
 class DolphinApplication;
+class DolphinSearchBox;
+class DolphinSearchOptionsConfigurator;
+class DolphinSettingsDialog;
 class DolphinViewContainer;
+class DolphinRemoteEncoding;
 class KNewMenu;
 class KTabBar;
 class KUrl;
@@ -103,13 +110,6 @@ public:
     KAction* showMenuBarAction() const;
 
 public slots:
-    /**
-     * Handles the dropping of URLs to the given
-     * destination. This is only called by the TreeViewSidebarPage.
-     */
-    void dropUrls(const KUrl::List& urls,
-                  const KUrl& destination);
-
     /**
      * Pastes the clipboard data into the currently selected folder
      * of the active view. If not exactly one folder is selected,
@@ -123,7 +123,7 @@ public slots:
     int getId() const;
 
     /**
-     * Inform all affected dolphin components (sidebars, views) of an URL
+     * Inform all affected dolphin components (panels, views) of an URL
      * change.
      */
     void changeUrl(const KUrl& url);
@@ -151,7 +151,7 @@ signals:
     void urlChanged(const KUrl& url);
 
     /**
-     * Is emitted if information of an item is requested to be shown e. g. in the sidebar.
+     * Is emitted if information of an item is requested to be shown e. g. in the panel.
      * If item is null, no item information request is pending.
      */
     void requestItemInfo(const KFileItem& item);
@@ -172,11 +172,10 @@ private slots:
     /** Updates the 'Create New...' sub menu. */
     void updateNewMenu();
 
-    /**
-     * Shows the error information from the places model
-     * in the status bar.
-     */
-    void slotHandlePlacesError(const QString &message);
+    void createDirectory();
+
+    /** Shows the error message in the status bar of the active view. */
+    void showErrorMessage(const QString& message);
 
     /**
      * Updates the state of the 'Undo' menu action dependent
@@ -184,6 +183,9 @@ private slots:
      */
     void slotUndoAvailable(bool available);
 
+    /** Invoked when an action in the recent tabs menu is clicked. */
+    void restoreClosedTab(QAction* action);
+
     /** Sets the text of the 'Undo' menu action to \a text. */
     void slotUndoTextChanged(const QString& text);
 
@@ -192,7 +194,7 @@ private slots:
 
     /**
      * Copies all selected items to the clipboard and marks
-     * the items as cutted.
+     * the items as cut.
      */
     void cut();
 
@@ -242,10 +244,11 @@ private slots:
     void toggleEditLocation();
 
     /**
-     * Switches to the edit mode of the navigation bar. If the edit mode is
+     * Switches to the edit mode of the navigation bar and selects
+     * the whole URL, so that it can be replaced by the user. If the edit mode is
      * already active, it is assured that the navigation bar get focused.
      */
-    void editLocation();
+    void replaceLocation();
 
     /** Goes back on step of the URL history. */
     void goBack();
@@ -256,24 +259,39 @@ private slots:
     /** Goes up one hierarchy of the current URL. */
     void goUp();
 
+    /**
+     * Open the previous URL in the URL history in a new tab
+     * if the middle mouse button is clicked.
+     */
+    void goBack(Qt::MouseButtons buttons);
+
+    /**
+     * Open the next URL in the URL history in a new tab
+     * if the middle mouse button is clicked.
+     */
+    void goForward(Qt::MouseButtons buttons);
+
+    /**
+     * Open the URL one hierarchy above the current URL in a new tab
+     * if the middle mouse button is clicked.
+     */
+    void goUp(Qt::MouseButtons buttons);
+
     /** Goes to the home URL. */
     void goHome();
 
     /** Opens Kompare for 2 selected files. */
     void compareFiles();
 
-    /**
-     * Initiates a preview of the selected files
-     * on the desktop by the Previewer plasmoid.
-     */
-    void quickView();
-
     /**
      * Hides the menu bar if it is visible, makes the menu bar
      * visible if it is hidden.
      */
     void toggleShowMenuBar();
 
+    /** Opens a terminal window for the current location. */
+    void openTerminal();
+
     /** Opens the settings dialog for Dolphin. */
     void editSettings();
 
@@ -286,12 +304,15 @@ private slots:
      */
     void slotSelectionChanged(const KFileItemList& selection);
 
+    /** Enables changing of tabs via mouse wheel. */
+    void slotWheelMoved(int wheelDelta);
+
     /** Emits the signal requestItemInfo(). */
     void slotRequestItemInfo(const KFileItem&);
 
     /**
      * Updates the state of the 'Back' and 'Forward' menu
-     * actions corresponding the the current history.
+     * actions corresponding to the current history.
      */
     void updateHistory();
 
@@ -309,11 +330,28 @@ private slots:
      */
     void openNewTab(const KUrl& url);
 
+    void activateNextTab();
+
+    void activatePrevTab();
+
+    /**
+     * Opens the selected folder in a new tab.
+     */
+    void openInNewTab();
+
+    /**
+     * Opens the selected folder in a new window.
+     */
+    void openInNewWindow();
+
     /** Toggles the active view if two views are shown within the main window. */
     void toggleActiveView();
 
-    /** Called when the view is doing a file operation, like renaming, copying, moving etc. */
-    void slotDoingOperation(KIO::FileUndoManager::CommandType type);
+    /**
+     * Indicates in the statusbar that the execution of the command \a command
+     * has been finished.
+     */
+    void showCommand(CommandType command);
 
     /**
      * Activates the tab with the index \a index, which means that the current view
@@ -329,6 +367,7 @@ private slots:
      */
     void closeTab(int index);
 
+
     /**
      * Opens a context menu for the tab with the index \a index
      * on the position \a pos.
@@ -342,6 +381,31 @@ private slots:
      */
     void handlePlacesClick(const KUrl& url, Qt::MouseButtons buttons);
 
+    /**
+     * Is connected to the KTabBar signal testCanDecode() and adjusts
+     * the output parameter \a accept.
+     */
+    void slotTestCanDecode(const QDragMoveEvent* event, bool& accept);
+
+    /**
+     * Is connected with the Dolphin search box and the search configurator
+     * and triggers a Nepomuk search.
+     */
+    void searchItems();
+
+    /**
+     * Is connected to the QTabBar signal tabMoved(int from, int to).
+     * Reorders the list of tabs after a tab was moved in the tab bar
+     * and sets m_tabIndex to the new index of the current tab.
+     */
+    void slotTabMoved(int from, int to);
+
+    /**
+     * Is connected to the searchbox signal 'requestSearchOptions' and
+     * takes care to show the search options.
+     */
+    void showSearchOptions();
+
 private:
     DolphinMainWindow(int id);
     void init();
@@ -360,6 +424,11 @@ private:
     void updateViewActions();
     void updateGoActions();
 
+    /**
+     * Adds the tab[\a index] to the closed tab menu's list of actions.
+     */
+    void rememberClosedTab(int index);
+
     /**
      * Connects the signals from the created DolphinView with
      * the DolphinViewContainer \a container with the corresponding slots of
@@ -381,6 +450,23 @@ private:
 
     bool isKompareInstalled() const;
 
+    void createSecondaryView(int tabIndex);
+
+    /**
+     * Helper method for saveProperties() and readProperties(): Returns
+     * the property string for a tab with the index \a tabIndex and
+     * the property \a property.
+     */
+    QString tabProperty(const QString& property, int tabIndex) const;
+
+    /**
+     * Sets the window caption to url.fileName() if this is non-empty, 
+     * "/" if the URL is "file:///", and url.protocol() otherwise.
+     */
+    void setUrlAsCaption(const KUrl& url);
+
+    QString squeezedText(const QString& text) const;
+
 private:
     /**
      * Implements a custom error handling for the undo manager. This
@@ -396,10 +482,13 @@ private:
     };
 
     KNewMenu* m_newMenu;
+    KActionMenu* m_recentTabsMenu;
     KAction* m_showMenuBar;
     KTabBar* m_tabBar;
     DolphinViewContainer* m_activeViewContainer;
     QVBoxLayout* m_centralWidgetLayout;
+    DolphinSearchBox* m_searchBox;
+    DolphinSearchOptionsConfigurator* m_searchOptionsConfigurator;
     int m_id;
 
     struct ViewTab
@@ -415,9 +504,8 @@ private:
     QList<ViewTab> m_viewTab;
 
     DolphinViewActionHandler* m_actionHandler;
-
-    /// remember pending undo operations until they are finished
-    QList<KIO::FileUndoManager::CommandType> m_undoCommandTypes;
+    DolphinRemoteEncoding* m_remoteEncoding;
+    QPointer<DolphinSettingsDialog> m_settingsDialog;
 };
 
 inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const