From 14bf79dbf945584c5bf9dd59f748c618d1b178c7 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Wed, 12 Feb 2020 17:35:44 +0300 Subject: [PATCH] toolbar changes --- app/ui/main_app_window.py | 29 +++++++++---- app/ui/main_window.glade | 90 +++++++++++++++++++++++---------------- 2 files changed, 75 insertions(+), 44 deletions(-) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 02a671ec..b822532d 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -211,6 +211,7 @@ class Application(Gtk.Application): self._profile_combo_box = builder.get_object("profile_combo_box") self._receiver_info_box = builder.get_object("receiver_info_box") self._receiver_info_label = builder.get_object("receiver_info_label") + self._current_ip_label = builder.get_object("current_ip_label") self._signal_box = builder.get_object("signal_box") self._service_name_label = builder.get_object("service_name_label") self._service_epg_label = builder.get_object("service_epg_label") @@ -388,7 +389,7 @@ class Application(Gtk.Application): def init_profiles(self, profile=None): self.update_profiles() - self._profile_combo_box.set_active_id(profile if profile else self._settings.default_profile) + self._profile_combo_box.set_active_id(profile if profile else self._settings.current_profile) if profile: self.set_profile(profile) @@ -1292,21 +1293,26 @@ class Application(Gtk.Application): yield from gen def on_profile_changed(self, entry): - if self._app_info_box.get_visible(): - self.update_profile_label() + active = self._profile_combo_box.get_active_text() + if not active: return - active = self._profile_combo_box.get_active_text() + changed = self._settings.current_profile != active + if active in self._settings.profiles: self.set_profile(active) + + if self._app_info_box.get_visible(): + return + gen = self.init_http_api() GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW) - self.open_data() + if changed: + self.open_data() def set_profile(self, active): self._settings.current_profile = active self._s_type = self._settings.setting_type - self._profile_combo_box.set_tooltip_text(self._profile_combo_box.get_tooltip_text() + self._settings.host) self.update_profile_label() def update_profiles(self): @@ -1958,6 +1964,9 @@ class Application(Gtk.Application): # ***************** Filter and search *********************# def on_filter_toggled(self, action, value): + if self._app_info_box.get_visible(): + return True + action.set_state(value) if value: self.update_filter_sat_positions() @@ -2045,6 +2054,9 @@ class Application(Gtk.Application): return txt and free def on_search_toggled(self, action, value): + if self._app_info_box.get_visible(): + return True + action.set_state(value) self._search_bar.set_search_mode(value) if value: @@ -2267,9 +2279,10 @@ class Application(Gtk.Application): @run_idle def update_profile_label(self): - label, sep, ip = self._profile_combo_box.get_tooltip_text().partition(":") + label, sep, ip = self._current_ip_label.get_text().partition(":") + self._current_ip_label.set_text("{}: {}".format(label, self._settings.host)) + profile_name = self._profile_combo_box.get_active_text() - self._profile_combo_box.set_tooltip_text("{}: {}".format(label, self._settings.host)) msg = get_message("Profile:") if self._s_type is SettingsType.ENIGMA_2: title = "DemonEditor [{} {} - Enigma2 v.{}]".format(msg, profile_name, self.get_format_version()) diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index b4c19dab..823c64df 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -697,6 +697,7 @@ Author: Dmitriy Yefremov True False + 10 True @@ -707,7 +708,6 @@ Author: Dmitriy Yefremov True False Open - 5 app.on_data_open Open True @@ -729,12 +729,58 @@ Author: Dmitriy Yefremov True gtk-connect + + False + True + 1 + + + + + True + False + False + Profile + 0 + + False True 2 + + + True + False + Save + app.on_data_save + Save + True + gtk-save + + + False + True + 3 + + + + + True + False + app.on_backup_tool_show + Backup + True + gtk-revert-to-saved + + + False + True + 4 + + @@ -751,23 +797,6 @@ Author: Dmitriy Yefremov True False 2 - - - True - False - Save - 5 - app.on_data_save - Save - True - gtk-save - - - False - True - 0 - - True @@ -806,6 +835,7 @@ Author: Dmitriy Yefremov True False Parent lock On/Off Ctrl + L + 5 app.on_locked Parent lock True @@ -2286,6 +2316,7 @@ Author: Dmitriy Yefremov + 28 False 1 1 @@ -2331,26 +2362,13 @@ Author: Dmitriy Yefremov - + True False - False - Current IP: - 0 - True - - - False - True - False - False - 9 - True - False - gtk-connect - - - + Current IP: + + + False