From: Peter Penz Date: Tue, 12 Aug 2008 18:59:25 +0000 (+0000) Subject: Assure that the "Close Tab" action gets disabled when only one tab is open. X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/b354c7503dc4078f417371ffd32606cd4c635792?ds=inline Assure that the "Close Tab" action gets disabled when only one tab is open. BUG: 168904 svn path=/trunk/KDE/kdebase/apps/; revision=845995 --- 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);