From 124f9e2ba4965470783ecf78bb640f05cec4cba3 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Tue, 18 May 2021 16:23:30 +0300 Subject: [PATCH] small refactoring for iptv list dialog --- app/ui/iptv.glade | 14 ++++++++++++++ app/ui/iptv.py | 8 +++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/ui/iptv.glade b/app/ui/iptv.glade index 0e390b5e..43d90967 100644 --- a/app/ui/iptv.glade +++ b/app/ui/iptv.glade @@ -307,6 +307,19 @@ Author: Dmitriy Yefremov 1 + + + OK + True + True + center + + + False + False + 2 + + False @@ -764,6 +777,7 @@ Author: Dmitriy Yefremov cancel_config_list_button list_configuration_apply_button + list_configuration_ok_button diff --git a/app/ui/iptv.py b/app/ui/iptv.py index 53bc0233..b25135d0 100644 --- a/app/ui/iptv.py +++ b/app/ui/iptv.py @@ -466,6 +466,7 @@ class IptvListDialog: self._list_namespace_entry = builder.get_object("list_namespace_entry") self._apply_button = builder.get_object("list_configuration_apply_button") self._cancel_button = builder.get_object("cancel_config_list_button") + self._ok_button = builder.get_object("list_configuration_ok_button") # Style style_provider = Gtk.CssProvider() style_provider.load_from_path(UI_RESOURCES_PATH + "style.css") @@ -627,6 +628,8 @@ class M3uImportDialog(IptvListDialog): self._dialog.set_title(get_message("Playlist import")) self._dialog.connect("delete-event", self.on_close) self._apply_button.set_label(get_message("Import")) + self._ok_button.bind_property("visible", self._apply_button, "visible", 4) + self._ok_button.bind_property("visible", self._cancel_button, "visible", 4) # Progress self._progress_bar = Gtk.ProgressBar(visible=False, valign="center") self._spinner = Gtk.Spinner(active=False) @@ -654,11 +657,6 @@ class M3uImportDialog(IptvListDialog): frame = Gtk.Frame(visible=True) frame.add(extra_box) self._data_box.add(frame) - # Buttons - self._ok_button = Gtk.Button.new_from_stock(Gtk.STOCK_OK) - self._ok_button.bind_property("visible", self._apply_button, "visible", 4) - self._ok_button.bind_property("visible", self._cancel_button, "visible", 4) - self._dialog.add_action_widget(self._ok_button, Gtk.ResponseType.OK) self.get_m3u(m3_path, s_type)