diff options
| author | Arjun AK <[email protected]> | 2014-07-22 17:31:49 +0530 |
|---|---|---|
| committer | Arjun AK <[email protected]> | 2014-07-22 17:31:49 +0530 |
| commit | 9a6950657215f2195001795e21785d276fb20744 (patch) | |
| tree | 1fb1077b8e79dd2e59754fff6aa2f5f7c3f7c348 /src/dolphinmainwindow.cpp | |
| parent | 0f2f9fd5b8d105dea3da5b493358388fd883cb30 (diff) | |
make CTRL+SHIFT+T reopen last closed tab
BUG: 336818
FEATURE: 118994
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index b51389fd4..d321d3b4a 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1220,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); @@ -1350,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))); |
