From a1098750da350d9e95a2a49696086fb5884b2a69 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sun, 12 Jan 2020 00:33:33 +0300 Subject: [PATCH] fix data loading if pixbuf error --- app/ui/main_app_window.py | 3 +++ app/ui/main_helper.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 24280b46..461d4e00 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -873,6 +873,7 @@ class Application(Gtk.Application): GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_DEFAULT_IDLE) def update_data(self, data_path, callback=None): + self._profile_combo_box.set_sensitive(False) self._wait_dialog.show() yield True @@ -904,6 +905,7 @@ class Application(Gtk.Application): yield from self.append_data(bouquets, services) finally: self._wait_dialog.hide() + self._profile_combo_box.set_sensitive(True) if callback: callback() yield True @@ -1019,6 +1021,7 @@ class Application(Gtk.Application): self._blacklist.clear() self._services.clear() self._rows_buffer.clear() + self._picons.clear() self._bouquets.clear() self._extra_bouquets.clear() self._current_bq_name = None diff --git a/app/ui/main_helper.py b/app/ui/main_helper.py index 39226f8d..a7ca724e 100644 --- a/app/ui/main_helper.py +++ b/app/ui/main_helper.py @@ -10,8 +10,8 @@ from app.eparser import Service from app.eparser.ecommons import Flag, BouquetService, Bouquet, BqType from app.eparser.enigma.bouquets import BqServiceType, to_bouquet_id from app.settings import SettingsType -from .uicommons import ViewTarget, BqGenType, Gtk, Gdk, HIDE_ICON, LOCKED_ICON, KeyboardKey, Column from .dialogs import show_dialog, DialogType, get_chooser_dialog, WaitDialog +from .uicommons import ViewTarget, BqGenType, Gtk, Gdk, HIDE_ICON, LOCKED_ICON, KeyboardKey, Column # ***************** Markers *******************# @@ -347,7 +347,9 @@ def update_picons_data(path, picons): return for file in os.listdir(path): - picons[file] = get_picon_pixbuf(path + file) + pf = get_picon_pixbuf(path + file) + if pf: + picons[file] = pf def append_picons(picons, model): @@ -487,7 +489,10 @@ def is_only_one_item_selected(paths, transient): def get_picon_pixbuf(path): - return GdkPixbuf.Pixbuf.new_from_file_at_scale(filename=path, width=32, height=32, preserve_aspect_ratio=True) + try: + return GdkPixbuf.Pixbuf.new_from_file_at_scale(filename=path, width=32, height=32, preserve_aspect_ratio=True) + except GLib.GError as e: + pass # ***************** Bouquets *********************#