this, SLOT(activeViewChanged(DolphinViewContainer*)));
connect(m_tabWidget, SIGNAL(tabCountChanged(int)),
this, SLOT(tabCountChanged(int)));
+ connect(m_tabWidget, SIGNAL(currentUrlChanged(KUrl)),
+ this, SLOT(setUrlAsCaption(KUrl)));
setCentralWidget(m_tabWidget);
setupActions();
updatePasteAction();
updateViewActions();
updateGoActions();
- setUrlAsCaption(url);
emit urlChanged(url);
}
updateGoActions();
const KUrl url = viewContainer->url();
- setUrlAsCaption(url);
-
emit urlChanged(url);
}
actionCollection()->action("activate_prev_tab")->setEnabled(enableTabActions);
}
+void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
+{
+ QString caption;
+ if (!url.isLocalFile()) {
+ caption.append(url.protocol() + " - ");
+ if (url.hasHost()) {
+ caption.append(url.host() + " - ");
+ }
+ }
+
+ const QString fileName = url.fileName().isEmpty() ? "/" : url.fileName();
+ caption.append(fileName);
+
+ setCaption(caption);
+}
+
void DolphinMainWindow::setupActions()
{
// setup 'File' menu
DolphinRecentTabsMenu* recentTabsMenu = new DolphinRecentTabsMenu(this);
actionCollection()->addAction("closed_tabs", recentTabsMenu);
- connect(m_tabWidget, SIGNAL(rememberClosedTab(KUrl,KUrl)),
- recentTabsMenu, SLOT(rememberClosedTab(KUrl,KUrl)));
- connect(recentTabsMenu, SIGNAL(restoreClosedTab(KUrl,KUrl)),
- this, SLOT(openNewActivatedTab(KUrl,KUrl)));
+ connect(m_tabWidget, SIGNAL(rememberClosedTab(KUrl,QByteArray)),
+ recentTabsMenu, SLOT(rememberClosedTab(KUrl,QByteArray)));
+ connect(recentTabsMenu, SIGNAL(restoreClosedTab(QByteArray)),
+ m_tabWidget, SLOT(restoreClosedTab(QByteArray)));
connect(recentTabsMenu, SIGNAL(closedTabsCountChanged(uint)),
this, SLOT(closedTabsCountChanged(uint)));
return installed;
}
-void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
-{
- QString caption;
- if (!url.isLocalFile()) {
- caption.append(url.protocol() + " - ");
- if (url.hasHost()) {
- caption.append(url.host() + " - ");
- }
- }
-
- const QString fileName = url.fileName().isEmpty() ? "/" : url.fileName();
- caption.append(fileName);
-
- setCaption(caption);
-}
-
void DolphinMainWindow::createPanelAction(const KIcon& icon,
const QKeySequence& shortcut,
QAction* dockAction,