diff options
-rw-r--r-- | voctogui/lib/toolbar/misc.py | 19 | ||||
-rw-r--r-- | voctogui/lib/ui.py | 5 | ||||
-rw-r--r-- | voctogui/ui/voctogui.ui | 23 |
3 files changed, 47 insertions, 0 deletions
diff --git a/voctogui/lib/toolbar/misc.py b/voctogui/lib/toolbar/misc.py new file mode 100644 index 0000000..91ccf79 --- /dev/null +++ b/voctogui/lib/toolbar/misc.py @@ -0,0 +1,19 @@ +import logging +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') + + closebtn = uibuilder.find_widget_recursive(drawing_area, 'close') + + closebtn.connect('clicked', self.on_btn_clicked) + + def on_btn_clicked(self, btn): + self.log.info('close-button clicked') + Gtk.main_quit() diff --git a/voctogui/lib/ui.py b/voctogui/lib/ui.py index 68355df..51c913e 100644 --- a/voctogui/lib/ui.py +++ b/voctogui/lib/ui.py @@ -14,6 +14,7 @@ from lib.audioselector import AudioSelectorController from lib.toolbar.composition import CompositionToolbarController from lib.toolbar.streamblank import StreamblankToolbarController +from lib.toolbar.misc import MiscToolbarController class Ui(UiBuilder): def __init__(self, uifile): @@ -71,6 +72,10 @@ class Ui(UiBuilder): uibuilder=self, warning_overlay=self.video_warning_overlay) + self.misc_controller = MiscToolbarController(toolbar, + win=self.win, + uibuilder=self) + def show(self): self.log.info('Showing Main-Window') diff --git a/voctogui/ui/voctogui.ui b/voctogui/ui/voctogui.ui index 5586081..25bd711 100644 --- a/voctogui/ui/voctogui.ui +++ b/voctogui/ui/voctogui.ui @@ -140,6 +140,29 @@ <property name="homogeneous">True</property> </packing> </child> + <child> + <object class="GtkSeparatorToolItem" id="s2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="close"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Close</property> + <property name="use_underline">True</property> + <property name="stock_id">gtk-close</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> |