]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
Fix includes
[dolphin.git] / src / dolphinmainwindow.h
index 4816837fc5d8a143b266d34b925aa46528761864..0505037ce7a99628371bdb5a70efc259de30ba7b 100644 (file)
 
 #include <config-baloo.h>
 
-#include <KFileItemDelegate>
 #include <kio/fileundomanager.h>
 #include <ksortablelist.h>
 #include <kxmlguiwindow.h>
-#include <KIcon>
+#include <QIcon>
 #include <KUrl>
 
 #include <QList>
@@ -39,18 +38,14 @@ typedef KIO::FileUndoManager::CommandType CommandType;
 class DolphinViewActionHandler;
 class DolphinApplication;
 class DolphinSettingsDialog;
-class DolphinTabBar;
 class DolphinViewContainer;
 class DolphinRemoteEncoding;
-class DolphinTabPage;
-class KAction;
+class DolphinTabWidget;
 class KFileItem;
 class KFileItemList;
 class KJob;
 class KNewFileMenu;
-class QSplitter;
 class QToolButton;
-class QVBoxLayout;
 class QIcon;
 
 /**
@@ -150,11 +145,6 @@ signals:
      */
     void settingsChanged();
 
-    /**
-     * Is emitted when a tab has been closed.
-     */
-    void rememberClosedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl);
-
 protected:
     /** @see QWidget::showEvent() */
     virtual void showEvent(QShowEvent* event);
@@ -263,13 +253,6 @@ private slots:
      */
     void togglePanelLockState();
 
-    /**
-     * Is invoked if the Places panel got visible/invisible and takes care
-     * that the places-selector of all views is only shown if the Places panel
-     * is invisible.
-     */
-    void slotPlacesPanelVisibilityChanged(bool visible);
-
     /** Goes back one step of the URL history. */
     void goBack();
 
@@ -344,30 +327,21 @@ private slots:
     /** Open a new main window. */
     void openNewMainWindow();
 
-    /** Opens a new view with the current URL that is part of a tab. */
-    void openNewTab();
-
     /**
-     * Opens a new tab in the background showing the URL \a primaryUrl and the
-     * optional URL \a secondaryUrl.
+     * Opens a new view with the current URL that is part of a tab and
+     * activates it.
      */
-    void openNewTab(const KUrl& primaryUrl, const KUrl& secondaryUrl = KUrl());
+    void openNewActivatedTab();
 
     /**
-     * Opens a new tab showing the  URL \a primaryUrl and the optional URL
-     * \a secondaryUrl and activates the tab.
+     * Opens a new tab in the background showing the URL \a url.
      */
-    void openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl = KUrl());
+    void openNewTab(const KUrl& url);
 
     /**
-     * Opens a new tab showing the url from tab at the given \a index and
-     * activates the tab.
+     * Opens a new tab showing the URL \a url and activates the tab.
      */
-    void openNewActivatedTab(int index);
-
-    void activateNextTab();
-
-    void activatePrevTab();
+    void openNewActivatedTab(const KUrl& url);
 
     /**
      * Opens the selected folder in a new tab.
@@ -385,33 +359,6 @@ private slots:
      */
     void showCommand(CommandType command);
 
-    /**
-     * Activates the tab with the index \a index, which means that the current view
-     * is replaced by the view of the given tab.
-     */
-    void setActiveTab(int index);
-
-    /** Closes the currently active tab. */
-    void closeTab();
-
-    /**
-     * Closes the tab with the index \a index and activates the tab with index - 1.
-     */
-    void closeTab(int index);
-
-    /**
-     * Opens the tab with the index \a index in a new Dolphin instance and closes
-     * this tab.
-     */
-    void detachTab(int index);
-
-    /**
-     * 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);
-
     /**
      * If the URL can be listed, open it in the current view, otherwise
      * run it through KRun.
@@ -424,12 +371,6 @@ private slots:
      */
     void slotHandleUrlStatFinished(KJob* job);
 
-    /**
-     * Is connected to the KTabBar signal receivedDropEvent.
-     * Allows dragging and dropping files onto tabs.
-     */
-    void tabDropEvent(int tab, QDropEvent* event);
-
     /**
      * Is invoked when the write state of a folder has been changed and
      * enables/disables the "Create New..." menu entry.
@@ -467,17 +408,31 @@ private slots:
      */
     void slotPlaceActivated(const KUrl& url);
 
-    void activeViewChanged();
+    /**
+     * Is called if the another view has been activated by changing the current
+     * tab or activating another view in split-view mode.
+     *
+     * Activates the given view, which means that all menu actions are applied
+     * to this view. When having a split view setup, the nonactive view is
+     * usually shown in darker colors.
+     */
+    void activeViewChanged(DolphinViewContainer* viewContainer);
+
+    void closedTabsCountChanged(unsigned int count);
 
-private:
     /**
-     * Activates the given view, which means that
-     * all menu actions are applied to this view. When
-     * having a split view setup, the nonactive view
-     * is usually shown in darker colors.
+     * Is called if a new tab has been opened or a tab has been closed to
+     * enable/disable the tab actions.
+     */
+    void tabCountChanged(int count);
+
+    /**
+     * Sets the window caption to url.fileName() if this is non-empty,
+     * "/" if the URL is "file:///", and url.protocol() otherwise.
      */
-    void setActiveViewContainer(DolphinViewContainer* view);
+    void setUrlAsCaption(const KUrl& url);
 
+private:
     void setupActions();
     void setupDockWidgets();
     void updateEditActions();
@@ -492,7 +447,7 @@ private:
      * case if it has not added already to the toolbar.
      * @return True if the action has been added to the menu.
      */
-    bool addActionToMenu(QAction* action, KMenu* menu);
+    bool addActionToMenu(QAction* action, QMenu* menu);
 
     /**
      * Connects the signals from the created DolphinView with
@@ -510,20 +465,8 @@ private:
      */
     void updateSplitAction();
 
-    /** Returns the name of the tab for the URL \a url. */
-    QString tabName(const KUrl& url) const;
-
-
     bool isKompareInstalled() 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;
-
     /**
      * Creates an action for showing/hiding a panel, that is accessible
      * in "Configure toolbars..." and "Configure shortcuts...". This is necessary
@@ -550,14 +493,10 @@ private:
     };
 
     KNewFileMenu* m_newFileMenu;
-    DolphinTabBar* m_tabBar;
+    DolphinTabWidget* m_tabWidget;
     DolphinViewContainer* m_activeViewContainer;
-    QVBoxLayout* m_centralWidgetLayout;
     int m_id;
 
-    int m_tabIndex;
-    QList<DolphinTabPage*> m_viewTab;
-
     DolphinViewActionHandler* m_actionHandler;
     DolphinRemoteEncoding* m_remoteEncoding;
     QWeakPointer<DolphinSettingsDialog> m_settingsDialog;