From abd803a58c60fb24ad539976e251900ee23a925f Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sun, 8 Jul 2018 14:58:41 +0300 Subject: [PATCH] lock/hide fix --- app/ui/main_app_window.py | 14 ++++---- app/ui/main_window.glade | 68 +++++++++++++++++++++++++-------------- app/ui/uicommons.py | 2 +- 3 files changed, 50 insertions(+), 34 deletions(-) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 745b63a1..eee1813d 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -852,18 +852,16 @@ class MainAppWindow: def set_service_flags(self, flag): profile = Profile(self._profile) bq_selected = self.get_selected_bouquet() - if not bq_selected: - return - if profile is Profile.ENIGMA_2: - if set_flags(flag, self._services_view, self._fav_view, self._services, self._blacklist): + if set_flags(flag, self._services_view, self._fav_view, self._services, self._blacklist) and bq_selected: self._fav_model.clear() self.update_bouquet_services(self._fav_model, None, bq_selected) - elif profile is Profile.NEUTRINO_MP: - model, path = self._bouquets_view.get_selection().get_selected() - value = model.get_value(path, 1 if flag is Flag.LOCK else 2) + elif profile is Profile.NEUTRINO_MP and bq_selected: + model, paths = self._bouquets_view.get_selection().get_selected_rows() + itr = model.get_iter(paths[0]) + value = model.get_value(itr, 1 if flag is Flag.LOCK else 2) value = None if value else LOCKED_ICON if flag is Flag.LOCK else HIDE_ICON - model.set_value(path, 1 if flag is Flag.LOCK else 2, value) + model.set_value(itr, 1 if flag is Flag.LOCK else 2, value) @run_idle def on_model_changed(self, model, path, itr=None): diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index 864adb95..f0dc0dbf 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -27,7 +27,7 @@ Author: Dmitriy Yefremov --> - + @@ -683,7 +683,7 @@ Author: Dmitriy Yefremov True - True + False True left_header_popover_menu @@ -715,7 +715,7 @@ Author: Dmitriy Yefremov True - True + False True FTP-transfer @@ -736,7 +736,7 @@ Author: Dmitriy Yefremov True - True + False True Save @@ -769,7 +769,7 @@ Author: Dmitriy Yefremov True - True + False True @@ -789,7 +789,7 @@ Author: Dmitriy Yefremov True - True + False True @@ -821,7 +821,8 @@ Author: Dmitriy Yefremov True - True + False + False True Parent lock On/Off Ctrl + L @@ -829,7 +830,7 @@ Author: Dmitriy Yefremov True False - dialog-password-symbolic + changes-prevent-symbolic @@ -842,7 +843,8 @@ Author: Dmitriy Yefremov True - True + False + False True Hide/Skip On/Off Ctrl + H @@ -933,39 +935,55 @@ Author: Dmitriy Yefremov True False - + True False False + True New bouquet - New - True - gtk-new + + + True + False + gtk-new + + False True - 2 + 0 - + True False False + True Edit - Edit - True - gtk-edit + + + True + False + gtk-edit + + False True - 3 + 1 + + + + + + True @@ -981,7 +999,7 @@ Author: Dmitriy Yefremov True - True + False True Satellites editor @@ -1002,7 +1020,7 @@ Author: Dmitriy Yefremov True - True + False True Picons downloader @@ -1023,7 +1041,7 @@ Author: Dmitriy Yefremov True - True + False True Import m3u file @@ -1044,7 +1062,7 @@ Author: Dmitriy Yefremov True - True + False True none False @@ -1100,7 +1118,7 @@ Author: Dmitriy Yefremov True False - True + False True half @@ -1123,7 +1141,7 @@ Author: Dmitriy Yefremov True False - True + False True half diff --git a/app/ui/uicommons.py b/app/ui/uicommons.py index 31564783..a3bed4f3 100644 --- a/app/ui/uicommons.py +++ b/app/ui/uicommons.py @@ -20,7 +20,7 @@ theme = Gtk.IconTheme.get_default() _IMAGE_MISSING = theme.load_icon("image-missing", 16, 0) if theme.lookup_icon("image-missing", 16, 0) else None CODED_ICON = theme.load_icon("emblem-readonly", 16, 0) if theme.lookup_icon( "emblem-readonly", 16, 0) else _IMAGE_MISSING -LOCKED_ICON = theme.load_icon("dialog-password-symbolic", 16, 0) if theme.lookup_icon( +LOCKED_ICON = theme.load_icon("changes-prevent-symbolic", 16, 0) if theme.lookup_icon( "system-lock-screen", 16, 0) else _IMAGE_MISSING HIDE_ICON = theme.load_icon("go-jump", 16, 0) if theme.lookup_icon("go-jump", 16, 0) else _IMAGE_MISSING TV_ICON = theme.load_icon("tv-symbolic", 16, 0) if theme.lookup_icon("tv-symbolic", 16, 0) else _IMAGE_MISSING