small fix to set bouquet lock

This commit is contained in:
DYefremov
2023-02-16 16:29:08 +03:00
parent 18c1fa736b
commit 623e5a17f5
2 changed files with 7 additions and 5 deletions

View File

@@ -57,8 +57,9 @@ class BouquetsWriter:
def __init__(self, path, bouquets, force_bq_names=False, blacklist=None):
self._path = path
self._bouquets = bouquets
self._black_list = blacklist or set()
self._force_bq_names = force_bq_names
self._black_list = set() if blacklist is None else blacklist
self._marker_index = 1
self._space_index = 0
self._alt_names = set()
@@ -103,7 +104,7 @@ class BouquetsWriter:
locked = self._LOCKED.format(ServiceType.SERVICE, bq_type, bq_name, bqs.type)
self._black_list.add(locked) if bq.locked else self._black_list.discard(locked)
# Hiding.
s_type = 519 if bq.hidden else 7
s_type = ServiceType.HIDDEN if bq.hidden else ServiceType.BOUQUET
line.append(self._SERVICE.format(s_type, bq_type, bq_name, bqs.type))
with open(f"{self._path}bouquets.{bqs.type}", "w", encoding="utf-8", newline="\n") as file:

View File

@@ -2932,13 +2932,14 @@ class Application(Gtk.Application):
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(itr, 1 if flag is Flag.LOCK else 2, value)
if self._s_type is SettingsType.ENIGMA_2:
msg = "After uploading the changes you may need to completely reboot the receiver!"
self.show_info_message(f"{get_message('EXPERIMENTAL!')} {msg}", Gtk.MessageType.WARNING)
else:
if self._s_type is SettingsType.ENIGMA_2:
set_flags(flag, self._services_view, self._fav_view, self._services, self._blacklist)
self.show_info_message("After uploading the changes you may need to completely reboot the receiver!",
Gtk.MessageType.WARNING)
def on_model_changed(self, model, path=None, itr=None):
model_name = model.get_name()