diff --git a/src/install_page/install_page.py b/src/install_page/install_page.py index ab38b28..4e44e25 100644 --- a/src/install_page/install_page.py +++ b/src/install_page/install_page.py @@ -51,7 +51,9 @@ class InstallPage(Adw.BreakpointBin): def install_callback(self): HostInfo.main_window.refresh_handler() - if not self.did_error: + if self.did_error: + return + if not PackageInstallWorker.cancelled: HostInfo.main_window.toast_overlay.add_toast(Adw.Toast(title=_("Installed Packages"))) def install_error_callback(self, user_facing_label, error_message): diff --git a/src/package_install_worker.py b/src/package_install_worker.py index dd1df70..5d86608 100644 --- a/src/package_install_worker.py +++ b/src/package_install_worker.py @@ -34,10 +34,6 @@ class PackageInstallWorker: group_ratio = (package_ratio + complete) / (total or 1) final_ratio = (group_ratio + index) / (this.total_groups or 1) - print(f"gr: {(package_ratio + complete) / (total or 1):.2f}, fr: {((package_ratio + complete) / (total or 1) + index) / (this.total_groups or 1):.2f}") - print("i:", index, ", g:", this.total_groups, ", r:", package_ratio, ", c:", complete, ", t:", total) - print("=======================================") - if not this.loading_status is None: GLib.idle_add(lambda *_: this.loading_status.progress_bar.set_fraction(final_ratio)) @@ -110,7 +106,6 @@ class PackageInstallWorker: @classmethod def on_done(this, *args): this.process = None - this.cancelled = False HostInfo.main_window.remove_refresh_lockout("installing packages") if not this.loading_status is None: this.loading_status.progress_bar.set_fraction(0.0) @@ -118,6 +113,8 @@ class PackageInstallWorker: if not this.callback is None: this.callback() + this.cancelled = False + @classmethod def on_error(this, user_facing_label, error_message): if not this.error_callback is None: