┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorLuca Beltrame <[email protected]>2014-07-22 15:58:03 +0200
committerLuca Beltrame <[email protected]>2014-07-22 15:58:03 +0200
commitde3e2ae40f626c1368dfd40bace54ef3e7815833 (patch)
treee6ff8a7225929ae1002a5756110f228845d3f35b /src/dolphinmainwindow.cpp
parent2b75a555caa81a992a289a13119dca5cce79d4cc (diff)
parent9a6950657215f2195001795e21785d276fb20744 (diff)
Merge branch 'master' into frameworks
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index fce99bb58..84303fda3 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -1225,6 +1225,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);
@@ -1354,6 +1359,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()));
KStandardAction::forward(this, SLOT(goForward()), actionCollection());
KStandardAction::up(this, SLOT(goUp()), actionCollection());