Exemplo n.º 1
0
	def on_btModeshift_clicked(self, *a):
		""" Convert current action into modeshift and send it to ModeshiftEditor """
		e = ModeshiftEditor(self.app, self.ac_callback)
		action = ModeModifier(self.generate_modifiers(self._action, self._selected_component.NAME=="custom"))
		e.set_input(self.id, action, mode=self._mode)
		self.close()
		e.show(self.get_transient_for())
Exemplo n.º 2
0
	def _choose_editor(self, action, cb):
		if isinstance(action, ModeModifier):
			from scc.gui.modeshift_editor import ModeshiftEditor	# Cannot be imported @ top
			e = ModeshiftEditor(self.app, cb)
			e.set_title(_("Edit Action"))
		else:
			from scc.gui.action_editor import ActionEditor	# Cannot be imported @ top
			e = ActionEditor(self.app, cb)
			e.set_title(_("Edit Action"))
			e.hide_macro()
			e.hide_ring()
		return e
Exemplo n.º 3
0
	def choose_editor(self, action, title, id=None):
		""" Chooses apropripate Editor instance for edited action """
		if isinstance(action, SensitivityModifier):
			action = action.action
		if isinstance(action, FeedbackModifier):
			action = action.action
		if id in GYROS:
			e = ActionEditor(self.app, self.on_action_chosen)
			e.set_title(title)
		elif isinstance(action, (ModeModifier, DoubleclickModifier, HoldModifier)) and not is_gyro_enable(action):
			e = ModeshiftEditor(self.app, self.on_action_chosen)
			e.set_title(_("Mode Shift for %s") % (title,))
		elif RingEditor.is_ring_action(action):
			e = RingEditor(self.app, self.on_action_chosen)
			e.set_title(title)
		elif isinstance(action, Type):
			# Type is subclass of Macro
			e = ActionEditor(self.app, self.on_action_chosen)
			e.set_title(title)
		elif isinstance(action, Macro) and not is_button_togle(action):
			e = MacroEditor(self.app, self.on_action_chosen)
			e.set_title(_("Macro for %s") % (title,))
		else:
			e = ActionEditor(self.app, self.on_action_chosen)
			e.set_title(title)
		return e
Exemplo n.º 4
0
	def _choose_editor(self, action, title):
		if isinstance(action, SensitivityModifier):
			action = action.action
		if isinstance(action, ModeModifier) and not is_gyro_enable(action):
			e = ModeshiftEditor(self, self.on_action_chosen)
			e.set_title(_("Mode Shift for %s") % (title,))
		elif isinstance(action, Macro):
			e = MacroEditor(self, self.on_action_chosen)
			e.set_title(_("Macro for %s") % (title,))
		else:
			e = ActionEditor(self, self.on_action_chosen)
			e.set_title(title)
		return e
Exemplo n.º 5
0
	def on_btModeshift_clicked(self, *a):
		""" Convert current action into modeshift and send it to ModeshiftEditor """
		e = ModeshiftEditor(self.app, self.ac_callback)
		action = ModeModifier(self.generate_modifiers(self._action, self._selected_component.NAME=="custom"))
		e.set_input(self.id, action, mode=self._mode)
		self.close()
		e.show(self.get_transient_for())
Exemplo n.º 6
0
 def _choose_editor(self, action, cb):
     if isinstance(action, ModeModifier):
         from scc.gui.modeshift_editor import ModeshiftEditor  # Cannot be imported @ top
         e = ModeshiftEditor(self.app, cb)
         e.set_title(_("Edit Action"))
     else:
         from scc.gui.action_editor import ActionEditor  # Cannot be imported @ top
         e = ActionEditor(self.app, cb)
         e.set_title(_("Edit Action"))
         e.hide_macro()
         e.hide_ring()
     return e
Exemplo n.º 7
0
	def choose_editor(self, action, title):
		""" Chooses apropripate Editor instance for edited action """
		if isinstance(action, SensitivityModifier):
			action = action.action
		if isinstance(action, (ModeModifier, DoubleclickModifier, HoldModifier)) and not is_gyro_enable(action):
			e = ModeshiftEditor(self.app, self.on_action_chosen)
			e.set_title(_("Mode Shift for %s") % (title,))
		elif isinstance(action, Type):
			# Type is subclass of Macro
			e = ActionEditor(self.app, self.on_action_chosen)
			e.set_title(title)
		elif isinstance(action, Macro):
			e = MacroEditor(self.app, self.on_action_chosen)
			e.set_title(_("Macro for %s") % (title,))
		else:
			e = ActionEditor(self.app, self.on_action_chosen)
			e.set_title(title)
		return e