From c0d475db3bde0b12bf0f3729b09028635f1e08aa Mon Sep 17 00:00:00 2001 From: heliguy Date: Sun, 31 Mar 2024 01:00:41 -0400 Subject: [PATCH] Remove list refreshed toast --- src/downgrade_window.py | 2 +- src/main.py | 2 +- src/orphans_window.py | 2 +- src/search_install_window.py | 2 +- src/window.py | 12 +++++------- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/downgrade_window.py b/src/downgrade_window.py index 370dcf1..3301c0a 100644 --- a/src/downgrade_window.py +++ b/src/downgrade_window.py @@ -119,7 +119,7 @@ class DowngradeWindow(Adw.Dialog): ) ) - self.parent_window.refresh_list_of_flatpaks(self, False) + self.parent_window.refresh_list_of_flatpaks(self) self.close() def downgrade_thread(self): diff --git a/src/main.py b/src/main.py index b37eaba..1b3553e 100644 --- a/src/main.py +++ b/src/main.py @@ -123,7 +123,7 @@ class WarehouseApplication(Adw.Application): OrphansWindow(self.props.active_window) def refresh_list_shortcut(self, widget, _): - self.props.active_window.refresh_list_of_flatpaks(widget, True) + self.props.active_window.refresh_list_of_flatpaks(widget) def show_remotes_shortcut(self, widget, _): RemotesWindow(self.props.active_window) diff --git a/src/orphans_window.py b/src/orphans_window.py index 1de76e8..89c407b 100644 --- a/src/orphans_window.py +++ b/src/orphans_window.py @@ -73,7 +73,7 @@ class OrphansWindow(Adw.Dialog): self.is_installing = False self.generate_list() self.progress_bar.set_visible(False) - self.app_window.refresh_list_of_flatpaks(self, False) + self.app_window.refresh_list_of_flatpaks(self) self.set_can_close(True) # Make window able to close self.search_button.set_sensitive(True) if self.my_utils.install_success: diff --git a/src/search_install_window.py b/src/search_install_window.py index 400a700..b9d072f 100644 --- a/src/search_install_window.py +++ b/src/search_install_window.py @@ -207,7 +207,7 @@ class SearchInstallWindow(Adw.Dialog): ) def done(*args): - self.main_window.refresh_list_of_flatpaks(None, False) + self.main_window.refresh_list_of_flatpaks(None) # Make window able to close self.set_can_close(True) if self.my_utils.install_success: diff --git a/src/window.py b/src/window.py index 087261e..8b20341 100644 --- a/src/window.py +++ b/src/window.py @@ -99,7 +99,7 @@ class WarehouseWindow(Adw.ApplicationWindow): def uninstall_flatpak_callback(self, _a, _b): self.currently_uninstalling = False - self.refresh_list_of_flatpaks(_a, False) + self.refresh_list_of_flatpaks(_a) self.main_toolbar_view.set_sensitive(True) self.disconnect(self.no_close) self.uninstall_buttons_enable(True) @@ -107,7 +107,7 @@ class WarehouseWindow(Adw.ApplicationWindow): self.search_button.set_sensitive(True) self.batch_actions_enable(False) if self.my_utils.uninstall_success: - self.refresh_list_of_flatpaks(self, False) + self.refresh_list_of_flatpaks(self) self.toast_overlay.add_toast(Adw.Toast.new(_("Uninstalled successfully"))) else: self.toast_overlay.add_toast( @@ -353,7 +353,7 @@ class WarehouseWindow(Adw.ApplicationWindow): self.flatpaks_list_box.get_row_at_index(index).grab_focus() break - def refresh_list_of_flatpaks(self, widget, should_toast): + def refresh_list_of_flatpaks(self, widget): if self.currently_uninstalling: return @@ -363,12 +363,10 @@ class WarehouseWindow(Adw.ApplicationWindow): self.generate_list_of_flatpaks() self.batch_mode_button.set_active(False) self.total_selected = 0 - if should_toast: - self.toast_overlay.add_toast(Adw.Toast.new(_("List refreshed"))) def runner(*args): import time - time.sleep(0.1) + time.sleep(0.2) self.main_stack.set_visible_child(self.refreshing) task = Gio.Task.new(None, None, callback) @@ -808,7 +806,7 @@ class WarehouseWindow(Adw.ApplicationWindow): self.main_stack.set_visible_child(self.main_box) self.search_button.set_sensitive(True) if self.my_utils.install_success: - self.refresh_list_of_flatpaks(self, False) + self.refresh_list_of_flatpaks(self) self.toast_overlay.add_toast(Adw.Toast.new(_("Installed successfully"))) else: self.toast_overlay.add_toast(Adw.Toast.new(_("Could not install app")))