diff --git a/data/ui/remotes.blp b/data/ui/remotes.blp index a9afc1b..ad2b82d 100644 --- a/data/ui/remotes.blp +++ b/data/ui/remotes.blp @@ -2,6 +2,7 @@ using Gtk 4.0; using Adw 1; template $RemotesWindow: Adw.Window { + title: _("Manage Remotes"); default-width: 500; default-height: 450; diff --git a/po/POTFILES b/po/POTFILES index 9175433..2309cb3 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -9,8 +9,6 @@ src/gtk/help-overlay.blp src/properties_window.py src/remotes_window.py data/ui/remotes.blp -src/popular_remotes_window.py -data/ui/popular_remotes.blp src/orphans_window.py data/ui/orphans.blp src/filter_window.py diff --git a/po/warehouse.pot b/po/warehouse.pot index 3205695..48db480 100644 --- a/po/warehouse.pot +++ b/po/warehouse.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: io.github.flattool.heliguy.Warehouse\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-08 09:01-0500\n" +"POT-Creation-Date: 2023-12-11 21:53-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -119,8 +119,8 @@ msgid "Send these apps' settings and content to the trash" msgstr "" #: src/window.py:202 src/window.py:260 src/window.py:336 src/window.py:366 -#: src/window.py:445 src/window.py:616 src/properties_window.py:127 -#: src/remotes_window.py:62 src/remotes_window.py:135 src/remotes_window.py:279 +#: src/window.py:445 src/window.py:618 src/properties_window.py:127 +#: src/remotes_window.py:68 src/remotes_window.py:212 src/remotes_window.py:354 #: src/orphans_window.py:105 src/orphans_window.py:159 data/ui/filter.blp:17 #: data/ui/downgrade.blp:16 msgid "Cancel" @@ -237,39 +237,39 @@ msgstr "" msgid "Copied selected app refs" msgstr "" -#: src/window.py:590 src/orphans_window.py:73 +#: src/window.py:592 src/orphans_window.py:73 msgid "Installed successfully" msgstr "" -#: src/window.py:592 +#: src/window.py:594 msgid "Could not install app" msgstr "" -#: src/window.py:614 +#: src/window.py:616 msgid "Install {}?" msgstr "" -#: src/window.py:617 src/orphans_window.py:106 data/ui/orphans.blp:129 +#: src/window.py:619 src/orphans_window.py:106 data/ui/orphans.blp:129 msgid "Install" msgstr "" -#: src/window.py:624 src/remotes_window.py:206 src/remotes_window.py:290 +#: src/window.py:626 src/remotes_window.py:283 src/remotes_window.py:365 msgid "User" msgstr "" -#: src/window.py:624 +#: src/window.py:626 msgid "The app will be available to only you" msgstr "" -#: src/window.py:625 src/remotes_window.py:212 src/remotes_window.py:291 +#: src/window.py:627 src/remotes_window.py:289 src/remotes_window.py:366 msgid "System" msgstr "" -#: src/window.py:625 +#: src/window.py:627 msgid "The app will be available to every user on the system" msgstr "" -#: src/window.py:654 +#: src/window.py:656 msgid "File type not supported" msgstr "" @@ -297,7 +297,7 @@ msgstr "" msgid "Loading Flatpaks…" msgstr "" -#: data/ui/window.blp:60 data/ui/remotes.blp:77 +#: data/ui/window.blp:60 data/ui/remotes.blp:87 msgid "This should only take a moment." msgstr "" @@ -371,10 +371,6 @@ msgstr "" msgid "Manage Remotes…" msgstr "" -#: data/ui/window.blp:226 -msgid "Install From The Web…" -msgstr "" - #: data/ui/window.blp:231 msgid "_Keyboard Shortcuts" msgstr "" @@ -411,7 +407,7 @@ msgstr "" msgid "Set Filters" msgstr "" -#: src/gtk/help-overlay.blp:24 data/ui/remotes.blp:28 +#: src/gtk/help-overlay.blp:24 msgid "Refresh" msgstr "" @@ -423,7 +419,7 @@ msgstr "" msgid "Manage Leftover Data" msgstr "" -#: src/gtk/help-overlay.blp:42 data/ui/remotes.blp:5 +#: src/gtk/help-overlay.blp:42 msgid "Manage Remotes" msgstr "" @@ -447,7 +443,7 @@ msgstr "" msgid "Quit" msgstr "" -#: src/properties_window.py:36 src/remotes_window.py:74 +#: src/properties_window.py:36 src/remotes_window.py:96 msgid "Copied {}" msgstr "" @@ -463,8 +459,8 @@ msgstr "" msgid "No User Data" msgstr "" -#: src/properties_window.py:84 src/remotes_window.py:191 -#: src/remotes_window.py:288 +#: src/properties_window.py:84 src/remotes_window.py:268 +#: src/remotes_window.py:363 msgid "Name" msgstr "" @@ -535,134 +531,137 @@ msgstr "" msgid "{} Properties" msgstr "" -#: src/remotes_window.py:51 +#: src/remotes_window.py:57 msgid "Could not remove {}" msgstr "" -#: src/remotes_window.py:59 +#: src/remotes_window.py:65 msgid "Any installed apps from {} will stop receiving updates" msgstr "" -#: src/remotes_window.py:60 +#: src/remotes_window.py:66 msgid "Remove {}?" msgstr "" -#: src/remotes_window.py:63 +#: src/remotes_window.py:69 msgid "Remove" msgstr "" -#: src/remotes_window.py:95 +#: src/remotes_window.py:119 +msgid "Disabled" +msgstr "" + +#: src/remotes_window.py:121 src/orphans_window.py:120 +msgid "{} wide" +msgstr "" + +#: src/remotes_window.py:125 +msgid "View apps from this remote" +msgstr "" + +#: src/remotes_window.py:128 msgid "Copy remote name" msgstr "" -#: src/remotes_window.py:98 +#: src/remotes_window.py:131 msgid "Remove {}" msgstr "" -#: src/remotes_window.py:113 src/remotes_window.py:237 -msgid "Could not add {}" -msgstr "" - -#: src/remotes_window.py:133 -msgid "Add Flatpak Remote" -msgstr "" - -#: src/remotes_window.py:136 src/remotes_window.py:280 -msgid "Add" -msgstr "" - -#: src/remotes_window.py:195 -msgid "URL" -msgstr "" - -#: src/remotes_window.py:206 src/remotes_window.py:290 -msgid "Remote will be available to only you" -msgstr "" - -#: src/remotes_window.py:212 src/remotes_window.py:291 -msgid "Remote will be available to every user on the system" -msgstr "" - -#: src/remotes_window.py:235 -msgid "{} successfully added" -msgstr "" - -#: src/remotes_window.py:277 -msgid "Add {}?" -msgstr "" - #. [Name to show in GUI, Name of remote for system, Link to repo to add, Description of remote] -#: src/remotes_window.py:316 +#: src/remotes_window.py:150 msgid "The open source, pay-what-you-want app store from elementary" msgstr "" -#: src/remotes_window.py:317 +#: src/remotes_window.py:151 msgid "Central repository of Flatpak applications" msgstr "" -#: src/remotes_window.py:318 +#: src/remotes_window.py:152 msgid "Beta builds of Flatpak applications" msgstr "" -#: src/remotes_window.py:319 +#: src/remotes_window.py:153 msgid "Flatpaks packaged by Fedora Linux" msgstr "" -#: src/remotes_window.py:320 +#: src/remotes_window.py:154 msgid "The latest beta GNOME Apps and Runtimes" msgstr "" -#: src/remotes_window.py:321 +#: src/remotes_window.py:155 msgid "Beta KDE Apps and Runtimes" msgstr "" -#: src/remotes_window.py:322 +#: src/remotes_window.py:156 msgid "Central repository of the WebKit Developer and Runtime SDK" msgstr "" -#: data/ui/remotes.blp:14 data/ui/popular_remotes.blp:18 -msgid "Add Remote" +#: src/remotes_window.py:188 src/remotes_window.py:314 +msgid "Could not add {}" msgstr "" -#: data/ui/remotes.blp:25 -msgid "Installed Remotes" +#: src/remotes_window.py:210 +msgid "Add Flatpak Remote" msgstr "" -#: data/ui/remotes.blp:35 -msgid "Add a Popular Remote" +#: src/remotes_window.py:213 src/remotes_window.py:355 +msgid "Add" msgstr "" -#: data/ui/remotes.blp:38 -msgid "Add Other Remotes" +#: src/remotes_window.py:272 +msgid "URL" msgstr "" -#: data/ui/remotes.blp:40 data/ui/popular_remotes.blp:45 -msgid "Add a Repo File" +#: src/remotes_window.py:283 src/remotes_window.py:365 +msgid "Remote will be available to only you" msgstr "" -#: data/ui/remotes.blp:45 data/ui/popular_remotes.blp:50 -msgid "Add a Custom Remote" +#: src/remotes_window.py:289 src/remotes_window.py:366 +msgid "Remote will be available to every user on the system" msgstr "" -#: data/ui/remotes.blp:68 -msgid "Adding Remote…" +#: src/remotes_window.py:312 +msgid "{} successfully added" msgstr "" -#: data/ui/remotes.blp:84 -msgid "No Remotes" +#: src/remotes_window.py:352 +msgid "Add {}?" msgstr "" -#: data/ui/remotes.blp:85 -msgid "" -"Warehouse cannot see the list of remotes or the system has no remotes added" -msgstr "" - -#: src/popular_remotes_window.py:31 +#: src/remotes_window.py:395 msgid "Flatpak Repos" msgstr "" -#: data/ui/popular_remotes.blp:19 -msgid "Choose from a list of popular remotes or add a new one." +#: data/ui/remotes.blp:22 +msgid "Installed Remotes" +msgstr "" + +#: data/ui/remotes.blp:26 +msgid "Show disabled" +msgstr "" + +#: data/ui/remotes.blp:40 +msgid "No remotes on the system, add some from below" +msgstr "" + +#: data/ui/remotes.blp:44 +msgid "Add a Popular Remote" +msgstr "" + +#: data/ui/remotes.blp:48 +msgid "Add Other Remotes" +msgstr "" + +#: data/ui/remotes.blp:50 +msgid "Add a Repo File" +msgstr "" + +#: data/ui/remotes.blp:55 +msgid "Add a Custom Remote" +msgstr "" + +#: data/ui/remotes.blp:78 +msgid "Adding Remote…" msgstr "" #: src/orphans_window.py:75 @@ -678,10 +677,6 @@ msgstr "" msgid "Warehouse will attempt to install apps matching the selected data." msgstr "" -#: src/orphans_window.py:120 -msgid "{} wide" -msgstr "" - #: src/orphans_window.py:156 msgid "Trash folders?" msgstr "" diff --git a/src/common.py b/src/common.py index 9df38f2..ea41f39 100644 --- a/src/common.py +++ b/src/common.py @@ -113,17 +113,6 @@ class myUtils: for line in lines[1:]: row = line.split("\t") data.append(row) - try: - for i in range(len(data)): - data[i][7] = data[i][7].split(",") - if "disabled" in data[i][7]: - data[i][7] = "disabled" - if "user" in data[i][7]: - data[i][7] = "user" - if "system" in data[i][7]: - data[i][7] = "system" - except: - print("error getting remote installation types") return data def getHostFlatpaks(self): @@ -293,4 +282,11 @@ class myUtils: except subprocess.CalledProcessError as e: self.run_app_error_message = str(e) self.run_app_error = True - \ No newline at end of file + + def getInstallType(self, type_arr): + if "disabled" in type_arr: + return "disabled" + if "user" in type_arr: + return "user" + if "system" in type_arr: + return "system" \ No newline at end of file diff --git a/src/filter_window.py b/src/filter_window.py index 1a4dfdb..ecfb677 100644 --- a/src/filter_window.py +++ b/src/filter_window.py @@ -57,6 +57,7 @@ class FilterWindow(Adw.Window): self.remote_checkboxes[i].set_active(not is_enabled) def remoteCheckHandler(self, checkbox, install_type, remote): + install_type = self.my_utils.getInstallType(install_type) if checkbox.get_active(): self.filter_list[2].append(install_type) self.filter_list[3].append(remote) @@ -97,20 +98,31 @@ class FilterWindow(Adw.Window): self.runtimes_expander.set_visible(False) self.remote_checkboxes = [] + total = 0 for i in range(len(self.host_remotes)): try: name = self.host_remotes[i][0] title = self.host_remotes[i][1] - install_type = self.host_remotes[i][7] url = self.host_remotes[i][2] - remote_row = Adw.ActionRow(title=title, subtitle=url) + install_type = self.host_remotes[i][7] + remote_row = Adw.ActionRow(title=title) + if "disabled" in install_type: + continue + total += 1 if title == "-": remote_row.set_title(name) self.remotes_expander.add_row(remote_row) label = Gtk.Label(label=("{} wide").format(install_type)) label.add_css_class("subtitle") remote_check = Gtk.CheckButton() - remote_row.add_suffix(label) + + if "user" in install_type: + remote_row.set_subtitle(_("User wide")) + elif "system" in install_type: + remote_row.set_subtitle(_("System wide")) + else: + remote_row.set_subtitle(_("Unknown install type")) + remote_row.add_suffix(remote_check) remote_row.set_activatable_widget(remote_check) remote_check.connect("toggled", self.remoteCheckHandler, install_type, name) @@ -118,6 +130,8 @@ class FilterWindow(Adw.Window): remote_check.set_active(True) except: print("Could not make remote row") + if total < 2: + self.remotes_expander.set_visible(False) self.remotes_expander_switch.connect("state-set", self.remotesEnableHandler) self.remotes_expander.add_suffix(self.remotes_expander_switch) diff --git a/src/orphans_window.py b/src/orphans_window.py index f363b7b..70a140c 100644 --- a/src/orphans_window.py +++ b/src/orphans_window.py @@ -83,14 +83,12 @@ class OrphansWindow(Adw.Window): task.run_in_thread(lambda _task, _obj, _data, _cancellable, id_list=self.selected_dirs, remote=self.selected_remote, app_type=self.selected_remote_type, progress_bar=self.progress_bar: self.my_utils.installFlatpak(id_list, remote, app_type, progress_bar)) def installButtonHandler(self, button): - remote_select_buttons = [] - def remote_select_handler(button): + def remote_select_handler(button, index): if not button.get_active(): return - remote_index = remote_select_buttons.index(button) - self.selected_remote = self.host_remotes[remote_index][0] - self.selected_remote_type = self.host_remotes[remote_index][7] + self.selected_remote = self.host_remotes[index][0] + self.selected_remote_type = self.my_utils.getInstallType(self.host_remotes[index][7]) def onResponse(dialog, response_id, _function): if response_id == "cancel": @@ -115,28 +113,41 @@ class OrphansWindow(Adw.Window): remotes_scroll.set_child(remote_list) remote_list.add_css_class("boxed-list") + total_added = 0 + remote_select_buttons = [] for i in range(len(self.host_remotes)): - remote_row = Adw.ActionRow(title=self.host_remotes[i][1]) - label = Gtk.Label(label=_("{} wide").format(self.host_remotes[i][7]), valign=Gtk.Align.CENTER) + title = self.host_remotes[i][1] + name = self.host_remotes[i][0] + type_arr = self.host_remotes[i][7] + if "disabled" in type_arr: + continue + remote_row = Adw.ActionRow(title=title) remote_select = Gtk.CheckButton() - label.add_css_class("subtitle") remote_select_buttons.append(remote_select) - remote_select.connect("toggled", remote_select_handler) + remote_select.connect("toggled", remote_select_handler, i) remote_row.set_activatable_widget(remote_select) + type = self.my_utils.getInstallType(type_arr) + if type == "user": + remote_row.set_subtitle(_("User wide")) + elif type == "system": + remote_row.set_subtitle(_("System wide")) + else: + remote_row.set_subtitle(_("Unknown install type")) + if remote_row.get_title() == '-': remote_row.set_title(self.host_remotes[i][0]) - if i > 0: - remote_select.set_group(remote_select_buttons[i-1]) + if total_added > 0: + remote_select.set_group(remote_select_buttons[0]) remote_row.add_prefix(remote_select) - remote_row.add_suffix(label) remote_list.append(remote_row) + total_added += 1 remote_select_buttons[0].set_active(True) - if len(self.host_remotes) > 1: + if total_added > 1: dialog.set_extra_child(remotes_scroll) dialog.connect("response", onResponse, dialog.choose_finish) diff --git a/src/remotes_window.py b/src/remotes_window.py index 0f3e68b..09f2408 100644 --- a/src/remotes_window.py +++ b/src/remotes_window.py @@ -57,13 +57,14 @@ class RemotesWindow(Adw.Window): self.make_toast(_("Could not remove {}").format(title)) self.generate_list() - def remove_handler(self, _widget, index): + def remove_handler(self, _widget, index, popoever): + popoever.popdown() name = self.host_remotes[index][0] title = self.host_remotes[index][1] install_type = self.host_remotes[index][7] body_text = _("Any installed apps from {} will stop receiving updates").format(name) - dialog = Adw.MessageDialog.new(self, _("Remove {}?").format(name), body_text) + dialog = Adw.MessageDialog.new(self, _("Remove {}?").format(title), body_text) dialog.set_close_response("cancel") dialog.add_response("cancel", _("Cancel")) dialog.add_response("continue", _("Remove")) @@ -71,10 +72,69 @@ class RemotesWindow(Adw.Window): dialog.connect("response", self.remove_on_response, dialog.choose_finish, index) dialog.present() - def view_apps(self, type, id): + def enable_handler(self, button, index): + name = self.host_remotes[index][0] + typeArr = self.host_remotes[index][7] + type = "" + if "system" in typeArr: + type = "system" + else: + type = "user" + + try: + command = ['flatpak-spawn', '--host', 'flatpak', 'remote-modify', name, f"--{type}", "--enable"] + subprocess.run(command, capture_output=False, check=True, env=self.new_env) + except subprocess.CalledProcessError as e: + self.toast_overlay.add_toast(Adw.Toast.new(_("Could not enable {}").format(name))) + print(f"error in remotes_window.enable_handler: could not enable remote {name}:", e) + + self.generate_list() + + def disable_handler(self, button, index, popoever): + def disable_response(_a, response, _b): + if response == "cancel": + return + try: + command = ['flatpak-spawn', '--host', 'flatpak', 'remote-modify', name, f"--{type}", "--disable"] + subprocess.run(command, capture_output=False, check=True, env=self.new_env) + except subprocess.CalledProcessError as e: + self.toast_overlay.add_toast(Adw.Toast.new(_("Could not disable {}").format(name))) + print(f"error in remotes_window.enable_handler: could not disable remote {name}:", e) + + self.generate_list() + + name = self.host_remotes[index][0] + title = self.host_remotes[index][1] + typeArr = self.host_remotes[index][7] + type = "" + if "system" in typeArr: + type = "system" + else: + type = "user" + + popoever.popdown() + + body_text = _("Any installed apps from {} will stop receiving updates").format(name) + dialog = Adw.MessageDialog.new(self, _("Disable {}?").format(title), body_text) + dialog.set_close_response("cancel") + dialog.add_response("cancel", _("Cancel")) + dialog.add_response("continue", _("Disable")) + dialog.set_response_appearance("continue", Adw.ResponseAppearance.DESTRUCTIVE) + dialog.connect("response", disable_response, dialog.choose_finish) + dialog.present() + + def view_paks(self, type, id): + if "user" in type: + type = "user" + elif "system" in type: + type = "system" + else: + self.make_toast(_("Could not view apps").format(to_copy)) + print("error in remotes_window.view_apps(): remote installation type is not either system or user. type is:", type) + return self.app_window.should_open_filter_window = False self.app_window.filter_button.set_active(True) - self.app_window.applyFilter([True, False, [type], [id], ["all"]]) + self.app_window.applyFilter([True, True, [type], [id], ["all"]]) self.app_window.should_open_filter_window = True self.close() @@ -102,38 +162,68 @@ class RemotesWindow(Adw.Window): name = self.host_remotes[i][0] title = self.host_remotes[i][1] install_type = self.host_remotes[i][7] - remote_row = Adw.ActionRow(title=title, subtitle=name) + remote_row = Adw.ActionRow(title=title) + + more = Gtk.MenuButton(icon_name="view-more-symbolic", valign=Gtk.Align.CENTER) + more.add_css_class("flat") + options = Gtk.Popover() + options_box = Gtk.Box(halign=Gtk.Align.CENTER, valign=Gtk.Align.CENTER, orientation=Gtk.Orientation.VERTICAL) + filter_button = Gtk.Button() + filter_button.set_child(Adw.ButtonContent(icon_name="funnel-symbolic", label=_("Set Filter"))) + filter_button.add_css_class("flat") + filter_button.connect("clicked", lambda *_, i=i: self.view_paks(self.host_remotes[i][7], self.host_remotes[i][0])) + + enable_button = Gtk.Button(visible=False) + enable_button.set_child(Adw.ButtonContent(icon_name="eye-open-negative-filled-symbolic", label=_("Enable"))) + enable_button.add_css_class("flat") + enable_button.connect("clicked", self.enable_handler, i) + + disable_button = Gtk.Button() + disable_button.set_child(Adw.ButtonContent(icon_name="eye-not-looking-symbolic", label=_("Disable"))) + disable_button.add_css_class("flat") + disable_button.connect("clicked", self.disable_handler, i, options) + + remove_button = Gtk.Button() + remove_button.set_child(Adw.ButtonContent(icon_name="user-trash-symbolic", label=_("Remove"))) + remove_button.add_css_class("flat") + remove_button.connect("clicked", self.remove_handler, i, options) + + options_box.append(filter_button) + options_box.append(enable_button) + options_box.append(disable_button) + options_box.append(remove_button) + options.set_child(options_box) + more.set_popover(options) + + copy_button = Gtk.Button(icon_name="edit-copy-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("Copy remote name")) + copy_button.add_css_class("flat") + copy_button.connect("clicked", rowCopyHandler, name) + + remote_row.add_suffix(copy_button) + remote_row.add_suffix(more) + + install_type = self.my_utils.getInstallType(install_type) if install_type == "disabled": if not self.show_disabled_button.get_active(): continue + remote_row.set_subtitle(_("Disabled")) + enable_button.set_visible(True) + disable_button.set_visible(False) remote_row.add_css_class("warning") + elif install_type == "user": + remote_row.set_subtitle(_("User wide")) + elif install_type == "system": + remote_row.set_subtitle(_("System wide")) + else: + remote_row.set_subtitle(_("Unknown install type")) url = self.host_remotes[i][2] if title == "-": remote_row.set_title(name) self.remotes_list.add(remote_row) - label = Gtk.Label(valign=Gtk.Align.CENTER) - if install_type == "disabled": - remote_row.set_subtitle(_("Disabled")) - else: - remote_row.set_subtitle(_("{} wide").format(install_type)) - label.add_css_class("subtitle") # subprocess.run(['wget', f'{self.host_remotes[i][11]}']) Idea to display remote icons... Need internet connection. Not sure if that is worth it - remote_row.add_suffix(label) - filter_button = Gtk.Button(icon_name="funnel-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("View apps from this remote")) - filter_button.add_css_class("flat") - filter_button.connect("clicked", lambda *_, i=i: self.view_apps(self.host_remotes[i][7], self.host_remotes[i][0])) - copy_button = Gtk.Button(icon_name="edit-copy-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("Copy remote name")) - copy_button.add_css_class("flat") - copy_button.connect("clicked", rowCopyHandler, name) - remove_button = Gtk.Button(icon_name="user-trash-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("Remove {}").format(name)) - remove_button.add_css_class("flat") - remove_button.connect("clicked", self.remove_handler, i) - remote_row.add_suffix(filter_button) - remote_row.add_suffix(copy_button) - remote_row.add_suffix(remove_button) self.rows_in_list.append(remote_row) self.no_remotes.set_visible(False) except Exception as e: diff --git a/src/snapshots_window.py b/src/snapshots_window.py index b52abab..9253512 100644 --- a/src/snapshots_window.py +++ b/src/snapshots_window.py @@ -169,6 +169,7 @@ class SnapshotsWindow(Adw.Window): self.toast_overlay.add_toast(Adw.Toast.new(_("Could not apply snapshot"))) else: self.toast_overlay.add_toast(Adw.Toast.new(_("Snapshot applied"))) + self.parent_window.refresh_list_of_flatpaks(self, False) self.new_snapshot.set_tooltip_text("") self.showListOrEmpty() @@ -226,6 +227,7 @@ class SnapshotsWindow(Adw.Window): self.app_ref = flatpak_row[8] self.snapshots_of_app_path = self.snapshots_path + self.app_id + "/" self.app_user_data = self.user_data_path + self.app_id + "/" + self.parent_window = parent_window if self.app_version == "" or self.app_version == "-" or self.app_version == None: self.app_version = 0.0 diff --git a/src/window.py b/src/window.py index 7ee23de..256d866 100644 --- a/src/window.py +++ b/src/window.py @@ -420,6 +420,8 @@ class WarehouseWindow(Adw.ApplicationWindow): self.batch_uninstall_button.set_sensitive(should_enable) def onBatchCleanResponse(self, dialog, response, _a): + if response == "cancel": + return i = 0 trashReturnCodes = 0 while(True): @@ -538,7 +540,12 @@ class WarehouseWindow(Adw.ApplicationWindow): self.filter_button.set_active(not self.filter_button.get_active()) def applyFilter(self, filter=default_filter): - self.filter_list = filter + for i in range(len(self.filter_list)): + current = self.filter_list[i] + if "user" == current: + self.filter_list[i] = "user" + else: + self.filter_list[i] = "system" show_apps = filter[0] show_runtimes = filter[1] filter_install_type = filter[2]