┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-04-12 16:12:57 +0000
committerPeter Penz <[email protected]>2008-04-12 16:12:57 +0000
commit030a5d5433e0ae613f4de32d9d1277ac2405b8f4 (patch)
tree104b4d0aabbe2f86bb90870dbc9560272c176e13 /src/dolphinmainwindow.cpp
parent3b06c2120dad8efc79471a82b81c08f2d5834062 (diff)
when clicking with the middle mouse button on a directory, a new tab should be opened
svn path=/trunk/KDE/kdebase/apps/; revision=796116
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 623634f9e..84d22ec4f 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -262,6 +262,25 @@ void DolphinMainWindow::openNewTab()
m_tabBar->setCurrentIndex(m_viewTab.count() - 1);
}
+void DolphinMainWindow::openNewTab(const KUrl& url)
+{
+ if (m_viewTab.count() == 1) {
+ // Only one view is open currently and hence no tab is shown at
+ // all. Before creating a tab for 'url', provide a tab for the current URL.
+ m_tabBar->addTab(KIcon("folder"), m_activeViewContainer->url().fileName());
+ }
+
+ m_tabBar->addTab(KIcon("folder"), url.fileName());
+
+ ViewTab viewTab;
+ viewTab.splitter = new QSplitter(this);
+ viewTab.primaryView = new DolphinViewContainer(this, viewTab.splitter, url);
+ connectViewSignals(viewTab.primaryView);
+ viewTab.primaryView->view()->reload();
+
+ m_viewTab.append(viewTab);
+}
+
void DolphinMainWindow::toggleActiveView()
{
if (m_viewTab[m_tabIndex].secondaryView == 0) {
@@ -1058,6 +1077,8 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
this, SLOT(toggleActiveView()));
connect(view, SIGNAL(doingOperation(KonqFileUndoManager::CommandType)),
this, SLOT(slotDoingOperation(KonqFileUndoManager::CommandType)));
+ connect(view, SIGNAL(tabRequested(const KUrl&)),
+ this, SLOT(openNewTab(const KUrl&)));
const KUrlNavigator* navigator = container->urlNavigator();
connect(navigator, SIGNAL(urlChanged(const KUrl&)),
@@ -1085,25 +1106,6 @@ void DolphinMainWindow::updateSplitAction()
}
}
-void DolphinMainWindow::openNewTab(const KUrl& url)
-{
- if (m_viewTab.count() == 1) {
- // Only one view is open currently and hence no tab is shown at
- // all. Before creating a tab for 'url', provide a tab for the current URL.
- m_tabBar->addTab(KIcon("folder"), m_activeViewContainer->url().fileName());
- }
-
- m_tabBar->addTab(KIcon("folder"), url.fileName());
-
- ViewTab viewTab;
- viewTab.splitter = new QSplitter(this);
- viewTab.primaryView = new DolphinViewContainer(this, viewTab.splitter, url);
- connectViewSignals(viewTab.primaryView);
- viewTab.primaryView->view()->reload();
-
- m_viewTab.append(viewTab);
-}
-
DolphinMainWindow::UndoUiInterface::UndoUiInterface(DolphinMainWindow* mainWin) :
KonqFileUndoManager::UiInterface(mainWin),
m_mainWin(mainWin)