From 5eb6f8d63fc28cc02a0fbf7b30dde38a0e378ee0 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sat, 16 Oct 2021 14:37:21 +0300 Subject: [PATCH] minor rework of yt import dialog --- app/ui/iptv.glade | 196 ++++++++++++++++++++++++++-------------------- app/ui/iptv.py | 20 ++--- 2 files changed, 119 insertions(+), 97 deletions(-) diff --git a/app/ui/iptv.glade b/app/ui/iptv.glade index 14a5d71d..34b77c1c 100644 --- a/app/ui/iptv.glade +++ b/app/ui/iptv.glade @@ -751,6 +751,7 @@ Author: Dmitriy Yefremov True False Done! + end False @@ -1298,6 +1299,7 @@ Author: Dmitriy Yefremov False start label + end True @@ -1342,13 +1344,13 @@ Author: Dmitriy Yefremov 480 False YouTube - False True center-on-parent 480 True True True + @@ -1358,97 +1360,111 @@ Author: Dmitriy Yefremov False vertical - + + yt_import_header_box True False - 15 - 15 - 5 - 5 - - Receive + True - False - True - True - Receive - center - yt_receive_image - True - - + False + 15 + 15 + 5 + 5 + 5 + + + Receive + True + False + True + True + Receive + center + yt_receive_image + True + + + + + False + True + 0 + + + + + True + False + Playlist import + + + False + True + 2 + + + + + True + False + expand + + + Import + False + True + Import + yt_import_image + True + + + + + True + True + 0 + + + + + False + Desired video quality + yt_quality_liststore + 0 + 0 + + + + 0 + + + + + True + True + 1 + + + + + False + True + end + 1 + + - False + True True 0 - - - True - False - Playlist import - - - False - True - 2 - - - - - True - False - expand - - - False - Desired video quality - center - yt_quality_liststore - 0 - 0 - - - - 0 - - - - - True - True - 2 - - - - - Import - True - True - Import - center - yt_import_image - True - - - - - True - True - 2 - - - - - False - True - end - 1 - - + False @@ -1464,7 +1480,7 @@ Author: Dmitriy Yefremov 5 5 5 - gtk-edit + document-edit-symbolic Link to YouTube resource. YouTube playlist URL: @@ -1477,7 +1493,10 @@ Author: Dmitriy Yefremov + True True + 5 + 5 in 150 @@ -1497,7 +1516,7 @@ Author: Dmitriy Yefremov True - 50 + 100 Title True True @@ -1528,8 +1547,7 @@ Author: Dmitriy Yefremov - 50 - 100 + 100 Selected True 0.5 @@ -1570,9 +1588,12 @@ Author: Dmitriy Yefremov 26 + True False 5 - 10 + 5 + 5 + 5 2 @@ -1661,6 +1682,7 @@ Author: Dmitriy Yefremov False start info + end True diff --git a/app/ui/iptv.py b/app/ui/iptv.py index bbd221a8..fa9296aa 100644 --- a/app/ui/iptv.py +++ b/app/ui/iptv.py @@ -861,10 +861,14 @@ class YtListImportDialog: self._import_button.bind_property("visible", self._quality_box, "visible") self._import_button.bind_property("sensitive", self._quality_box, "sensitive") self._receive_button.bind_property("sensitive", self._import_button, "sensitive") - # style - self._style_provider = Gtk.CssProvider() - self._style_provider.load_from_path(UI_RESOURCES_PATH + "style.css") - self._url_entry.get_style_context().add_provider_for_screen(Gdk.Screen.get_default(), self._style_provider, + + window_size = self._settings.get("yt_import_dialog_size") + if window_size: + self._dialog.resize(*window_size) + # Style + style_provider = Gtk.CssProvider() + style_provider.load_from_path(UI_RESOURCES_PATH + "style.css") + self._url_entry.get_style_context().add_provider_for_screen(Gdk.Screen.get_default(), style_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER) def show(self): @@ -909,7 +913,6 @@ class YtListImportDialog: self.update_active_elements(True) def on_receive(self, item): - self.show_invisible_elements() self.update_active_elements(False) self._model.clear() self._yt_count_label.set_text("0") @@ -968,11 +971,6 @@ class YtListImportDialog: self._url_entry.set_sensitive(sensitive) self._receive_button.set_sensitive(sensitive) - def show_invisible_elements(self): - self._list_view_scrolled_window.set_visible(True) - self._info_bar_box.set_visible(True) - self._dialog.set_resizable(True) - def on_url_entry_changed(self, entry): url_str = entry.get_text() yt_id = YouTube.get_yt_list_id(url_str) @@ -1028,7 +1026,9 @@ class YtListImportDialog: def on_close(self, window, event): if self._download_task and show_dialog(DialogType.QUESTION, self._dialog) == Gtk.ResponseType.CANCEL: return True + self._download_task = False + self._settings.add("yt_import_dialog_size", self._dialog.get_size()) if __name__ == "__main__":