summaryrefslogtreecommitdiff
path: root/voctogui/lib
diff options
context:
space:
mode:
authorMaZderMind <git@mazdermind.de>2015-07-01 22:12:53 +0200
committerMaZderMind <git@mazdermind.de>2015-07-01 22:12:53 +0200
commit16cfb8c85896d9b1d4ad9a0d92c28e8dcc1324ca (patch)
tree0df1002c7f15dbfee702eedccb2b864c85cbe605 /voctogui/lib
parenta0f71b884e86d4f07da57263ece50dd711fea641 (diff)
Implement Preview-Selection
Diffstat (limited to 'voctogui/lib')
-rw-r--r--voctogui/lib/ui.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/voctogui/lib/ui.py b/voctogui/lib/ui.py
index 3d7cda7..628b96c 100644
--- a/voctogui/lib/ui.py
+++ b/voctogui/lib/ui.py
@@ -89,6 +89,9 @@ class Ui(UiBuilder):
accelerators = Gtk.AccelGroup()
self.win.add_accel_group(accelerators)
+ group_a = None
+ group_b = None
+
for idx, source in enumerate(sources):
self.log.info('Initializing Video Preview %s', source)
@@ -104,6 +107,20 @@ class Ui(UiBuilder):
btn_a = self.find_widget_recursive(preview, 'btn_a')
btn_b = self.find_widget_recursive(preview, 'btn_b')
+ btn_a.set_name("%c %u" % ('a', idx))
+ btn_b.set_name("%c %u" % ('b', idx))
+
+ if not group_a:
+ group_a = btn_a
+ else:
+ btn_a.join_group(group_a)
+
+
+ if not group_b:
+ group_b = btn_b
+ else:
+ btn_b.join_group(group_b)
+
btn_a.connect('toggled', self.preview_btn_toggled)
btn_b.connect('toggled', self.preview_btn_toggled)
@@ -116,9 +133,11 @@ class Ui(UiBuilder):
self.preview_players[source] = player
self.previews[source] = preview
-
def preview_btn_toggled(self, btn):
- self.log.info('preview_btn_toggled')
+ if not btn.get_active():
+ return
+
+ self.log.info('preview_btn_toggled: %s', btn.get_name())
def configure_audio_selector(self):
self.log.info('Initializing Audio Selector')