screen: simplify panel subscription add-remove
This commit is contained in:
parent
0bfbe90dcd
commit
f80c2687c5
13
screen.py
13
screen.py
@ -589,17 +589,12 @@ class KlipperScreen(Gtk.Window):
|
|||||||
self._remove_current_panel()
|
self._remove_current_panel()
|
||||||
|
|
||||||
def add_subscription(self, panel_name):
|
def add_subscription(self, panel_name):
|
||||||
for sub in self.subscriptions:
|
if panel_name not in self.subscriptions:
|
||||||
if sub == panel_name:
|
self.subscriptions.append(panel_name)
|
||||||
return
|
|
||||||
|
|
||||||
self.subscriptions.append(panel_name)
|
|
||||||
|
|
||||||
def remove_subscription(self, panel_name):
|
def remove_subscription(self, panel_name):
|
||||||
for i in range(len(self.subscriptions)):
|
if panel_name in self.subscriptions:
|
||||||
if self.subscriptions[i] == panel_name:
|
self.subscriptions.remove(panel_name)
|
||||||
self.subscriptions.pop(i)
|
|
||||||
return
|
|
||||||
|
|
||||||
def reset_screensaver_timeout(self, *args):
|
def reset_screensaver_timeout(self, *args):
|
||||||
if self.screensaver_timeout is not None:
|
if self.screensaver_timeout is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user