From bc8af43104aafa0869cfb869c9d7caf0acefb23c Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 15 Nov 2015 14:43:51 +0100 Subject: Implement a Button in the GUI to set a specific Source to Fullscreen, fixes #11 --- voctogui/lib/videopreviews.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'voctogui/lib') diff --git a/voctogui/lib/videopreviews.py b/voctogui/lib/videopreviews.py index 233b132..c4700d9 100644 --- a/voctogui/lib/videopreviews.py +++ b/voctogui/lib/videopreviews.py @@ -80,6 +80,11 @@ class VideoPreviewsController(object): key, mod = Gtk.accelerator_parse('%u' % (idx+1)) btn_b.add_accelerator('activate', accelerators, key, mod, Gtk.AccelFlags.VISIBLE) + btn_fullscreen = uibuilder.find_widget_recursive(preview, 'btn_fullscreen') + btn_fullscreen.set_name("%c %u" % ('f', idx)) + + btn_fullscreen.connect('clicked', self.btn_fullscreen_clicked) + self.preview_players[source] = player self.previews[source] = preview self.a_btns[source] = btn_a @@ -104,6 +109,16 @@ class VideoPreviewsController(object): self.log.info('video-channel %s changed to %s', channel, source_name) Connection.send('set_video_'+channel, source_name) + def btn_fullscreen_clicked(self, btn): + btn_name = btn.get_name() + self.log.debug('btn_fullscreen_clicked: %s', btn_name) + + channel, idx = btn_name.split(' ')[:2] + source_name = self.sources[int(idx)] + + self.log.info('selcting video %s for fullscreen', source_name) + Connection.send('set_videos_and_composite', source_name, '*', 'fullscreen') + def on_video_status(self, source_a, source_b): self.log.info('on_video_status callback w/ sources: %s and %s', source_a, source_b) -- cgit v1.2.3