diff --git a/app/tools/picons.py b/app/tools/picons.py index b2207d90..b35c4cf1 100644 --- a/app/tools/picons.py +++ b/app/tools/picons.py @@ -37,7 +37,7 @@ from html.parser import HTMLParser import requests from app.commons import run_task, log -from app.settings import SettingsType +from app.settings import SettingsType, IS_LINUX, IS_WIN from .satellites import _HEADERS _ENIGMA2_PICON_KEY = "{:X}:{:X}:{}" @@ -57,7 +57,7 @@ class PiconsCzDownloader: _PERM_URL = "https://picon.cz/download/7337" _BASE_URL = "https://picon.cz/download/" _BASE_LOGO_URL = "https://picon.cz/picon/0/" - _HEADER = {"User-Agent": "DemonEditor/1.0.10", "Referer": ""} + _HEADER = {"User-Agent": "DemonEditor/2.0.0", "Referer": ""} _LINK_PATTERN = re.compile(r"((.*)-\d+x\d+)-(.*)_by_chocholousek.7z$") _FILE_PATTERN = re.compile(b"\\s+(1_.*\\.png).*") @@ -81,7 +81,11 @@ class PiconsCzDownloader: name_map = self.get_name_map() for line in request.iter_lines(): - l_id, perm_link = line.decode(encoding="utf-8", errors="ignore").split(maxsplit=1) + data = line.decode(encoding="utf-8", errors="ignore").split(maxsplit=1) + if len(data) != 2: + continue + + l_id, perm_link = data self._perm_links[str(l_id)] = str(perm_link) data = re.match(self._LINK_PATTERN, perm_link) if data: @@ -89,7 +93,7 @@ class PiconsCzDownloader: # Logo url. logo = logo_map.get(data.group(2), None) l_name = name_map.get(sat_pos, None) or sat_pos.replace(".", "") - logo_url = "{}{}/{}.png".format(self._BASE_LOGO_URL, logo, l_name) if logo else None + logo_url = f"{self._BASE_LOGO_URL}{logo}/{l_name}.png" if logo else None prv = Provider(None, data.group(1), sat_pos, self._BASE_URL + l_id, l_id, logo_url, None, False) if sat_pos in self._providers: @@ -97,7 +101,7 @@ class PiconsCzDownloader: else: self._providers[sat_pos] = [prv] else: - log("{} [get permalinks] error: {}".format(self.__class__.__name__, request.reason)) + log(f"{self.__class__.__name__} [get permalinks] error: {request.reason}") raise PiconsError(request.reason) @property @@ -111,31 +115,36 @@ class PiconsCzDownloader: self._HEADER["Referer"] = provider.url with requests.get(url=provider.url, headers=self._HEADER, stream=True) as request: if request.reason == "OK": - dest = "{}{}.7z".format(picons_path, provider.on_id) - self._appender("Downloading: {}\n".format(provider.url)) + dest = f"{picons_path}{provider.on_id}.7z" + self._appender(f"Downloading: {provider.url}\n") with open(dest, mode="bw") as f: for data in request.iter_content(chunk_size=1024): f.write(data) - self._appender("Extracting: {}\n".format(provider.on_id)) + self._appender(f"Extracting: {provider.on_id}\n") self.extract(dest, picons_path, picon_ids) else: - log("{} [download] error: {}".format(self.__class__.__name__, request.reason)) + log(f"{self.__class__.__name__} [download] error: {request.reason}") def extract(self, src, dest, picon_ids=None): """ Extracts 7z archives. """ # TODO: think about https://github.com/miurahr/py7zr exe = "7zr" - if not os.path.isfile("/usr/bin/7zr"): + if IS_LINUX and not os.path.isfile("/usr/bin/7zr"): raise PiconsError("7-zip [7zr] archiver not found!") + if IS_WIN: + exe = "C:\\Program Files\\7-Zip\\7z.exe" + if not os.path.isfile(exe): + raise PiconsError("7-Zip executable not found!") + cmd = [exe, "l", src] try: out, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() if err: - log("{} [extract] error: {}".format(self.__class__.__name__, err)) + log(f"{self.__class__.__name__} [extract] error: {err}") raise PiconsError(err) except OSError as e: - log("{} [extract] error: {}".format(self.__class__.__name__, e)) + log(f"{self.__class__.__name__} [extract] error: {e}") raise PiconsError(e) is_filter = bool(picon_ids) @@ -157,7 +166,7 @@ class PiconsCzDownloader: try: out, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() if err: - log("{} [extract] error: {}".format(self.__class__.__name__, err)) + log(f"{self.__class__.__name__} [extract] error: {err}") raise PiconsError(err) else: if os.path.isfile(src): @@ -184,9 +193,9 @@ class PiconsCzDownloader: self._provider_logos[url] = data return data else: - log("Downloading package logo error: {}".format(logo_request.reason)) + log(f"Downloading package logo error: {logo_request.reason}") except requests.exceptions.ConnectionError as e: - log("{} error [get provider logo]: {}".format(self.__class__.__name__, e)) + log(f"{self.__class__.__name__} error [get provider logo]: {e}") def get_logos_map(self): return {"piconblack": "b50", diff --git a/app/ui/main.glade b/app/ui/main.glade index 44bed7bc..cebee79a 100644 --- a/app/ui/main.glade +++ b/app/ui/main.glade @@ -1321,14 +1321,14 @@ Author: Dmitriy Yefremov 5 5 - + True False False False True Filter - win.filter + True @@ -3288,6 +3288,7 @@ Author: Dmitriy Yefremov True False Info + end False diff --git a/app/ui/main.py b/app/ui/main.py index a53c64a6..caecadf0 100644 --- a/app/ui/main.py +++ b/app/ui/main.py @@ -164,6 +164,7 @@ class Application(Gtk.Application): "on_mark_duplicates": self.on_mark_duplicates, "on_filter_changed": self.on_filter_changed, "on_filter_type_toggled": self.on_filter_type_toggled, + "on_services_filter_toggled": self.on_services_filter_toggled, "on_filter_satellite_toggled": self.on_filter_satellite_toggled, "on_assign_picon": self.on_assign_picon, "on_remove_picon": self.on_remove_picon, @@ -261,6 +262,8 @@ class Application(Gtk.Application): GObject.TYPE_PYOBJECT, (GObject.TYPE_PYOBJECT,)) GObject.signal_new("data-load-done", self, GObject.SIGNAL_RUN_LAST, GObject.TYPE_PYOBJECT, (GObject.TYPE_PYOBJECT,)) + GObject.signal_new("filter-toggled", self, GObject.SIGNAL_RUN_LAST, + GObject.TYPE_PYOBJECT, (GObject.TYPE_PYOBJECT,)) builder = get_builder(UI_RESOURCES_PATH + "main.glade", handlers) self._main_window = builder.get_object("main_window") @@ -325,13 +328,13 @@ class Application(Gtk.Application): # Filter self._services_model_filter = builder.get_object("services_model_filter") self._services_model_filter.set_visible_func(self.services_filter_function) - self._filter_header_button = builder.get_object("filter_header_button") + self._filter_services_button = builder.get_object("filter_services_button") self._filter_entry = builder.get_object("filter_entry") self._filter_box = builder.get_object("filter_box") self._filter_types_model = builder.get_object("filter_types_list_store") self._filter_sat_pos_model = builder.get_object("filter_sat_pos_list_store") self._filter_only_free_button = builder.get_object("filter_only_free_button") - self._services_load_spinner.bind_property("active", self._filter_header_button, "sensitive", 4) + self._services_load_spinner.bind_property("active", self._filter_services_button, "sensitive", 4) self._services_load_spinner.bind_property("active", self._filter_box, "sensitive", 4) # Search. services_search_provider = SearchProvider(self._services_view, @@ -458,9 +461,10 @@ class Application(Gtk.Application): self.set_action("on_about_app", self.on_about_app) self.set_action("on_close_app", self.on_close_app) # Filter. - filter_action = Gio.SimpleAction.new_stateful("filter", None, GLib.Variant.new_boolean(False)) - filter_action.connect("change-state", self.on_filter_toggled) + filter_action = Gio.SimpleAction.new("filter", None) + filter_action.connect("activate", lambda a, v: self.emit("filter-toggled", None)) self._main_window.add_action(filter_action) # For "win.*" actions! + self.connect("filter-toggled", self.on_services_filter_toggled) # Lock, Hide. self.set_action("on_hide", self.on_hide) self.set_action("on_locked", self.on_locked) @@ -1646,7 +1650,7 @@ class Application(Gtk.Application): def update_data(self, data_path, callback=None): self._profile_combo_box.set_sensitive(False) self._alt_revealer.set_visible(False) - self._filter_header_button.set_active(False) + self._filter_services_button.set_active(False) self._wait_dialog.show() yield from self.clear_current_data() @@ -2958,15 +2962,15 @@ class Application(Gtk.Application): # ***************** Filter and search ********************* # - def on_filter_toggled(self, action, value): - if self._app_info_box.get_visible() or self._services_load_spinner.get_property("active"): + def on_services_filter_toggled(self, app=None, value=None): + if self._page is not Page.SERVICES and self._services_load_spinner.get_property("active"): return True - action.set_state(value) - - self._filter_entry.grab_focus() if value else self.on_filter_changed() + active = not self._filter_box.get_visible() + self._filter_services_button.set_active(active) + self._filter_entry.grab_focus() if active else self.on_filter_changed() self.filter_set_default() - self._filter_box.set_visible(value) + self._filter_box.set_visible(active) @run_idle def filter_set_default(self): @@ -3551,6 +3555,10 @@ class Application(Gtk.Application): def is_enigma(self, value): self._is_enigma = value + @property + def page(self): + return self._page + def start_app(): try: diff --git a/app/ui/picons.glade b/app/ui/picons.glade index 2002784b..2dbe134b 100644 --- a/app/ui/picons.glade +++ b/app/ui/picons.glade @@ -226,9 +226,9 @@ Author: Dmitriy Yefremov False 5 5 + 2 5 vertical - 5 True @@ -238,6 +238,73 @@ Author: Dmitriy Yefremov 5 5 5 + + + False + False + Convert + True + + + + True + False + gtk-execute + + + + + False + True + end + 0 + + + + + True + False + False + Details + False + + + True + False + emblem-important-symbolic + + + + + False + True + end + 0 + + + + + True + True + True + Filter + + + + True + False + Filter + edit-find-replace-symbolic + + + + + False + True + end + 1 + + False @@ -256,7 +323,7 @@ Author: Dmitriy Yefremov False True - 0 + 2 @@ -288,7 +355,6 @@ Author: Dmitriy Yefremov False False Receive picons - center True @@ -376,7 +442,7 @@ Author: Dmitriy Yefremov False True - 1 + 3 @@ -388,45 +454,20 @@ Author: Dmitriy Yefremov False True - 5 + 4 - - False - False - Convert - center - True - - - - True - False - gtk-execute - - - - - False - True - end - 2 - - - - + True False True - Filter - + Additional source - + True False - Filter - edit-find-replace-symbolic + window-new @@ -434,29 +475,7 @@ Author: Dmitriy Yefremov False True end - 3 - - - - - True - False - False - Details - False - - - True - False - emblem-important-symbolic - - - - - False - True - end - 4 + 6 @@ -467,380 +486,465 @@ Author: Dmitriy Yefremov - + True False - 0.5 - none + 5 + - + True False - 5 - + vertical + 5 - - True + False - vertical - 5 - - False - - - True - True - gtk-spell-check - False - False - - - - - - False - True - 0 - - - - + True True - vertical - True - - - True - False - 0.49000000953674316 - in - - - True - False - 5 - 5 - 5 - vertical - 2 - - - True - False - - - False - 5 - - - True - False - Filter - - - 0 - 0 - - - - - True - False - False - False - center - True - - - - 1 - 0 - - - - - False - True - end - 0 - - - - - False - True - 0 - - - - - True - True - in - - - True - True - picons_src_sort_model - False - 0 - True - - - - - - - - - - - - - column - - - - 0 - - - - - - - column - - - - 1 - - - - - - - False - column - - - - 2 - - - - - - - - - True - True - 2 - - - - - - - True - False - Source: - - - - - True - True - - - - - True - False - 0.49000000953674316 - in - - - True - False - 5 - 5 - 5 - vertical - 2 - - - True - False - - - False - 5 - - - True - False - False - False - center - right - True - True - - - - 1 - 0 - - - - - True - False - Filter - - - 0 - 0 - - - - - False - True - end - 0 - - - - - False - True - 0 - - - - - True - True - in - - - True - True - picons_dst_sort_model - False - 0 - True - - - - - - - - - - - column - - - - 0 - - - - - - - column - - - - 1 - - - - - - - False - column - - - - 2 - - - - - - - - - True - True - 3 - - - - - - - True - False - Destination: - - - - - True - True - - + edit-find-replace-symbolic + False + False + - - True - True - 2 - + + + False + True + 0 + + + + + True + True + vertical + True - + False - 0 - in + 0.49000000953674316 + none - + + True False - other - - + vertical + 5 + + + True False - 6 - end + + + False + 5 + 5 + + + True + False + Filter + + + 0 + 0 + + + + + True + False + False + False + center + True + + + + 1 + 0 + + + + + False + True + end + 0 + + False - False + True 0 - - - False - 10 + + + True + True + in - - 128 - 72 + True + True + picons_src_sort_model + horizontal + 0 + True + + + + + + + + + + + + + 150 + Picon + 0.49000000953674316 + + + + 0 + + + + + + + Name + 0.49000000953674316 + + + 10 + + + 1 + + + + + + + False + column + + + + 2 + + + + + + + + + True + True + 2 + + + + + + + True + False + Source: + + + + + True + True + + + + + True + False + 0.49000000953674316 + none + + + True + False + vertical + 5 + + + True + False + + False - gtk-missing-image - 6 - + 5 + 5 + + + True + False + False + False + center + right + True + True + + + + 1 + 0 + + + + + True + False + Filter + + + 0 + 0 + + + + + False + True + end + 0 + + + + + False + True + 0 + + + + + True + True + in + + + True + True + picons_dst_sort_model + horizontal + 0 + True + + + + + + + + + + + 150 + Picon + 0.49000000953674316 + + + + 0 + + + + + + + Name + True + 0.49000000953674316 + + + 10 + + + 1 + + + + + + + False + column + + + + 2 + + + + + + + + + True + True + 3 + + + + + + + False + Destination: + + + + + True + True + + + + + True + True + 2 + + + + + False + 0 + in + + + False + other + + + False + 6 + end + + + False + False + 0 + + + + + False + 10 + + + 128 + 72 + True + False + gtk-missing-image + 6 + + + + False + True + 0 + + + + + True + False + end + + + False + True + 1 + + + + + False + False + 0 + + + + + + + + + + + + + False + True + 6 + + + + + explorer + Explorer + + + + + True + False + vertical + + + True + False + 5 + 0.5 + in + + + True + True + 5 + 5 + 5 + 5 + True + + + 180 + True + False + 2 + vertical + 5 + + + True + False + 5 + 2 + + + False + Satellite False @@ -849,9 +953,10 @@ Author: Dmitriy Yefremov - + True False + Loading data... end @@ -860,522 +965,424 @@ Author: Dmitriy Yefremov 1 - - - False - False - 0 - - - - - - - - - - - - - False - True - 6 - - - - - explorer - Explorer - - - - - True - False - vertical - 2 - - - True - False - 0.5 - in - - - True - True - 5 - 5 - 5 - 5 - True - - - 180 - True - False - 2 - vertical - 2 - + True False - 5 - 2 - - - False - Satellite - - - False - True - 0 - - - - - True - False - Loading data... - end - - - False - True - 1 - - - - - True - False - 5 - True - - - False - True - 2 - - - - - True - False - 5 - 5 - - - True - False - Filter - - - 0 - 0 - - - - - True - True - True - - - - 1 - 0 - - - - - False - True - end - 3 - - + 5 + True False True - 0 - - - - - True - True - in - - - True - True - satellites_list_store - False - 0 - True - - - - - - - - Satellite - True - - - - 0 - - - - - - - False - Url - - - - 1 - - - - - - - False - Pos - - - - 2 - - - - - - - - - True - True - 1 - - - - - True - False - - - - - 300 - True - False - 2 - vertical - 2 - - - True - False - 10 - - - True - False - start - 5 - end - - - False - True - 0 - - - - - True - False - 5 - - - True - True - - - 1 - 0 - - - - - True - False - Load only for selected bouquet - - - 0 - 0 - - - - - False - True - end - 1 - - - - - False - True - 0 - - - - - 150 - True - True - 2 - out - - - True - True - providers_list_store - 1 - 0 - - - - - - - - - 15 - Name - True - 0.5 - 1 - - - 5 - - - 0 - - - - - end - - - 1 - - - - - - - autosize - Position - - - 0.50999999046325684 - True - - - - 2 - - - - - - - False - Url - - - - 3 - - - - - - - False - ONID - - - - 4 - - - - - - - False - SSID - - - - 5 - - - - - - - False - Single - - - - 6 - - - - - - - Selected - 7 - - - - - - 7 - - - - - - - - - True - True 2 - + True False - Current picons path: - 0.019999999552965164 + 5 + 5 + + + True + False + Filter + + + 0 + 0 + + + + + True + True + True + + + + 1 + 0 + + False True - 4 - - - - - True - True - folder-open - False - - - - False - True - 5 + end + 3 - True - False + False + True + 0 + + + + + True + True + in + + + True + True + satellites_list_store + False + 0 + True + + + + + + + + Satellite + True + + + + 0 + + + + + + + False + Url + + + + 1 + + + + + + + False + Pos + + + + 2 + + + + + + + + + True + True + 1 + + True + False + - - - True - False - Picons download tool - - - - - True - True - 0 - - - - - True - False - 2 - 2 - True - + + 300 True False - 0.05000000074505806 - in + 2 + vertical + 5 - + True False - vertical + 10 - + True False - center + start + 5 + end + + + False + True + 0 + + + + + True + False + 5 - - Enigma2 (default) + True True - False - True - neutrino_mp_radio_button - False - True - 0 + 1 + 0 - - Neutrino-MP + True - True - False - True - enigma2_radio_button + False + Load only for selected bouquet - False - True - 1 + 0 + 0 + + False + True + end + 1 + + + + + False + True + 0 + + + + + 150 + True + True + 2 + out + + + True + True + providers_list_store + 1 + 0 + + + + + + + + + 15 + Name + True + 0.5 + 1 + + + 5 + + + 0 + + + + + end + + + 1 + + + + + + + autosize + Position + + + 0.50999999046325684 + True + + + + 2 + + + + + + + False + Url + + + + 3 + + + + + + + False + ONID + + + + 4 + + + + + + + False + SSID + + + + 5 + + + + + + + False + Single + + + + 6 + + + + + + + Selected + 7 + + + + + + 7 + + + + + + + + + True + True + 2 + + + + + True + False + Current picons path: + 0.019999999552965164 + + + False + True + 4 + + + + + True + True + folder-open + False + + + + False + True + 5 + + + + + True + False + + + + + + + + + + True + True + 0 + + + + + True + False + 2 + 2 + True + + + True + False + 0.05000000074505806 + in + + + True + False + vertical + + + True + False + center + + + Enigma2 (default) + True + True + False + True + neutrino_mp_radio_button + + + False + True + 0 + + + + + Neutrino-MP + True + True + False + True + enigma2_radio_button + False True @@ -1383,238 +1390,240 @@ Author: Dmitriy Yefremov + + False + True + 1 + - - + + + + + True + False + Picons name format: + + + + + 0 + 0 + + + + + True + False + 0.05000000074505806 + in + + + True + False + vertical + + True False - Picons name format: + center + + + No(default) + True + True + False + True + resize_100_60_radio_button + + + False + True + 0 + + + + + 220x132 + True + True + False + True + resize_100_60_radio_button + + + False + True + 1 + + + + + 100x60 + True + True + False + True + resize_no_radio_button + + + False + True + 2 + + + + False + True + 1 + + + + + True + False + Resize: + + + + + 1 + 0 + + + + + False + True + 4 + + + + + downloader + Downloader + 1 + + + + + True + False + 5 + 0.5 + in + + + True + False + 5 + 5 + 5 + 5 + vertical + 2 + + + True + False + 10 + 10 + 10 + 5 + 2 + True + + + True + False + select-folder + + + 0 + 1 + + + + + True + False + Path to Enigma2 picons: + 0 0 - + True False - 0.05000000074505806 - in - - - True - False - vertical - - - True - False - center - - - No(default) - True - True - False - True - resize_100_60_radio_button - - - False - True - 0 - - - - - 220x132 - True - True - False - True - resize_100_60_radio_button - - - False - True - 1 - - - - - 100x60 - True - True - False - True - resize_no_radio_button - - - False - True - 2 - - - - - False - True - 1 - - - - - - - True - False - Resize: - - + Path to save: - 1 - 0 + 0 + 2 + + + + + True + False + select-folder + + + 0 + 3 False True - 4 + 0 + + + + + True + False + Enigma2 -> Neutrino-MP + + + False + True + end + 1 + + + + + True + False + gtk-convert + 3 + + + False + True + end + 2 - - downloader - Downloader - 1 - - - - True - False - 0.5 - in - - - True - False - 5 - 5 - 5 - 5 - vertical - 2 - - - True - False - 5 - 2 - True - - - True - False - select-folder - - - 0 - 1 - - - - - True - False - Path to Enigma2 picons: - - - 0 - 0 - - - - - True - False - Path to save: - - - 0 - 2 - - - - - True - False - select-folder - - - 0 - 3 - - - - - False - True - 0 - - - - - True - False - Enigma2 -> Neutrino-MP - - - False - True - end - 1 - - - - - True - False - gtk-convert - 3 - - - False - True - end - 2 - - - - - - - True - False - Converter between name formats - - - - - converter - Converter - 2 - + + - - - + + converter + Converter + 2 + @@ -1664,10 +1673,43 @@ Author: Dmitriy Yefremov - + True False - Picons manager + + + True + False + Picons manager + + + False + True + 0 + + + + + False + Picons download tool + + + False + True + 1 + + + + + False + Converter between name formats + + + False + True + 2 + + diff --git a/app/ui/picons.py b/app/ui/picons.py index 127d7480..2cbc3702 100644 --- a/app/ui/picons.py +++ b/app/ui/picons.py @@ -57,6 +57,7 @@ class PiconManager(Gtk.Box): self._app = app self._app.connect("page-changed", self.update_picons_dest) + self._app.connect("filter-toggled", self.on_app_filter_toggled) self._picon_ids = picon_ids self._sat_positions = sat_positions self._BASE_URL = "www.lyngsat.com/packages/" @@ -161,7 +162,9 @@ class PiconManager(Gtk.Box): self._satellite_label.bind_property("visible", self._satellites_view, "sensitive") self._cancel_button.bind_property("visible", self._header_download_box, "visible", 4) self._convert_button.bind_property("visible", self._header_download_box, "visible", 4) + self._convert_button.bind_property("visible", builder.get_object("converter_label"), "visible") self._download_source_button.bind_property("visible", self._receive_button, "visible") + self._download_source_button.bind_property("visible", builder.get_object("downloader_label"), "visible") self._filter_bar.bind_property("search-mode-enabled", self._filter_bar, "visible") self._filter_button.bind_property("active", builder.get_object("src_title_grid"), "visible") self._filter_button.bind_property("active", builder.get_object("dst_title_grid"), "visible") @@ -169,6 +172,11 @@ class PiconManager(Gtk.Box): self._filter_button.bind_property("visible", self._send_button, "visible") self._filter_button.bind_property("visible", self._download_button, "visible") self._filter_button.bind_property("visible", self._remove_button, "visible") + self._filter_button.bind_property("visible", builder.get_object("manager_label"), "visible") + self._src_button = builder.get_object("src_button") + self._src_button.bind_property("active", builder.get_object("explorer_dst_label"), "visible") + self._src_button.bind_property("active", builder.get_object("src_picon_box_frame"), "visible") + self._filter_button.bind_property("visible", self._src_button, "visible") explorer_info_bar = builder.get_object("explorer_info_bar") explorer_info_bar.bind_property("visible", builder.get_object("explorer_info_bar_frame"), "visible") self._info_check_button.bind_property("active", explorer_info_bar, "visible") @@ -194,6 +202,7 @@ class PiconManager(Gtk.Box): if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT): return + self._src_button.set_active(True) self.update_picons_data(self._picons_src_view, response) def update_picons_dest(self, app, page): @@ -246,7 +255,7 @@ class PiconManager(Gtk.Box): if p: model.append((p, path.name, f_path)) elif path.is_dir(): - self._explorer_src_path_button.select_filename(f_path) + self.update_picons_data(view, f_path) def get_pixbuf_at_scale(self, path, width, height, p_ratio): try: @@ -647,6 +656,7 @@ class PiconManager(Gtk.Box): if not self._resize_no_radio_button.get_active(): self.resize(picons_path) finally: + self._app.update_picons() GLib.idle_add(self._cancel_button.hide) self._is_downloading = False @@ -793,8 +803,12 @@ class PiconManager(Gtk.Box): # *********************** Filter **************************** # + def on_app_filter_toggled(self, app, value): + if app.page is Page.PICONS: + self._filter_button.set_active(not self._filter_button.get_active()) + def on_filter_toggled(self, button): - active = button.get_active() + active = self._filter_button.get_active() self._filter_bar.set_search_mode(active) if not active: self._picons_filter_entry.set_text("")