void DolphinMainWindow::slotPlacesPanelVisibilityChanged(bool visible)
{
foreach (DolphinTabPage* tabPage, m_viewTab) {
- tabPage->setPlacesSelectorVisible(visible);
+ // The Places selector in the location bar should be shown if and only if the Places panel is hidden.
+ tabPage->setPlacesSelectorVisible(!visible);
}
}
setActiveViewContainer(tabPage->activeViewContainer());
}
+void DolphinMainWindow::closedTabsCountChanged(unsigned int count)
+{
+ actionCollection()->action("undo_close_tab")->setEnabled(count > 0);
+}
+
void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContainer)
{
Q_ASSERT(viewContainer);
recentTabsMenu, SLOT(rememberClosedTab(KUrl,KUrl)));
connect(recentTabsMenu, SIGNAL(restoreClosedTab(KUrl,KUrl)),
this, SLOT(openNewActivatedTab(KUrl,KUrl)));
+ connect(recentTabsMenu, SIGNAL(closedTabsCountChanged(uint)),
+ this, SLOT(closedTabsCountChanged(uint)));
+
+ KAction* undoCloseTab = actionCollection()->addAction("undo_close_tab");
+ undoCloseTab->setText(i18nc("@action:inmenu File", "Undo close tab"));
+ undoCloseTab->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_T);
+ undoCloseTab->setIcon(KIcon("edit-undo"));
+ undoCloseTab->setEnabled(false);
+ connect(undoCloseTab, SIGNAL(triggered()), recentTabsMenu, SLOT(undoCloseTab()));
KAction* forwardAction = KStandardAction::forward(this, SLOT(goForward()), actionCollection());
connect(forwardAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goForward(Qt::MouseButtons)));