Exemplo n.º 1
0
 def bind_key(cls):
     Keybinder.init()
     shortcut = MetaData.get_snapshoot_shortcut()
     if Keybinder.bind(shortcut, cls.callback, ""):
         if cls.old_key_shortcut is not None:
             Keybinder.unbind(cls.old_key_shortcut)
         cls.old_key_shortcut = shortcut
     else:
         logging.error("Bind shortcut key failed ")
Exemplo n.º 2
0
 def bind_key(cls):
     Keybinder.init()
     shortcut = MetaData.get_snapshoot_shortcut()
     if Keybinder.bind(shortcut,cls.callback,""):
         if cls.old_key_shortcut is not None:
             Keybinder.unbind(cls.old_key_shortcut)
         cls.old_key_shortcut = shortcut
     else:
         logging.error("Bind shortcut key failed ")
Exemplo n.º 3
0
 def on_shortcut_entry_changed(self, widget):
     text = widget.get_text().upper()
     widget.set_text(text)
     if (text >= 'A' and text <= 'Z') or (text >= '0' and text <= '9'):
         widget.modify_fg(Gtk.StateFlags.NORMAL, None)
         MetaData.set_snapshoot_shortcut_value(text)
         logging.debug(MetaData.get_snapshoot_shortcut())
         SettingDialog.KeyBinder.bind_key()
     else:
         COLOR_INVALID = Color(50000, 0, 0)
         widget.modify_fg(Gtk.StateFlags.NORMAL, COLOR_INVALID)
Exemplo n.º 4
0
 def on_shortcut_entry_changed(self, widget):
     text = widget.get_text().upper()
     widget.set_text(text)
     if (text >= 'A' and text <= 'Z') or (text >= '0' and text <= '9'):
         widget.modify_fg(Gtk.StateFlags.NORMAL, None)
         MetaData.set_snapshoot_shortcut_value(text)
         logging.debug(MetaData.get_snapshoot_shortcut())
         SettingDialog.KeyBinder.bind_key()
     else:
         COLOR_INVALID = Color(50000, 0, 0) 
         widget.modify_fg(Gtk.StateFlags.NORMAL, COLOR_INVALID)
Exemplo n.º 5
0
 def on_alt_check_toggled(self, checker):
     checked = checker.get_active()
     MetaData.set_snapshoot_shortcut_alt_modifier(checked)
     logging.debug(MetaData.get_snapshoot_shortcut())
     SettingDialog.KeyBinder.bind_key()
Exemplo n.º 6
0
 def on_alt_check_toggled(self, checker):
     checked = checker.get_active()
     MetaData.set_snapshoot_shortcut_alt_modifier(checked)
     logging.debug(MetaData.get_snapshoot_shortcut())
     SettingDialog.KeyBinder.bind_key()