┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Atilio <[email protected]>2014-04-26 12:28:42 +0200
committerEmmanuel Pescosta <[email protected]>2014-04-26 12:28:42 +0200
commitafa1a8ef1179e8f8d99bf241389fcc2366290326 (patch)
treef6f58048faf8f91eaa005e341963c0449237f8ee
parent272cbbd16b03e51b30b6b9d472aa56054a5ea036 (diff)
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
-rw-r--r--src/dolphinmainwindow.cpp6
1 files changed, 6 insertions, 0 deletions
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);