[gnome-tweaks] Don't show Desktop group unless it will actually work



commit f70bb9b49ae38fd176c0c4f508cdbf6829263736
Author: Simon McVittie <smcv debian org>
Date:   Wed Mar 7 13:09:29 2018 +0000

    Don't show Desktop group unless it will actually work
    
    In builds with commit 53a8edb7 reverted to support Nautilus 3.26, we
    should hide the non-functional Desktop group if Nautilus 3.27 is
    installed.

 gtweak/tweaks/tweak_group_desktop.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_desktop.py b/gtweak/tweaks/tweak_group_desktop.py
index 63be532..f55c696 100644
--- a/gtweak/tweaks/tweak_group_desktop.py
+++ b/gtweak/tweaks/tweak_group_desktop.py
@@ -6,13 +6,22 @@ from gtweak.widgets import ListBoxTweakGroup, GSettingsSwitchTweak, Title
 
 dicons = GSettingsSwitchTweak(_("Show Icons"),"org.gnome.desktop.background","show-desktop-icons")
 
-TWEAK_GROUPS = [
-    ListBoxTweakGroup(_("Desktop"),
+# show-desktop-icons is in gsettings-desktop-schemas, but it won't actually
+# *work* unless we have a version of Nautilus that still has the ability to
+# draw the desktop; use one of the settings that was present in that version
+# to probe for it.
+home = GSettingsSwitchTweak(_("Home"),"org.gnome.nautilus.desktop",
+                            "home-icon-visible", depends_on=dicons,
+                            schema_filename="org.gnome.nautilus.gschema.xml")
+
+TWEAK_GROUPS = []
+
+if home.loaded:
+    TWEAK_GROUPS.append(ListBoxTweakGroup(_("Desktop"),
         Title(_("Icons on Desktop"), "", uid="title-theme", top=True),
         dicons,
-        GSettingsSwitchTweak(_("Home"),"org.gnome.nautilus.desktop", "home-icon-visible", depends_on=dicons, 
schema_filename="org.gnome.nautilus.gschema.xml"),
+        home,
         GSettingsSwitchTweak(_("Network Servers"),"org.gnome.nautilus.desktop", "network-icon-visible", 
depends_on=dicons, schema_filename="org.gnome.nautilus.gschema.xml"),
         GSettingsSwitchTweak(_("Trash"),"org.gnome.nautilus.desktop", "trash-icon-visible", 
depends_on=dicons, schema_filename="org.gnome.nautilus.gschema.xml"),
         GSettingsSwitchTweak(_("Mounted Volumes"),"org.gnome.nautilus.desktop", "volumes-visible", 
depends_on=dicons, schema_filename="org.gnome.nautilus.gschema.xml"),
-    )
-]
+    ))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]