]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Assure that the "Close Tab" action gets disabled when only one tab is open.
authorPeter Penz <peter.penz19@gmail.com>
Tue, 12 Aug 2008 18:59:25 +0000 (18:59 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 12 Aug 2008 18:59:25 +0000 (18:59 +0000)
BUG: 168904

svn path=/trunk/KDE/kdebase/apps/; revision=845995

src/dolphinmainwindow.cpp

index 76330d1d4c8146fee242f58332f1027ebe21a77b..fdf3947229db9047a20b0f329696f9b93804802b 100644 (file)
@@ -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);