From b4d6a2857256d96a77d154f9a7d64d5481562aee Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sat, 8 Mar 2014 14:36:42 +0200 Subject: [PATCH] Added pop-ups --- youtube_dl_gui/YoutubeDLGUI.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/youtube_dl_gui/YoutubeDLGUI.py b/youtube_dl_gui/YoutubeDLGUI.py index 4ecd199..26fcfa4 100644 --- a/youtube_dl_gui/YoutubeDLGUI.py +++ b/youtube_dl_gui/YoutubeDLGUI.py @@ -128,6 +128,7 @@ class MainFrame(wx.Frame): if self.downloadHandler._has_closed(): self.status_bar_write('Stoping downloads') if self.downloadHandler._has_finished(): + self.finished_popup() self.status_bar_write('Done') self.downloadButton.SetLabel('Download') self.updateButton.Enable() @@ -161,10 +162,18 @@ class MainFrame(wx.Frame): self.downloadHandler = DownloadHandler(self.statusList) self.downloadButton.SetLabel('Stop') self.updateButton.Disable() + else: + self.no_url_popup() def save_options(self): self.optionsList.save_to_file() + def finished_popup(self): + wx.MessageBox('Downloads completed.', 'Info', wx.OK | wx.ICON_INFORMATION) + + def no_url_popup(self): + wx.MessageBox('You need to provide at least one url.', 'Error', wx.OK | wx.ICON_EXCLAMATION) + def OnTrackListChange(self, event): if self.downloadThread != None: ''' Get current url list from trackList textCtrl ''' @@ -194,7 +203,7 @@ class MainFrame(wx.Frame): self.update_youtube_dl() def OnOptions(self, event): - optionsFrame = OptionsFrame(self.optionsList) + optionsFrame = OptionsFrame(self.optionsList, self) optionsFrame.Show() def OnClose(self, event):