summaryrefslogtreecommitdiff
path: root/voctogui/lib/toolbar/misc.py
blob: 32dd96cd7a5f329e7ef57d348d067b783943c43c (plain)
  1. import logging
  2. from gi.repository import Gtk
  3. from lib.config import Config
  4. import lib.connection as Connection
  5. class MiscToolbarController(object):
  6. """ Manages Accelerators and Clicks Misc buttons """
  7. def __init__(self, drawing_area, win, uibuilder):
  8. self.log = logging.getLogger('MiscToolbarController')
  9. closebtn = uibuilder.find_widget_recursive(drawing_area, 'close')
  10. closebtn.set_visible( Config.getboolean('misc', 'close') )
  11. closebtn.connect('clicked', self.on_closebtn_clicked)
  12. cutbtn = uibuilder.find_widget_recursive(drawing_area, 'cut')
  13. cutbtn.set_visible( Config.getboolean('misc', 'cut') )
  14. cutbtn.connect('clicked', self.on_cutbtn_clicked)
  15. def on_closebtn_clicked(self, btn):
  16. self.log.info('close-button clicked')
  17. Gtk.main_quit()
  18. def on_cutbtn_clicked(self, btn):
  19. self.log.info('cut-button clicked')
  20. Connection.send('message', 'cut')