Skip to content

Commit

Permalink
aptkit: Fix UI freeze when the transaction is cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
clefebvre committed Dec 9, 2024
1 parent 9d30b66 commit a4d6cfd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions usr/lib/linuxmint/mintUpdate/mintUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2469,6 +2469,11 @@ def on_apt_install_finished(self, transaction=None, exit_state=None):

self.finish_install(needs_refresh)

def on_apt_install_cancelled(self):
self.logger.write("Install cancelled")
self.set_status("", "", "mintupdate-updates-available-symbolic", True)
self.finish_install(False)

@_async
def finish_install(self, refresh_needed):
try:
Expand Down Expand Up @@ -2572,6 +2577,7 @@ def install(self, widget):
self.logger.write("Ready to launch aptkit")
client = aptkit.simpleclient.SimpleAPTClient(self.ui_window)
client.set_finished_callback(self.on_apt_install_finished)
client.set_cancelled_callback(self.on_apt_install_cancelled)
client.install_packages(self.packages)
else:
self.finish_install(False)
Expand Down

0 comments on commit a4d6cfd

Please sign in to comment.