From f79ea0c811930bbc5d75100e2e3214a86a5d9b83 Mon Sep 17 00:00:00 2001 From: mirkobrombin Date: Mon, 26 Dec 2022 13:34:28 +0100 Subject: [PATCH] core: Allow disabling preferences --- debian/vanilla-first-setup.substvars | 2 ++ recipe.json | 3 ++- vanilla_first_setup/layouts/preferences.py | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 debian/vanilla-first-setup.substvars diff --git a/debian/vanilla-first-setup.substvars b/debian/vanilla-first-setup.substvars new file mode 100644 index 0000000..e6b63de --- /dev/null +++ b/debian/vanilla-first-setup.substvars @@ -0,0 +1,2 @@ +misc:Depends=dconf-gsettings-backend | gsettings-backend +misc:Pre-Depends= diff --git a/recipe.json b/recipe.json index 33bac79..ad3b0b3 100644 --- a/recipe.json +++ b/recipe.json @@ -59,7 +59,8 @@ { "id": "snap", "title": "Snap", - "subtitle": "Manage and configure Snaps and the Snapcraft repository." + "subtitle": "Manage and configure Snaps and the Snapcraft repository.", + "disabled": true }, { "id": "appimage", diff --git a/vanilla_first_setup/layouts/preferences.py b/vanilla_first_setup/layouts/preferences.py index dc38a0a..b830cec 100644 --- a/vanilla_first_setup/layouts/preferences.py +++ b/vanilla_first_setup/layouts/preferences.py @@ -58,6 +58,11 @@ class VanillaLayoutPreferences(Adw.Bin): _switcher.set_valign(Gtk.Align.CENTER) _action_row.add_suffix(_switcher) + if item.get("disabled"): + _action_row.set_visible(False) + _action_row.set_sensitive(False) + _switcher.set_sensitive(False) + self.prefs_list.add(_action_row) self.__register_widgets.append((item["id"], _switcher))