┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.h
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2014-08-10 18:52:06 +0200
committerEmmanuel Pescosta <[email protected]>2014-08-10 18:52:06 +0200
commit38381bc6a2999b1d8a0b8a6e2b8d703faa0944d9 (patch)
tree62d797b7f34cabd8ff48db15afd469da1ba01612 /src/dolphinmainwindow.h
parent1ffb64db1f6d3436db6e637f8669319e96a17797 (diff)
Implemented DolphinTabWidget class to encapsulate the tab handling from DolphinMainWindow.
REVIEW: 119115
Diffstat (limited to 'src/dolphinmainwindow.h')
-rw-r--r--src/dolphinmainwindow.h99
1 files changed, 20 insertions, 79 deletions
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index 6f37f42ee..7bce7f13e 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -38,19 +38,16 @@ typedef KIO::FileUndoManager::CommandType CommandType;
class DolphinViewActionHandler;
class DolphinApplication;
class DolphinSettingsDialog;
-class DolphinTabBar;
class DolphinViewContainer;
class DolphinRemoteEncoding;
-class DolphinTabPage;
+class DolphinTabWidget;
class KAction;
class KFileItem;
class KFileItemList;
class KJob;
class KNewFileMenu;
class KUrl;
-class QSplitter;
class QToolButton;
-class QVBoxLayout;
/**
* @short Main window for Dolphin.
@@ -149,11 +146,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);
@@ -262,13 +254,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();
@@ -343,8 +328,11 @@ 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 view with the current URL that is part of a tab and
+ * activates it.
+ */
+ void openNewActivatedTab();
/**
* Opens a new tab in the background showing the URL \a primaryUrl and the
@@ -359,16 +347,6 @@ private slots:
void openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl = KUrl());
/**
- * Opens a new tab showing the url from tab at the given \a index and
- * activates the tab.
- */
- void openNewActivatedTab(int index);
-
- void activateNextTab();
-
- void activatePrevTab();
-
- /**
* Opens the selected folder in a new tab.
*/
void openInNewTab();
@@ -385,33 +363,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 +375,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.
*/
@@ -466,19 +411,25 @@ 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 setActiveViewContainer(DolphinViewContainer* view);
+ void tabCountChanged(int count);
+private:
void setupActions();
void setupDockWidgets();
void updateEditActions();
@@ -511,10 +462,6 @@ private:
*/
void updateSplitAction();
- /** Returns the name of the tab for the URL \a url. */
- QString tabName(const KUrl& url) const;
-
-
bool isKompareInstalled() const;
/**
@@ -523,8 +470,6 @@ private:
*/
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
@@ -551,14 +496,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;