Test code

main
kra-mo 2 years ago
parent df68244120
commit 6abf63692d

@ -220,92 +220,97 @@
{ {
"if" : "Calculator", "if" : "Calculator",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Calculator || snap install gnome-calculator" "commands" : ["flatpak --user install org.gnome.Calculator || snap install gnome-calculator"]
}, },
{ {
"if" : "Calendar", "if" : "Calendar",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Calendar" "commands" : ["flatpak --user install org.gnome.Calendar"]
}, },
{ {
"if" : "Characters", "if" : "Characters",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Characters || snap install gnome-characters" "commands" : ["flatpak --user install org.gnome.Characters || snap install gnome-characters"]
}, },
{ {
"if" : "Cheese", "if" : "Cheese",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Cheese || snap install cheese" "commands" : ["flatpak --user install org.gnome.Cheese || snap install cheese"]
}, },
{ {
"if" : "Clocks", "if" : "Clocks",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.clocks || snap install gnome-clocks" "commands" : ["flatpak --user install org.gnome.clocks || snap install gnome-clocks"]
}, },
{ {
"if" : "Contacts", "if" : "Contacts",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Contacts || snap install gnome-contacts" "commands" : ["flatpak --user install org.gnome.Contacts || snap install gnome-contacts"]
}, },
{ {
"if" : "Disk Usage Alanyzer", "if" : "Disk Usage Analyzer",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.baobab" "commands" : ["flatpak --user install org.gnome.baobab"]
}, },
{ {
"if" : "Evince", "if" : "Document Viewer",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Evince || snap install evince" "commands" : ["flatpak --user install org.gnome.Evince || snap install evince"]
}, },
{ {
"if" : "Extensions", "if" : "Extensions",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Extensions" "commands" : ["flatpak --user install org.gnome.Extensions"]
}, },
{ {
"if" : "Fonts", "if" : "Fonts",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Fonts" "commands" : ["flatpak --user install org.gnome.Fonts"]
}, },
{ {
"if" : "Image Viewer", "if" : "Image Viewer",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.eog || snap install eog" "commands" : ["flatpak --user install org.gnome.eog || snap install eog"]
}, },
{ {
"if" : "Logs", "if" : "Logs",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Logs || snap install gnome-logs" "commands" : ["flatpak --user install org.gnome.Logs || snap install gnome-logs"]
}, },
{ {
"if" : "Maps", "if" : "Maps",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Maps" "commands" : ["flatpak --user install org.gnome.Maps"]
}, },
{ {
"if" : "Music", "if" : "Music",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Music" "commands" : ["flatpak --user install org.gnome.Music"]
}, },
{ {
"name" : "Photos", "if" : "Photos",
"icon" : "org.gnome.Photos", "type" : "command",
"flatpak" : "org.gnome.Photos" "commands" : ["flatpak --user install org.gnome.Photos"]
}, },
{ {
"if" : "Text Editor", "if" : "Text Editor",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.TextEditor" "commands" : ["flatpak --user install org.gnome.TextEditor"]
}, },
{ {
"if" : "Videos", "if" : "Videos",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Totem" "commands" : ["flatpak --user install org.gnome.Totem"]
}, },
{ {
"if" : "Weather", "if" : "Weather",
"type" : "command", "type" : "command",
"commands" : "flatpak install org.gnome.Weather || snap install gnome-weather" "commands" : ["flatpak --user install org.gnome.Weather || snap install gnome-weather"]
},
{
"if" : "Bottles",
"type" : "command",
"commands" : ["flatpak --user install com.usebottles.bottles"]
} }
] ]
}, },

@ -48,6 +48,7 @@ class VanillaLayoutApplications(Adw.Bin):
self.status_page.set_title(self.__step["title"]) self.status_page.set_title(self.__step["title"])
self.status_page.set_description(self.__step["description"]) self.status_page.set_description(self.__step["description"])
selection_dialogs = [] selection_dialogs = []
_index = 0
def present_customize(widget, dialog, apps_list, item): def present_customize(widget, dialog, apps_list, item):
for app in item["applications"]: for app in item["applications"]:
@ -146,8 +147,8 @@ class VanillaLayoutApplications(Adw.Bin):
self.bundles_list.add(_action_row) self.bundles_list.add(_action_row)
self.__register_widgets.append((item["id"], _switcher)) self.__register_widgets.append((item["id"], _switcher, _index))
_index += 1
def __next_step(self, widget): def __next_step(self, widget):
self.__window.next() self.__window.next()
@ -155,12 +156,12 @@ class VanillaLayoutApplications(Adw.Bin):
def get_finals(self): def get_finals(self):
finals = {"vars": {}, "funcs": [x for x in self.__step["final"]]} finals = {"vars": {}, "funcs": [x for x in self.__step["final"]]}
for _id, switcher in self.__register_widgets: for _id, switcher, index in self.__register_widgets:
if switcher.get_active() == True: if switcher.get_active() == True:
for app in _id["applications"]: for app in self.__step["bundles"][index]["applications"]:
finals["vars"][app] = app["active"] finals["vars"][app["name"]] = app["active"]
else: else:
for app in _id["applications"]: for app in self.__step["bundles"][index]["applications"]:
finals["vars"][app] = False finals["vars"][app["name"]] = False
return finals return finals
Loading…
Cancel
Save