From a432da60e5da0d141a77b851b9e75d642dff7f51 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Fri, 19 Jan 2024 23:40:45 +0300 Subject: [PATCH] add m3u ui file --- app/ui/iptv.py | 36 +-- app/ui/m3u.glade | 670 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 679 insertions(+), 27 deletions(-) create mode 100644 app/ui/m3u.glade diff --git a/app/ui/iptv.py b/app/ui/iptv.py index ad9f5fdb..5ce1be7f 100644 --- a/app/ui/iptv.py +++ b/app/ui/iptv.py @@ -699,33 +699,15 @@ class M3uImportDialog(IptvListDialog): self._dialog.set_title(translate("Playlist import")) self._dialog.connect("delete-event", self.on_close) self._apply_button.set_label(translate("Import")) - # Progress - self._progress_bar = Gtk.ProgressBar(visible=False, valign="center") - self._spinner = Gtk.Spinner(active=False) - self._info_label = Gtk.Label(visible=True, ellipsize="end", max_width_chars=30) - load_label = Gtk.Label(label=translate("Loading data...")) - self._spinner.bind_property("active", self._spinner, "visible") - self._spinner.bind_property("visible", load_label, "visible") + # Extra box. + builder = get_builder(f"{UI_RESOURCES_PATH}m3u.glade", use_str=True, objects=("import_m3u_box",)) + self._data_box.add(builder.get_object("import_m3u_box")) + self._info_label = builder.get_object("info_label") + self._progress_bar = builder.get_object("progress_bar") + self._spinner = builder.get_object("spinner") self._spinner.bind_property("active", self._start_values_grid, "sensitive", 4) - - progress_box = Gtk.HBox(visible=True, spacing=2) - progress_box.add(self._progress_bar) - progress_box.pack_end(self._spinner, False, False, 0) - progress_box.pack_start(load_label, False, False, 0) - # Picons - self._picons_switch = Gtk.Switch(visible=True) - self._picon_box = Gtk.HBox(visible=True, sensitive=False, spacing=5) - self._picon_box.pack_end(self._picons_switch, False, False, 0) - self._picon_box.pack_end(Gtk.Label(visible=True, label=translate("Download picons")), False, False, 0) - # Extra box - extra_box = Gtk.HBox(visible=True, spacing=2, margin_bottom=5, margin_top=5) - extra_box.set_center_widget(progress_box) - extra_box.pack_start(self._info_label, False, False, 5) - extra_box.pack_end(self._picon_box, True, True, 5) - - frame = Gtk.Frame(visible=True, margin_bottom=5) - frame.add(extra_box) - self._data_box.add(frame) + self._picon_switch = builder.get_object("picon_switch") + self._picon_box = builder.get_object("picon_box") self.get_m3u(m3_path, s_type) @@ -775,7 +757,7 @@ class M3uImportDialog(IptvListDialog): services.append(s._replace(picon=None, picon_id=picon_id, data_id=None, fav_id=fav_id)) - if self._picons_switch.get_active(): + if self._picon_switch.get_active(): if self.is_default_values(): show_dialog(DialogType.ERROR, self._dialog, "Set values for TID, NID and Namespace for correct naming of the picons!") diff --git a/app/ui/m3u.glade b/app/ui/m3u.glade new file mode 100644 index 00000000..17b80a90 --- /dev/null +++ b/app/ui/m3u.glade @@ -0,0 +1,670 @@ + + + + + + + + + + + True + False + 10 + 10 + 10 + 5 + vertical + 5 + + + True + False + + + + True + False + 10 + 10 + 10 + 10 + 5 + 5 + + + True + False + start + Port: + + + 0 + 0 + + + + + True + False + start + Export + + + 0 + 1 + + + + + True + False + expand + + + All types + header-button + True + True + False + True + False + + + False + True + 0 + + + + + IPTV only + header-button + True + True + False + True + False + radiobutton2 + + + False + True + 1 + + + + + 1 + 1 + + + + + True + False + expand + + + Bouquets + header-button + True + True + False + True + False + + + True + True + 0 + + + + + Markers + header-button + True + True + False + True + False + radiobutton3 + + + True + True + 1 + + + + + No + header-button + True + True + False + True + False + radiobutton4 + + + True + True + 2 + + + + + 1 + 2 + + + + + True + False + 5 + + + True + True + 10 + document-edit-symbolic + 8001 + digits + + + False + True + 0 + + + + + True + True + True + + + True + False + 5 + + + True + False + emblem-synchronizing-symbolic + + + False + True + 0 + + + + + True + False + Auto + + + False + True + 1 + + + + + + + False + True + 1 + + + + + 1 + 0 + + + + + True + False + start + + + True + False + Group by + + + False + True + 0 + + + + + True + False + : + + + False + True + 1 + + + + + 0 + 2 + + + + + + + + False + True + 0 + + + + + 26 + True + False + + + True + False + 10 + 10 + 5 + 5 + document-properties + 2 + + + False + True + 0 + + + + + True + False + 5 + 10 + 2 + + + True + False + Bouquets + + + False + True + 0 + + + + + True + False + : + + + False + True + 1 + + + + + True + False + 0 + + + False + True + 2 + + + + + False + True + 1 + + + + + True + False + + + True + False + Services + + + False + True + 0 + + + + + True + False + : + + + False + True + 1 + + + + + True + False + 0 + + + False + True + 2 + + + + + False + True + 2 + + + + + False + True + end + 1 + + + + + True + False + vertical + + + True + False + 5 + 0.019999999552965164 + none + + + True + False + + + True + False + 10 + 10 + 10 + 10 + vertical + 10 + + + True + False + expand + + + Current bouquet + True + True + False + True + False + sub_bq_button + + + True + True + 0 + + + + + Single bouquet + True + False + True + False + True + False + cuurent_bq_button + + + True + True + 1 + + + + + Split by groups + True + False + True + False + True + False + sub_bq_button + + + True + True + 2 + + + + + Create sub-bouquets + True + False + True + False + True + False + cuurent_bq_button + + + True + True + 3 + + + + + False + True + 0 + + + + + True + False + 15 + + + False + center + + + False + True + 2 + + + + + True + False + 5 + + + True + False + end + 30 + + + False + True + 0 + + + + + False + False + Loading data... + + + False + True + 1 + + + + + False + False + + + False + False + 2 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Download picons + + + False + True + 0 + + + + + True + True + + + False + True + 1 + + + + + False + True + end + 2 + + + + + False + True + 1 + + + + + + + + + + True + False + 2 + Import + + + + + + + + False + True + 0 + + + +