Esempio n. 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)
Esempio n. 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())
Esempio n. 3
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())
Esempio n. 4
0
    def on_actionb_clicked(self, button, i, action_data):
        """ Handler clicking on action name """
        def on_chosen(id, action):
            readd = [x.action for x in self.actions]
            readd[i] = action
            self._refill_grid(readd)
            self.update_action_field()

        from scc.gui.action_editor import ActionEditor  # Cannot be imported @ top
        ae = ActionEditor(self.app, on_chosen)
        ae.set_title(_("Edit Action"))
        ae.set_input(self.id, action_data.action, mode=self.mode)
        ae.hide_modeshift()
        ae.hide_macro()
        ae.hide_name()
        ae.show(self.window)
Esempio n. 5
0
	def on_actionb_clicked(self, button, i, action_data):
		""" Handler clicking on action name """
		def on_chosen(id, action):
			readd = [ x.action for x in self.actions ]
			readd[i] = action
			self._refill_grid(readd)
			self.update_action_field()
		
		from scc.gui.action_editor import ActionEditor	# Cannot be imported @ top
		ae = ActionEditor(self.app, on_chosen)
		ae.set_title(_("Edit Action"))
		ae.set_input(self.id, action_data.action, mode=self.mode)
		ae.hide_modeshift()
		ae.hide_macro()
		ae.hide_name()
		ae.show(self.window)