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)
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)
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)
def on_actionb_clicked(self, trash, data): """ Handler clicking on action name """ action, widgets = data def on_chosen(id, action, reopen=False): data[0] = action self._refill_grid([ x[0] for x in self.actions ]) self.update_action_field() if reopen: self.on_actionb_clicked(trash, data) from scc.gui.action_editor import ActionEditor # Cannot be imported @ top ae = ActionEditor(self.app, on_chosen) ae.set_title(_("Edit Action")) self._setup_editor(ae, action) ae.hide_modeshift() ae.hide_macro() ae.hide_name() ae.show(self.window)
def on_actionb_clicked(self, trash, data): """ Handler clicking on action name """ action, widgets = data def on_chosen(id, action, reopen=False): data[0] = action self._refill_grid([x[0] for x in self.actions]) self.update_action_field() if reopen: self.on_actionb_clicked(trash, data) from scc.gui.action_editor import ActionEditor # Cannot be imported @ top ae = ActionEditor(self.app, on_chosen) ae.set_title(_("Edit Action")) self._setup_editor(ae, action) ae.hide_modeshift() ae.hide_macro() ae.hide_name() ae.show(self.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() 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)
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)