aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--voctogui/lib/toolbar/streamblank.py16
-rw-r--r--voctogui/ui/voctogui.ui2
2 files changed, 14 insertions, 4 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')
diff --git a/voctogui/ui/voctogui.ui b/voctogui/ui/voctogui.ui
index 1eb64cc..5e668e9 100644
--- a/voctogui/ui/voctogui.ui
+++ b/voctogui/ui/voctogui.ui
@@ -141,7 +141,7 @@
</packing>
</child>
<child>
- <object class="GtkSeparatorToolItem" id="s2">
+ <object class="GtkSeparatorToolItem" id="stream_blank_separator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>