summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainview.cpp29
-rw-r--r--src/tabbar.cpp4
-rw-r--r--src/webtab.cpp22
3 files changed, 43 insertions, 12 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 3adc0ec9..63c10683 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -687,16 +687,25 @@ void MainView::detachTab(int index)
return;
WebTab *tab = webTab(index);
- QString label = tab->view()->title();
- QWidget *bar = _bars->widget(index);
-
- closeTab(index, false);
-
- MainWindow *w = Application::instance()->newMainWindow(false);
- w->mainView()->addTab(tab, Application::icon(tab->url()), label);
- QStackedWidget *stack = qobject_cast<QStackedWidget *>(w->mainView()->urlBarWidget());
- stack->insertWidget(0, bar);
- w->mainView()->updateTabBar();
+ KUrl u = tab->url();
+ kDebug() << u;
+ if( u.scheme() == QL1S("about") )
+ {
+ closeTab(index);
+ Application::instance()->loadUrl(u, Rekonq::NewWindow);
+ }
+ else
+ {
+ QString label = tab->view()->title();
+ QWidget *bar = _bars->widget(index);
+ closeTab(index, false);
+
+ MainWindow *w = Application::instance()->newMainWindow(false);
+ w->mainView()->addTab(tab, Application::icon( u ), label);
+ QStackedWidget *stack = qobject_cast<QStackedWidget *>(w->mainView()->urlBarWidget());
+ stack->insertWidget(0, bar);
+ w->mainView()->updateTabBar();
+ }
}
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index fca3c6b1..a2f269c4 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -273,7 +273,9 @@ void TabBar::contextMenu(int tab, const QPoint &pos)
menu.addAction(mainWindow->actionByName(QLatin1String("new_tab")));
menu.addAction( mainWindow->actionByName("clone_tab") );
- menu.addAction( mainWindow->actionByName("detach_tab") );
+
+ if(count() > 1)
+ menu.addAction( mainWindow->actionByName("detach_tab") );
menu.addSeparator();
menu.addAction( mainWindow->actionByName("close_tab") );
menu.addAction( mainWindow->actionByName("close_other_tabs") );
diff --git a/src/webtab.cpp b/src/webtab.cpp
index 62de6299..bc051e27 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -118,9 +118,29 @@ WebPage *WebTab::page()
}
+// TODO:
+// Import the "about" check and the one in protocolhandler
+// in some (static?) methods in NewTabPage
KUrl WebTab::url()
{
- return KUrl( view()->url() );
+ KUrl u = KUrl( view()->url() );
+ if( u.scheme() == QL1S("about") )
+ {
+ QWebElement rootElement = page()->mainFrame()->documentElement();
+ if( rootElement.document().findAll("#rekonq-newtabpage").count() == 0 )
+ return u;
+ if( rootElement.findAll(".favorites").count() > 0 )
+ return KUrl("about:favorites");
+ if( rootElement.findAll(".closedTabs").count() > 0 )
+ return KUrl("about:closedTabs");
+ if( rootElement.findAll(".history").count() > 0 )
+ return KUrl("about:history");
+ if( rootElement.findAll(".bookmarks").count() > 0 )
+ return KUrl("about:bookmarks");
+ if( rootElement.findAll(".downloads").count() > 0 )
+ return KUrl("about:downloads");
+ }
+ return u;
}