diff options
author | MaZderMind <git@mazdermind.de> | 2015-10-06 00:06:21 +0200 |
---|---|---|
committer | MaZderMind <git@mazdermind.de> | 2015-10-06 00:06:21 +0200 |
commit | 8e58e2c810c3b1417575a9f13207558555adc582 (patch) | |
tree | 1e096a28b7769033a88b34d6f457635e3e2ac809 /voctogui/lib | |
parent | 43df3e8936ee54282321a6cd9a881265e1f1f525 (diff) |
configure stream-blanker toolbar according to server's config
Diffstat (limited to 'voctogui/lib')
-rw-r--r-- | voctogui/lib/toolbar/streamblank.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/voctogui/lib/toolbar/streamblank.py b/voctogui/lib/toolbar/streamblank.py index e1963c2..05a7018 100644 --- a/voctogui/lib/toolbar/streamblank.py +++ b/voctogui/lib/toolbar/streamblank.py @@ -1,6 +1,7 @@ import logging from gi.repository import Gtk +from lib.config import Config import lib.connection as Connection class StreamblankToolbarController(object): @@ -11,14 +12,23 @@ class StreamblankToolbarController(object): self.warning_overlay = warning_overlay - blank_sources = ['pause', 'nostream'] - self.status_btns = {} - livebtn = uibuilder.find_widget_recursive(drawing_area, 'stream_live') blankbtn = uibuilder.find_widget_recursive(drawing_area, 'stream_blank') blankbtn_pos = drawing_area.get_item_index(blankbtn) + if not Config.getboolean('stream-blanker', 'enabled'): + self.log.info('disabling stream-blanker features because the server does not support them: %s', Config.getboolean('stream-blanker', 'enabled')) + stream_blank_separator = uibuilder.find_widget_recursive(drawing_area, 'stream_blank_separator') + + drawing_area.remove(livebtn) + drawing_area.remove(blankbtn) + drawing_area.remove(stream_blank_separator) + return + + blank_sources = Config.getlist('stream-blanker', 'sources') + self.status_btns = {} + livebtn.connect('toggled', self.on_btn_toggled) livebtn.set_name('live') |