X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/1dfafcb176797e5075d0043e70ad07bde8bcc372..e7bc1cb09dd152806925b152688e4e45731a5657:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 41bd626ee..d321d3b4a 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -771,7 +771,8 @@ void DolphinMainWindow::togglePanelLockState() 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); } } @@ -1219,6 +1220,11 @@ void DolphinMainWindow::activeViewChanged() 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); @@ -1349,6 +1355,15 @@ void DolphinMainWindow::setupActions() 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)));