From 6470ed548478c0fd2b75f17757a960c80616fd3f Mon Sep 17 00:00:00 2001 From: auouymous Date: Tue, 3 Jan 2023 15:33:03 -0700 Subject: [PATCH] Add a progress dialog when cancelling tasks. --- src/gpodder/gtkui/main.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gpodder/gtkui/main.py b/src/gpodder/gtkui/main.py index c0b07763..6b785972 100644 --- a/src/gpodder/gtkui/main.py +++ b/src/gpodder/gtkui/main.py @@ -3336,14 +3336,30 @@ class gPodder(BuilderWidget, dbus.service.Object): if not tasks: return + progress_indicator = ProgressIndicator( + download.DownloadTask.STATUS_MESSAGE[download.DownloadTask.CANCELLING], + '', True, self.get_dialog_parent(), len(tasks)) + + restart_timer = self.stop_download_list_update_timer() + self.download_queue_manager.disable() for task in tasks: task.cancel() + if not progress_indicator.on_tick(): + break + progress_indicator.on_tick(final=_('Finishing...')) + self.download_queue_manager.enable() + self.update_episode_list_icons([task.url for task in tasks]) self.play_or_download() # Update the tab title and downloads list - self.update_downloads_list() + if restart_timer: + self.set_download_list_state(gPodderSyncUI.DL_ONEOFF) + else: + self.update_downloads_list() + + progress_indicator.on_finished() def new_episodes_show(self, episodes, notification=False, selected=None): columns = (