From 7e46e51dee24b423a97b607cac5b4cb8798ab664 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sat, 5 Nov 2016 19:29:18 +0200 Subject: [PATCH] Block downloads when update in progress --- youtube_dl_gui/mainframe.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/youtube_dl_gui/mainframe.py b/youtube_dl_gui/mainframe.py index 19c2d9b..9ee7922 100644 --- a/youtube_dl_gui/mainframe.py +++ b/youtube_dl_gui/mainframe.py @@ -654,10 +654,15 @@ class MainFrame(wx.Frame): self._update_pause_button(None) def _on_start(self, event): - if self.download_manager is None: - self._start_download() + if self.update_thread is not None and self.update_thread.is_alive(): + self._create_popup("Update in progress. Please wait for the update to complete", + self.WARNING_LABEL, + wx.OK | wx.ICON_EXCLAMATION) else: - self.download_manager.stop_downloads() + if self.download_manager is None: + self._start_download() + else: + self.download_manager.stop_downloads() def _on_savepath(self, event): dlg = wx.DirDialog(self, self.CHOOSE_DIRECTORY, self._path_combobox.GetStringSelection(), wx.DD_CHANGE_DIR)