示例#1
0
	def on_btDPAD_clicked(self, b):
		""" 'Select DPAD Left Action' handler """
		i = int(b.get_name())
		ae = ActionEditor(self.app, self.on_choosen)
		ae.set_title(_("Select DPAD Action"))
		ae.set_button(i, self.actions[i])
		ae.show(self.app.window)
示例#2
0
 def on_btDPAD_clicked(self, b):
     """ 'Select DPAD Left Action' handler """
     i = int(b.get_name())
     ae = ActionEditor(self.app, self.on_choosen)
     ae.set_title(_("Select DPAD Action"))
     ae.set_button(i, self.actions[i])
     ae.show(self.app.window)
	def btEdit_clicked_cb(self, *a):
		""" Handler for "Edit Item" button """
		tvItems = self.builder.get_object("tvItems")
		model, iter = tvItems.get_selection().get_selected()
		o = model.get_value(iter, 0)
		e = ActionEditor(self.app, self.on_action_chosen)
		e.hide_macro()
		e.hide_modeshift()
		e.set_title(_("Edit Menu Action"))
		e.set_button(o.item.id, o.item.action)
		e.show(self.window)
示例#4
0
	def btEdit_clicked_cb(self, *a):
		""" Handler for "Edit Item" button """
		tvItems = self.builder.get_object("tvItems")
		model, iter = tvItems.get_selection().get_selected()
		item = model.get_value(iter, 0).item
		# Setup editor
		e = ActionEditor(self.app, self.on_action_chosen)
		if isinstance(item, Separator):
			e.set_title(_("Edit Separator"))
			e.hide_editor()
			e.set_menu_item(item, _("Separator Name"))
		elif isinstance(item, Submenu):
			e.set_title(_("Edit Submenu"))
			e.hide_action_str()
			e.hide_clear()
			(e.force_page(e.load_component("menu_only"), True)
				.allow_menus(True, False)
				.set_selected_menu(item.filename))
			e.set_menu_item(item, _("Menu Label"))
		elif isinstance(item, MenuItem):
			e = ActionEditor(self.app, self.on_action_chosen)
			e.set_title(_("Edit Menu Action"))
			e.hide_modeshift()
			e.hide_macro()
			e.set_button(item.id, item.action)
		elif isinstance(item, RecentListMenuGenerator):
			e.set_title(_("Edit Recent List"))
			e.hide_action_str()
			e.hide_clear()
			e.hide_name()
			(e.force_page(e.load_component("recent_list"), True)
				.set_row_count(item.rows))
			e.set_menu_item(item)
		else:
			# Cannot edit this
			return
		# Display editor
		e.show(self.window)
示例#5
0
 def btEdit_clicked_cb(self, *a):
     """ Handler for "Edit Item" button """
     tvItems = self.builder.get_object("tvItems")
     model, iter = tvItems.get_selection().get_selected()
     item = model.get_value(iter, 0).item
     # Setup editor
     e = ActionEditor(self.app, self.on_action_chosen)
     if isinstance(item, Separator):
         e.set_title(_("Edit Separator"))
         e.hide_editor()
         e.set_menu_item(item, _("Separator Name"))
     elif isinstance(item, Submenu):
         e.set_title(_("Edit Submenu"))
         e.hide_action_str()
         e.hide_clear()
         (e.force_page(e.load_component("menu_only"), True).allow_menus(
             True, False).set_selected_menu(item.filename))
         e.set_menu_item(item, _("Menu Label"))
     elif isinstance(item, MenuItem):
         e = ActionEditor(self.app, self.on_action_chosen)
         e.set_title(_("Edit Menu Action"))
         e.hide_modeshift()
         e.hide_macro()
         e.set_button(item.id, item.action)
     elif isinstance(item, RecentListMenuGenerator):
         e.set_title(_("Edit Recent List"))
         e.hide_action_str()
         e.hide_clear()
         e.hide_name()
         (e.force_page(e.load_component("recent_list"),
                       True).set_row_count(item.rows))
         e.set_menu_item(item)
     else:
         # Cannot edit this
         return
     # Display editor
     e.show(self.window)