]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Add "Show statusbar" menu entry in "Settings"
authorKai Uwe Broulik <kde@privat.broulik.de>
Tue, 5 Jul 2022 19:02:56 +0000 (21:02 +0200)
committerKai Uwe Broulik <kde@privat.broulik.de>
Wed, 13 Jul 2022 15:13:25 +0000 (17:13 +0200)
Makes this setting more accessible and makes it consistent with other
KDE applications. Since Dolphin has a separate status bar on each view
container and doesn't use kxmlgui's statusbar, we don't get this menu
entry automatically.

src/dolphinmainwindow.cpp
src/settings/dolphin_generalsettings.kcfg

index 65c99329b652e989ba7181d667754baca07aa123..2a2ac36375b83e61e43fb7d377d3ff1ef9979fc8 100644 (file)
@@ -1802,6 +1802,15 @@ void DolphinMainWindow::setupActions()
             "contain mostly the same commands and configuration options."));
     connect(showMenuBar, &KToggleAction::triggered,                   // Fixes #286822
             this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection);
+
+    KToggleAction* showStatusBar = KStandardAction::showStatusbar(nullptr, nullptr, actionCollection());
+    showStatusBar->setChecked(GeneralSettings::showStatusBar());
+    connect(GeneralSettings::self(), &GeneralSettings::showStatusBarChanged, showStatusBar, &KToggleAction::setChecked);
+    connect(showStatusBar, &KToggleAction::triggered, this, [this](bool checked) {
+        GeneralSettings::setShowStatusBar(checked);
+        refreshViews();
+    });
+
     KStandardAction::keyBindings(this, &DolphinMainWindow::slotKeyBindings, actionCollection());
     KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection());
 
index b2460b11ca892eec5fc6bcc5eab83e116a6eebaa..0267dcb758ba61e8032d7469d7034a1b427cd408 100644 (file)
@@ -10,6 +10,9 @@
     <kcfgfile name="dolphinrc"/>
     <signal name="sortingChoiceChanged" />
     <signal name="splitViewChanged" />
+    <signal name="showStatusBarChanged">
+        <argument type="Bool">showStatusBar</argument>
+    </signal>
     <group name="General">
         <entry name="EditableUrl" type="Bool">
             <label>Should the URL be editable for the user</label>
         <entry name="ShowStatusBar" type="Bool">
             <label>Show the statusbar</label>
             <default>true</default>
+            <emit signal="showStatusBarChanged" />
         </entry>
         <entry name="ShowZoomSlider" type="Bool">
             <label>Show zoom slider in the statusbar</label>