def __init__(self, controller): AddonsBase.__init__(self, controller) if self.cfg.getboolean("main", "startCam") and self.cfg.get("main", "algorithm") == "forehead": self.button = Gtk.Button(_("Recalc Point")) self.button.connect("clicked", self.recalc) self.button.show() self.add_item(self.button) debug.debug("addon.recalc", "Recalc Addon started")
def __init__(self, controller): AddonsBase.__init__(self, controller) if self.cfg.getboolean("main", "startCam") and \ self.cfg.get("main", "algorithm") == "forehead": self.button = gtk.Button(_("Recalc Point")) self.button.connect("clicked", self.recalc) self.button.show() self.add_item(self.button) debug.debug("addon.recalc", "Recalc Addon started")
def load_addons(self): """ Loads the enabled addons Arguments: - self: The main object pointer. """ for add in self.cfg.getList("main", "addon"): tmp = __import__("mousetrap.app.addons.%s" % add, globals(), locals(), ['']) setattr(self, add, tmp.Addon(self.ctr)) debug.debug("ui.main", "Addons loaded")
def load_addons(self): """ Loads the enabled addons Arguments: - self: The main object pointer. """ for add in self.cfg.getList("main", "addon"): tmp = __import__("mousetrap.app.addons.%s" % add, globals(), locals(),['']) setattr(self, add, tmp.Addon(self.ctr)) debug.debug("ui.main", "Addons loaded")
def __init__(self, controller): AddonsBase.__init__(self, controller) gobject.timeout_add(1000, self.check_cpu) debug.debug("addon.cpu", "CPU addon started")
def build_interface(self): """ Builds the interface Arguments: - self: The main object pointer """ self.setWindowsIcon() accelGroup = gtk.AccelGroup() self.add_accel_group(accelGroup) self.accelGroup = accelGroup self.set_title("MouseTrap") self.connect("destroy", self.close) self.setWindowsIcon() self.vBox = gtk.VBox() self.buttonsBox = gtk.HButtonBox() #self.buttonsBox = gtk.HBox(False,0) self.prefButton = gtk.Button(stock=gtk.STOCK_PREFERENCES) self.prefButton.connect("clicked", self._show_settings_gui) self.buttonsBox.pack_start(self.prefButton, True, True) self.closeButton = gtk.Button(stock=gtk.STOCK_QUIT) self.closeButton.connect("clicked", self.close) self.buttonsBox.pack_start(self.closeButton, True, True) self.helpButton = gtk.Button(stock=gtk.STOCK_HELP) self.helpButton.connect("clicked", self._loadHelp) self.buttonsBox.pack_start(self.helpButton, True, True) self.vBox.pack_start(self.buttonsBox, False, False) self.adds_vbox = gtk.VBox() self.adds_vbox.show_all() self.vBox.pack_start(self.adds_vbox, False, False) self.cap_image = gtk.Image() if self.cfg.getboolean("gui", "showCapture"): self.cap_expander = gtk.expander_new_with_mnemonic("_Camera Image") self.cap_expander.add(self.cap_image) self.cap_expander.set_expanded(True) #expander.connect('notify::expanded', self.expanded_cb) self.vBox.pack_start(self.cap_expander) if self.cfg.getboolean("gui", "showPointMapper"): self.map_expander = gtk.expander_new_with_mnemonic( "_Script Mapper") self.map_expander.add(self.script) self.map_expander.set_expanded(True) #expander.connect('notify::expanded', self.expanded_cb) self.vBox.pack_start(self.map_expander) # # flipButton = gtk.Button( _("Flip Image") ) # flipButton.connect("clicked", self.recalcPoint, "flip" ) # hBox.pack_start( flipButton, False, False ) # # recalcButton = gtk.Button( _("Recalc Point") ) # recalcButton.connect("clicked", self.recalcPoint ) # hBox.pack_start( recalcButton, False, False ) # # self.vBox.pack_end(hBox, False, False ) # # self.buttonsBox.show_all() self.statusbar = gtk.Statusbar() self.statusbar_id = self.statusbar.get_context_id("statusbar") self.vBox.pack_start(self.statusbar, True, True) self.vBox.show_all() self.add(self.vBox) self.show() debug.debug("ui.main", "Interface Built")
def build_interface( self ): """ Builds the interface Arguments: - self: The main object pointer """ self.setWindowsIcon() accelGroup = gtk.AccelGroup() self.add_accel_group( accelGroup ) self.accelGroup = accelGroup self.set_title( "MouseTrap" ) self.connect( "destroy", self.close) self.setWindowsIcon() self.vBox = gtk.VBox() self.buttonsBox = gtk.HButtonBox() #self.buttonsBox = gtk.HBox(False,0) self.prefButton = gtk.Button(stock=gtk.STOCK_PREFERENCES) self.prefButton.connect("clicked", self._show_settings_gui) self.buttonsBox.pack_start( self.prefButton, True, True ) self.closeButton = gtk.Button(stock=gtk.STOCK_QUIT) self.closeButton.connect("clicked", self.close) self.buttonsBox.pack_start( self.closeButton, True, True ) self.helpButton = gtk.Button(stock=gtk.STOCK_HELP) self.helpButton.connect("clicked", self._loadHelp) self.buttonsBox.pack_start( self.helpButton, True, True ) self.vBox.pack_start( self.buttonsBox, False, False ) self.adds_vbox = gtk.VBox() self.adds_vbox.show_all() self.vBox.pack_start( self.adds_vbox, False, False ) self.cap_image = gtk.Image() if self.cfg.getboolean("gui", "showCapture"): self.cap_expander = gtk.expander_new_with_mnemonic("_Camera Image") self.cap_expander.add(self.cap_image) self.cap_expander.set_expanded(True) #expander.connect('notify::expanded', self.expanded_cb) self.vBox.pack_start(self.cap_expander) if self.cfg.getboolean("gui", "showPointMapper"): self.map_expander = gtk.expander_new_with_mnemonic("_Script Mapper") self.map_expander.add(self.script) self.map_expander.set_expanded(True) #expander.connect('notify::expanded', self.expanded_cb) self.vBox.pack_start(self.map_expander) # # flipButton = gtk.Button( _("Flip Image") ) # flipButton.connect("clicked", self.recalcPoint, "flip" ) # hBox.pack_start( flipButton, False, False ) # # recalcButton = gtk.Button( _("Recalc Point") ) # recalcButton.connect("clicked", self.recalcPoint ) # hBox.pack_start( recalcButton, False, False ) # # self.vBox.pack_end(hBox, False, False ) # # self.buttonsBox.show_all() self.statusbar = gtk.Statusbar() self.statusbar_id = self.statusbar.get_context_id("statusbar") self.vBox.pack_start(self.statusbar, True, True) self.vBox.show_all() self.add(self.vBox) self.show() debug.debug("ui.main", "Interface Built")
def __init__(self, controller): super(Addon, self).__init__(controller) GObject.timeout_add(1000, self.check_cpu) debug.debug("addon.cpu", "CPU addon started")