Esempio n. 1
0
 def ask_key(self, finish_callback):
     keystr = getkey_dialog.ask_for_key(try_bind_key,
                                        screen=self.screen,
                                        show_clear=False)
     if keystr:
         Triggers.add_trigger(self.leaf, keystr)
     finish_callback(self)
Esempio n. 2
0
	def on_buttonkeybinding_clicked(self, widget):
		keystr = getkey_dialog.ask_for_key(keybindings.bind_key)
		if keystr:
			self.entrykeybinding.set_text(keystr)
			self.output_debug("Try set keybinding with", keystr)
			succ = keybindings.bind_key(keystr)
			setctl = settings.GetSettingsController()
			setctl.set_keybinding(keystr)
Esempio n. 3
0
 def on_buttonkeybinding_clicked(self, widget):
     keystr = getkey_dialog.ask_for_key(keybindings.bind_key,
                                        screen=widget.get_screen())
     if keystr:
         self.entrykeybinding.set_text(keystr)
         self.output_debug("Try set keybinding with", keystr)
         keybindings.bind_key(keystr)
         setctl = settings.GetSettingsController()
         setctl.set_keybinding(keystr)
Esempio n. 4
0
	def on_gkeybindings_row_activate(self, treeview, path, view_column):
		it = self.gkeybind_store.get_iter(path)
		keybind_id = self.gkeybind_store.get_value(it, 2)
		setctl = settings.GetSettingsController()
		curr_key = setctl.get_accelerator(keybind_id)
		keystr = getkey_dialog.ask_for_key(self._is_good_keystr,
				previous_key=curr_key)
		if keystr is not None:
			setctl.set_accelerator(keybind_id, keystr)
			label = gtk.accelerator_get_label(*gtk.accelerator_parse(keystr))
			self.gkeybind_store.set_value(it, 1, label)
Esempio n. 5
0
 def on_gkeybindings_row_activate(self, treeview, path, view_column):
     it = self.gkeybind_store.get_iter(path)
     keybind_id = self.gkeybind_store.get_value(it, 2)
     setctl = settings.GetSettingsController()
     curr_key = setctl.get_accelerator(keybind_id)
     keystr = getkey_dialog.ask_for_key(self._is_good_keystr,
                                        previous_key=curr_key,
                                        screen=treeview.get_screen())
     if keystr is not None:
         setctl.set_accelerator(keybind_id, keystr)
         label = gtk.accelerator_get_label(*gtk.accelerator_parse(keystr))
         self.gkeybind_store.set_value(it, 1, label)
Esempio n. 6
0
	def on_keybindings_row_activate(self, treeview, path, view_column):
		def bind_key_func(target):
			def bind_key(keystr):
				return keybindings.bind_key(keystr, target)
			return bind_key

		it = self.keybind_store.get_iter(path)
		keybind_id = self.keybind_store.get_value(it, 2)
		setctl = settings.GetSettingsController()
		curr_key = setctl.get_global_keybinding(keybind_id)
		bind_func = bind_key_func(self.KEYBINDING_TARGETS[keybind_id])
		keystr = getkey_dialog.ask_for_key(bind_func, curr_key)
		if keystr == '':
			keybindings.bind_key(None, self.KEYBINDING_TARGETS[keybind_id])
			setctl.set_global_keybinding(keybind_id, keystr)
			self.keybind_store.set_value(it, 1, '')
		elif keystr is not None:
			setctl.set_global_keybinding(keybind_id, keystr)
			label = gtk.accelerator_get_label(*gtk.accelerator_parse(keystr))
			self.keybind_store.set_value(it, 1, label)
Esempio n. 7
0
    def on_keybindings_row_activate(self, treeview, path, view_column):
        def bind_key_func(target):
            def bind_key(keystr):
                return keybindings.bind_key(keystr, target)

            return bind_key

        it = self.keybind_store.get_iter(path)
        keybind_id = self.keybind_store.get_value(it, 2)
        setctl = settings.GetSettingsController()
        curr_key = setctl.get_global_keybinding(keybind_id)
        bind_func = bind_key_func(self.KEYBINDING_TARGETS[keybind_id])
        keystr = getkey_dialog.ask_for_key(bind_func,
                                           curr_key,
                                           screen=treeview.get_screen())
        if keystr == '':
            keybindings.bind_key(None, self.KEYBINDING_TARGETS[keybind_id])
            setctl.set_global_keybinding(keybind_id, keystr)
            self.keybind_store.set_value(it, 1, '')
        elif keystr is not None:
            setctl.set_global_keybinding(keybind_id, keystr)
            label = gtk.accelerator_get_label(*gtk.accelerator_parse(keystr))
            self.keybind_store.set_value(it, 1, label)
Esempio n. 8
0
	def ask_key(self, finish_callback):
		keystr = getkey_dialog.ask_for_key(try_bind_key)
		if keystr:
			Triggers.add_trigger(self.leaf, keystr)
		finish_callback(self)