From 1113fec26ed212afd6ee3557384a0e742b42ab69 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Thu, 7 Jan 2021 10:51:41 +0300 Subject: [PATCH] added separate column for picon to fav list --- app/ui/main_app_window.py | 16 +- app/ui/main_window.glade | 609 ++++++++++++++++++++------------------ 2 files changed, 331 insertions(+), 294 deletions(-) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 3ba6574d..24627005 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -1017,9 +1017,10 @@ class Application(Gtk.Application): """ rows = self._fav_model if len(paths) < 2 else [self._fav_model[p] for p in paths] index = int(str(rows[0].path)) + columns = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] for s_row, row in zip(sorted(map(lambda r: r[:], rows), key=lambda r: r[c_num] or nv, reverse=rev), rows): - self._fav_model.set_row(row.iter, s_row) + self._fav_model.set(row.iter, columns, s_row) bq[index] = s_row[Column.FAV_ID] index += 1 @@ -1817,7 +1818,8 @@ class Application(Gtk.Application): for index, s in enumerate(srv[-1] or [], start=1): srv = self._services.get(s.data, None) if srv: - self._alt_model.append((index, srv.service, srv.service_type, srv.pos)) + picon = self._picons.get(srv.picon_id, None) + self._alt_model.append((index, picon, srv.service, srv.service_type, srv.pos)) self._alt_revealer.set_visible(True) else: self._alt_revealer.set_visible(False) @@ -1890,9 +1892,17 @@ class Application(Gtk.Application): if not is_marker: num += 1 + picon = self._picons.get(srv.picon_id, None) + # Alternatives + if srv.service_type == BqServiceType.ALT.name: + alt_servs = srv.transponder + if alt_servs: + alt_srv = self._services.get(alt_servs[0].data, None) + picon = self._picons.get(alt_srv.picon_id, None) if srv else None + self._fav_model.append((0 if is_marker else num, srv.coded, ex_srv_name if ex_srv_name else srv.service, srv.locked, srv.hide, srv_type, srv.pos, srv.fav_id, - self._picons.get(srv.picon_id, None), None, background)) + picon, None, background)) yield True self._fav_view.set_model(self._fav_model) diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index 46390a2e..b85d3a06 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -37,6 +37,8 @@ Author: Dmitriy Yefremov + + @@ -2410,320 +2412,345 @@ Author: Dmitriy Yefremov + True + False + 2 + vertical + 2 + + True False - 2 - vertical - 2 + in - + True - False - in + True + fav_list_store + False + 2 + True + both + 9 + True + + + + + + + + + + + + + + + multiple + + - - True - True - fav_list_store - False - 2 - True - both - 9 - True - - - - - - - - - - - - - - - multiple + + True + 25 + Num + True + 0.5 + + + + 0.49000000953674316 + 5 + 5 + + 10 + 0 + 0 + + + + + + + 25 + Picon + 0.5 + + + 2 + + + 10 + 8 + + + + + + + True + 50 + Service + True + True + 0.5 + + + + 2 + + + 10 + 1 + - - True - 25 - Num - True - 0.5 - - - - 0.20000000298023224 - 5 - 5 - - - 10 - 0 - 0 - - + + end + 25 + + 10 + 2 + - - True - 50 - Service - True - True - 0.5 - - - - 2 - - - 10 - 8 - - - - - 2 - - - 10 - 1 - - - - - end - 25 - - - 10 - 2 - - - - - 2 - - - 10 - 3 - - - - - 2 - - - 10 - 4 - - + + 2 + + 10 + 3 + - - True - 25 - Type - True - True - 0.5 - - - - 0.50999999046325684 - - - 10 - 5 - - + + 2 + + 10 + 4 + + + + + + + True + 25 + Type + True + True + 0.5 + + + + 0.50999999046325684 + + + 10 + 5 + + + + + + + 25 + Pos + True + True + 0.5 + + + + 0.50999999046325684 + + + 10 + 6 + + + + + + + False + fav_id + + + + 7 + + + + + + + False + extra + + + + 9 + - - 25 - Pos - True - True - 0.5 - - - - 0.50999999046325684 - - - 10 - 6 - - - - - - - False - fav_id - - - - 7 - - - - - - - False - extra - - - - 9 - - - - - - + - - True - True - 0 - - - - - False - slide-up - - - 200 - True - False - vertical - 2 - - - True - False - Alternatives - - - - - - False - True - 0 - - - - - True - True - in - - - True - True - alt_list_store - False - 0 - - - - - - 25 - Num - 0.5 - - - 5 - 5 - - - 0 - - - - - - - True - 50 - Service - True - 0.5 - - - - 1 - - - - - - - True - Type - True - 0.5 - - - 0.50999999046325684 - - - 2 - - - - - - - 25 - Pos - 0.5 - - - 0.50999999046325684 - - - 3 - - - - - - - - - True - True - 1 - - - - - - - False - True - 1 - + + True + True + 0 + + + + + False + slide-up + + + 200 + True + False + vertical + 2 + + + True + False + Alternatives + + + + + + False + True + 0 + + + + + True + True + in + + + True + True + alt_list_store + False + both + + + + + + 25 + Num + 0.5 + + + 0.49000000953674316 + 5 + 5 + + + 0 + + + + + + + 25 + Picon + 0.5 + + + 2 + + + 1 + + + + + + + True + 50 + Service + True + 0.5 + + + 0.10000000149011612 + + + 2 + + + + + + + True + Type + True + 0.5 + + + 0.50999999046325684 + + + 3 + + + + + + + 25 + Pos + 0.5 + + + 0.50999999046325684 + + + 4 + + + + + + + + + True + True + 1 + + + + + + + False + True + 1 + + + True True