def on_link(self, link):
		parser = GuiActionParser()
		if link.startswith("quick://"):
			action = parser.restart(link[8:]).parse()
			self.reset_active_component()
			self.set_action(action, from_custom=True)
		elif link == "grab://trigger_button":
			def cb(action):
				action = TriggerAction(254, 255, action)
				self.set_action(action, from_custom=True)
				self.force_page("trigger")
			b = SimpleChooser(self.app, "buttons", cb)
			b.set_title(_("Select Button"))
			b.hide_axes()
			b.show(self.window)
		elif link.startswith("page://"):
			def cb():
				self.force_page(link[7:])
			GLib.timeout_add(0.1, cb)
		elif link.startswith("advanced://"):
			exMore = self.builder.get_object("exMore")
			rvMore = self.builder.get_object("rvMore")
			ntbMore = self.builder.get_object("ntbMore")
			assert exMore.get_visible()
			exMore.set_expanded(True)
			rvMore.set_reveal_child(True)
			if "#" in link:
				link, name = link.split("#")
				self.blink_widget(name)
			ntbMore.set_current_page(int(link.split("/")[-1]))
		else:
			log.warning("Activated unknown link: %s", link)
Esempio n. 2
0
    def on_lblMarkup_activate_link(self, trash, link):
        if link.startswith("quick://"):
            action = self.parser.restart(link[8:]).parse()
            self.editor.reset_active_component()
            self.editor.set_action(action, from_custom=True)
        elif link == "grab://trigger_button":

            def cb(action):
                action = TriggerAction(254, 255, action)
                self.editor.set_action(action, from_custom=True)
                self.editor.force_page("trigger")

            b = SimpleChooser(self.app, "buttons", cb)
            b.set_title(_("Select Button"))
            b.hide_axes()
            b.show(self.editor.window)
        elif link.startswith("page://"):

            def cb():
                self.editor.force_page(link[7:])

            GLib.timeout_add(0.1, cb)
Esempio n. 3
0
	def grab_action(self, button, cb):
		b = SimpleChooser(self.app, "buttons", cb)
		b.set_title(_("Select Button"))
		b.hide_axes()
		b.display_action(Action.AC_BUTTON, ButtonAction(button))
		b.show(self.editor.window)
Esempio n. 4
0
 def grab_action(self, button, cb):
     b = SimpleChooser(self.app, "buttons", cb)
     b.set_title(_("Select Button"))
     b.hide_axes()
     b.display_action(Action.AC_BUTTON, ButtonAction(button))
     b.show(self.editor.window)