From 50739c687d9252ab7d5c851bf32a1fd056f6544d Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Tue, 5 Jan 2016 19:38:42 +0100 Subject: add cut-button and a cutlist-script and make both configurable --- voctogui/default-config.ini | 4 ++++ voctogui/lib/toolbar/misc.py | 12 ++++++++++-- voctogui/ui/voctogui.ui | 15 +++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) (limited to 'voctogui') diff --git a/voctogui/default-config.ini b/voctogui/default-config.ini index cfb7ae0..cfc422f 100644 --- a/voctogui/default-config.ini +++ b/voctogui/default-config.ini @@ -21,3 +21,7 @@ system=gl # Use simple X-Images - least performant #system=x + +[misc] +close=true +cut=true diff --git a/voctogui/lib/toolbar/misc.py b/voctogui/lib/toolbar/misc.py index 91ccf79..32dd96c 100644 --- a/voctogui/lib/toolbar/misc.py +++ b/voctogui/lib/toolbar/misc.py @@ -11,9 +11,17 @@ class MiscToolbarController(object): self.log = logging.getLogger('MiscToolbarController') closebtn = uibuilder.find_widget_recursive(drawing_area, 'close') + closebtn.set_visible( Config.getboolean('misc', 'close') ) + closebtn.connect('clicked', self.on_closebtn_clicked) - closebtn.connect('clicked', self.on_btn_clicked) + cutbtn = uibuilder.find_widget_recursive(drawing_area, 'cut') + cutbtn.set_visible( Config.getboolean('misc', 'cut') ) + cutbtn.connect('clicked', self.on_cutbtn_clicked) - def on_btn_clicked(self, btn): + def on_closebtn_clicked(self, btn): self.log.info('close-button clicked') Gtk.main_quit() + + def on_cutbtn_clicked(self, btn): + self.log.info('cut-button clicked') + Connection.send('message', 'cut') diff --git a/voctogui/ui/voctogui.ui b/voctogui/ui/voctogui.ui index 25bd711..fe04601 100644 --- a/voctogui/ui/voctogui.ui +++ b/voctogui/ui/voctogui.ui @@ -157,6 +157,21 @@ Close True gtk-close + True + + + False + True + + + + + True + False + Cut + True + gtk-cut + True False -- cgit v1.2.3