From 500ad8ecf4bf7408f42ae933b51613df363e15c4 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sat, 15 Oct 2016 00:07:27 +0300 Subject: [PATCH] GeneralTab: Implement load-save options methods --- youtube_dl_gui/optionsframe.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/youtube_dl_gui/optionsframe.py b/youtube_dl_gui/optionsframe.py index 4e921d4..10e76e3 100644 --- a/youtube_dl_gui/optionsframe.py +++ b/youtube_dl_gui/optionsframe.py @@ -309,10 +309,22 @@ class GeneralTab(TabPanel): self.SetSizer(main_sizer) def load_options(self): - pass + self.language_combobox.SetValue(self.LOCALE_NAMES[self.opt_manager.options["locale_name"]]) + #TODO Add filename_format_combobox + self.filename_custom_format.SetValue(self.opt_manager.options["output_template"]) + self.filename_ascii_checkbox.SetValue(self.opt_manager.options["restrict_filenames"]) + #TODO Add confirm_exit_checkbox + self.shutdown_checkbox.SetValue(self.opt_manager.options["shutdown"]) + self.sudo_textctrl.SetValue(self.opt_manager.options["sudo_password"]) def save_options(self): - pass + self.opt_manager.options["locale_name"] = self.LOCALE_NAMES[self.language_combobox.GetValue()] + #TODO Add filename_format_combobox + self.opt_manager.options["output_template"] = self.filename_custom_format.GetValue() + self.opt_manager.options["restrict_filenames"] = self.filename_ascii_checkbox.GetValue() + #TODO Add confirm_exit_checkbox + self.opt_manager.options["shutdown"] = self.shutdown_checkbox.GetValue() + self.opt_manager.options["sudo_password"] = self.sudo_textctrl.GetValue() class FormatsTab(TabPanel):