diff options
| author | Peter Penz <[email protected]> | 2008-08-12 18:59:25 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-08-12 18:59:25 +0000 |
| commit | b354c7503dc4078f417371ffd32606cd4c635792 (patch) | |
| tree | b980c0a61631b860706cac8b303c68ba7538e012 /src/dolphinmainwindow.cpp | |
| parent | 6f79a7d9737cbdb907e8982819d5e691cecd2f39 (diff) | |
Assure that the "Close Tab" action gets disabled when only one tab is open.
BUG: 168904
svn path=/trunk/KDE/kdebase/apps/; revision=845995
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 76330d1d4..fdf394722 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -278,6 +278,8 @@ void DolphinMainWindow::openNewTab(const KUrl& url) viewTab.primaryView->view()->reload(); m_viewTab.append(viewTab); + + actionCollection()->action("close_tab")->setEnabled(true); } void DolphinMainWindow::toggleActiveView() @@ -723,6 +725,7 @@ void DolphinMainWindow::closeTab(int index) // closing the last tab is not possible if (m_viewTab.count() == 1) { m_tabBar->removeTab(0); + actionCollection()->action("close_tab")->setEnabled(false); } else { m_tabBar->blockSignals(false); } @@ -912,6 +915,7 @@ void DolphinMainWindow::setupActions() QAction* closeTab = new QAction(KIcon("tab-close"), i18nc("@action:inmenu File", "Close Tab"), this); closeTab->setShortcut(Qt::CTRL | Qt::Key_W); + closeTab->setEnabled(false); connect(closeTab, SIGNAL(triggered()), this, SLOT(closeTab())); actionCollection()->addAction("close_tab", closeTab); |
