]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
SVN_SILENT made messages (.desktop file)
[dolphin.git] / src / dolphinmainwindow.cpp
index 41bd626ee8cb0aa17492f769b85e4a3a82c08d9b..d321d3b4a763e4df4d0bdd7e57cb35a0df162176 100644 (file)
@@ -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)));