From a3083648465186f3bcb1e0add527ae7d329cfcb4 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sat, 15 Oct 2016 20:14:30 +0300 Subject: [PATCH] Add selected audio formats to the main format window --- youtube_dl_gui/mainframe.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/youtube_dl_gui/mainframe.py b/youtube_dl_gui/mainframe.py index c721dd7..dbf3987 100644 --- a/youtube_dl_gui/mainframe.py +++ b/youtube_dl_gui/mainframe.py @@ -431,15 +431,18 @@ class MainFrame(wx.Frame): self._buttons["pause"].SetBitmap(self._bitmaps["pause"], wx.TOP) def _update_videoformat_combobox(self): - video_formats = list(DEFAULT_FORMATS.values()) + formats = list(DEFAULT_FORMATS.values()) for vformat in self.opt_manager.options["selected_video_formats"]: - video_formats.append(FORMATS[vformat]) + formats.append(FORMATS[vformat]) + + for aformat in self.opt_manager.options["selected_audio_formats"]: + formats.append(FORMATS[aformat]) self._videoformat_combobox.Clear() - self._videoformat_combobox.AppendItems(video_formats) + self._videoformat_combobox.AppendItems(formats) - current_index = self._videoformat_combobox.FindString(FORMATS[self.opt_manager.options["video_format"]]) + current_index = self._videoformat_combobox.FindString(FORMATS[self.opt_manager.options["selected_format"]]) if current_index == wx.NOT_FOUND: self._videoformat_combobox.SetSelection(0) @@ -449,7 +452,7 @@ class MainFrame(wx.Frame): self._update_videoformat(None) def _update_videoformat(self, event): - self.opt_manager.options["video_format"] = FORMATS[self._videoformat_combobox.GetValue()] + self.opt_manager.options["selected_format"] = FORMATS[self._videoformat_combobox.GetValue()] def _update_savepath(self, event): self.opt_manager.options["save_path"] = self._path_combobox.GetValue()