Browse Source

Option to enable-disable completion popup. Closes #87

doc-issue-template
MrS0m30n3 8 years ago
parent
commit
926a86e40b
4 changed files with 11 additions and 3 deletions
  1. 1
      TODO
  2. 3
      youtube_dl_gui/mainframe.py
  3. 4
      youtube_dl_gui/optionsframe.py
  4. 6
      youtube_dl_gui/optionsmanager.py

1
TODO

@ -1,6 +1,5 @@
NEW_LAYOUT
==========
* Option to disable-enable the 'download finished' pop up message
* Option to enable-disable items deletion from the filesystem
* Option to validate item deletion 'Are you sure?'
* Add '--recode-video' to Formats tab

3
youtube_dl_gui/mainframe.py

@ -845,7 +845,8 @@ class MainFrame(wx.Frame):
else:
self._status_bar_write(self.SHUTDOWN_ERR)
else:
self._create_popup(self.DL_COMPLETED_MSG, self.INFO_LABEL, wx.OK | wx.ICON_INFORMATION)
if self.opt_manager.options["show_completion_popup"]:
self._create_popup(self.DL_COMPLETED_MSG, self.INFO_LABEL, wx.OK | wx.ICON_INFORMATION)
def _download_worker_handler(self, msg):
"""downloadmanager.Worker thread handler.

4
youtube_dl_gui/optionsframe.py

@ -297,6 +297,7 @@ class GeneralTab(TabPanel):
self.more_opts_label = self.crt_statictext("More options")
self.confirm_exit_checkbox = self.crt_checkbox("Confirm on exit")
self.show_completion_popup_checkbox = self.crt_checkbox("Inform me on download completion")
self.shutdown_checkbox = self.crt_checkbox("Shutdown on download completion", event_handler=self._on_shutdown)
self.sudo_textctrl = self.crt_textctrl(wx.TE_PASSWORD)
@ -333,6 +334,7 @@ class GeneralTab(TabPanel):
vertical_sizer.Add(self.more_opts_label, flag=wx.TOP, border=5)
vertical_sizer.Add(self.confirm_exit_checkbox, flag=wx.ALL, border=5)
vertical_sizer.Add(self.show_completion_popup_checkbox, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5)
shutdown_sizer = wx.BoxSizer(wx.HORIZONTAL)
shutdown_sizer.Add(self.shutdown_checkbox, 2)
@ -408,6 +410,7 @@ class GeneralTab(TabPanel):
self.shutdown_checkbox.SetValue(self.opt_manager.options["shutdown"])
self.sudo_textctrl.SetValue(self.opt_manager.options["sudo_password"])
self.confirm_exit_checkbox.SetValue(self.opt_manager.options["confirm_exit"])
self.show_completion_popup_checkbox.SetValue(self.opt_manager.options["show_completion_popup"])
#REFACTOR Automatically call on the new methods
#save_options
@ -424,6 +427,7 @@ class GeneralTab(TabPanel):
self.opt_manager.options["shutdown"] = self.shutdown_checkbox.GetValue()
self.opt_manager.options["sudo_password"] = self.sudo_textctrl.GetValue()
self.opt_manager.options["confirm_exit"] = self.confirm_exit_checkbox.GetValue()
self.opt_manager.options["show_completion_popup"] = self.show_completion_popup_checkbox.GetValue()
class FormatsTab(TabPanel):

6
youtube_dl_gui/optionsmanager.py

@ -217,6 +217,9 @@ class OptionsManager(object):
native_hls (boolean): When True youtube-dl will use the native HLS implementation.
show_completion_popup (boolean): When True youtube-dl-gui will create a popup
to inform the user for the download completion.
"""
#TODO Remove old options & check options validation
self.options = {
@ -277,7 +280,8 @@ class OptionsManager(object):
'youtube_dl_debug': False,
'ignore_config': True,
'confirm_exit': True,
'native_hls': True
'native_hls': True,
'show_completion_popup': True
}
def load_from_file(self):

Loading…
Cancel
Save