summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-12-16 15:24:53 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-12-16 15:24:53 +0100
commit6b3531099f72a7f460c15312707b65ca0415cfe4 (patch)
tree5f1c9719c6d948bddee6260aeda6b6596d4ff1d9 /src/mainview.cpp
parentCleaner file management (diff)
downloadrekonq-6b3531099f72a7f460c15312707b65ca0415cfe4.tar.xz
detach tab action
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 0eb292ef..413d1b45 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -87,7 +87,8 @@ MainView::MainView(MainWindow *parent)
connect(m_tabBar, SIGNAL(closeOtherTabs(int)), this, SLOT(closeOtherTabs(int)));
connect(m_tabBar, SIGNAL(reloadTab(int)), this, SLOT(reloadTab(int)));
connect(m_tabBar, SIGNAL(reloadAllTabs()), this, SLOT(reloadAllTabs()));
-
+ connect(m_tabBar, SIGNAL(detachTab(int)), this, SLOT(detachTab(int)));
+
connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
// current page index changing
@@ -648,3 +649,17 @@ void MainView::resizeEvent(QResizeEvent *event)
updateTabBar();
KTabWidget::resizeEvent(event);
}
+
+
+void MainView::detachTab(int index)
+{
+ if (index < 0)
+ index = currentIndex();
+ if (index < 0 || index >= count())
+ return;
+
+ KUrl url = webTab(index)->view()->url();
+ closeTab(index);
+
+ Application::instance()->loadUrl(url, Rekonq::NewWindow);
+}