aboutsummaryrefslogtreecommitdiff
path: root/voctogui/lib
diff options
context:
space:
mode:
authorJoel Addison <joel@addison.net.au>2016-02-03 11:38:46 +1100
committerMaZderMind <git@mazdermind.de>2016-02-03 09:29:45 +0100
commit140d4651afcdbf72a4b2637acd0c71925816eb82 (patch)
tree949cdcb7bd2c9566c48a8ffac9b622090be0b527 /voctogui/lib
parent9b78b31e90e7e7341a8d253aaffa44e480597ec4 (diff)
Add keyboard shortcut to Cut button
Use `t` to perform cut in video, as with dvswitch.
Diffstat (limited to 'voctogui/lib')
-rw-r--r--voctogui/lib/toolbar/misc.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/voctogui/lib/toolbar/misc.py b/voctogui/lib/toolbar/misc.py
index 32dd96c..9528b67 100644
--- a/voctogui/lib/toolbar/misc.py
+++ b/voctogui/lib/toolbar/misc.py
@@ -4,12 +4,17 @@ from gi.repository import Gtk
from lib.config import Config
import lib.connection as Connection
+
class MiscToolbarController(object):
""" Manages Accelerators and Clicks Misc buttons """
def __init__(self, drawing_area, win, uibuilder):
self.log = logging.getLogger('MiscToolbarController')
+ # Accelerators
+ accelerators = Gtk.AccelGroup()
+ win.add_accel_group(accelerators)
+
closebtn = uibuilder.find_widget_recursive(drawing_area, 'close')
closebtn.set_visible( Config.getboolean('misc', 'close') )
closebtn.connect('clicked', self.on_closebtn_clicked)
@@ -18,6 +23,9 @@ class MiscToolbarController(object):
cutbtn.set_visible( Config.getboolean('misc', 'cut') )
cutbtn.connect('clicked', self.on_cutbtn_clicked)
+ key, mod = Gtk.accelerator_parse('t')
+ cutbtn.add_accelerator('clicked', accelerators, key, mod, Gtk.AccelFlags.VISIBLE)
+
def on_closebtn_clicked(self, btn):
self.log.info('close-button clicked')
Gtk.main_quit()