From: Renato Atilio Date: Sat, 26 Apr 2014 10:28:42 +0000 (+0200) Subject: Enable the previous and next tab toolbar buttons X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/afa1a8ef1179e8f8d99bf241389fcc2366290326 Enable the previous and next tab toolbar buttons when multiple tabs are opened. Disable them again when there is only one remaining tab. Additionally set the default state to disabled. BUG: 332628 FIXED-IN: 4.13.1 REVIEW: 117778 --- diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 847301434..28169cfb5 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -481,6 +481,8 @@ void DolphinMainWindow::openNewTab(const KUrl& url) m_viewTab.append(viewTab); actionCollection()->action("close_tab")->setEnabled(true); + actionCollection()->action("activate_prev_tab")->setEnabled(true); + actionCollection()->action("activate_next_tab")->setEnabled(true); // Provide a split view, if the startup settings are set this way if (GeneralSettings::splitView()) { @@ -1155,6 +1157,8 @@ void DolphinMainWindow::closeTab(int index) if (m_viewTab.count() == 1) { m_tabBar->removeTab(0); actionCollection()->action("close_tab")->setEnabled(false); + actionCollection()->action("activate_prev_tab")->setEnabled(false); + actionCollection()->action("activate_next_tab")->setEnabled(false); } else { m_tabBar->blockSignals(false); } @@ -1634,11 +1638,13 @@ void DolphinMainWindow::setupActions() KAction* activateNextTab = actionCollection()->addAction("activate_next_tab"); activateNextTab->setText(i18nc("@action:inmenu", "Activate Next Tab")); + activateNextTab->setEnabled(false); connect(activateNextTab, SIGNAL(triggered()), SLOT(activateNextTab())); activateNextTab->setShortcuts(QApplication::isRightToLeft() ? prevTabKeys : nextTabKeys); KAction* activatePrevTab = actionCollection()->addAction("activate_prev_tab"); activatePrevTab->setText(i18nc("@action:inmenu", "Activate Previous Tab")); + activatePrevTab->setEnabled(false); connect(activatePrevTab, SIGNAL(triggered()), SLOT(activatePrevTab())); activatePrevTab->setShortcuts(QApplication::isRightToLeft() ? nextTabKeys : prevTabKeys);