Beispiel #1
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.set_input(item.id, item.action, mode=Action.AC_MENU)
     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)
Beispiel #2
0
 def on_btCustomActionEditor_clicked(self, *a):
     """ Handler for 'Custom Editor' button """
     from scc.gui.action_editor import ActionEditor  # Can't be imported on top
     e = ActionEditor(self.app, self.ac_callback)
     e.set_input(self.id, self._make_action(), mode=self.mode)
     e.hide_action_buttons()
     e.hide_advanced_settings()
     e.set_title(self.window.get_title())
     e.force_page(e.load_component("custom"), True)
     self.close()
     e.show(self.get_transient_for())
	def on_btCustomActionEditor_clicked(self, *a):
		""" Handler for 'Custom Editor' button """
		from scc.gui.action_editor import ActionEditor	# Can't be imported on top
		e = ActionEditor(self.app, self.ac_callback)
		e.set_input(self.id, self._make_action(), mode = self.mode)
		e.hide_action_buttons()
		e.hide_advanced_settings()
		e.set_title(self.window.get_title())
		e.force_page(e.load_component("custom"), True)
		self.close()
		e.show(self.get_transient_for())
Beispiel #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)