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 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() 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)
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())
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)