diff options
author | Nikhil Marathe <nsm.nikhil@gmail.com> | 2010-08-07 17:33:55 +0530 |
---|---|---|
committer | Nikhil Marathe <nsm.nikhil@gmail.com> | 2010-08-07 17:33:55 +0530 |
commit | 15cf9d193659ee5c9fedddcc33c31ff6f0e42cd6 (patch) | |
tree | dcb6e76fb2820ae0a68bb3ad12262eb5dcaf575b | |
parent | Editable urlbar :D (diff) | |
download | rekonq-15cf9d193659ee5c9fedddcc33c31ff6f0e42cd6.tar.xz |
Added option to detachTab() to allow moving to existing window
-rw-r--r-- | src/mainview.cpp | 8 | ||||
-rw-r--r-- | src/mainview.h | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index a771e3d7..0de4ea40 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -702,7 +702,7 @@ void MainView::resizeEvent(QResizeEvent *event) } -void MainView::detachTab(int index) +void MainView::detachTab(int index, MainWindow *toWindow) { if (index < 0) index = currentIndex(); @@ -723,7 +723,11 @@ void MainView::detachTab(int index) UrlBar *bar = _widgetBar->urlBar(index); closeTab(index, false); - MainWindow *w = Application::instance()->newMainWindow(false); + MainWindow *w; + if( toWindow == NULL ) + w = Application::instance()->newMainWindow(false); + else + w = toWindow; w->mainView()->addTab(tab, Application::icon(u), label); w->mainView()->widgetBar()->insertWidget(0, bar); w->mainView()->updateTabBar(); diff --git a/src/mainview.h b/src/mainview.h index 2ece6fe4..cc7eb8da 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -129,7 +129,12 @@ public slots: void closeTab(int index = -1, bool del = true); void closeOtherTabs(int index = -1); void reloadTab(int index = -1); - void detachTab(int index = -1); + /** + * Detaches tab at @c index to a new window. + * If @c toWindow is not null, the tab is instead + * added to existing MainWindow @c toWindow. + */ + void detachTab(int index = -1, MainWindow *toWindow = NULL); void reloadAllTabs(); void nextTab(); |