def set_actions(self): '''Edit Screens add 'Reset' and 'Change Type' actions. Since these do not manipulate screen direction, they are captured during processing by adding them to center_win's key_dict. ''' super(PartEditScreen, self).set_actions() reset_action = Action(curses.KEY_F7, _("Reset")) change_action = Action(curses.KEY_F5, _("Change Type")) self.main_win.actions[reset_action.key] = reset_action self.main_win.actions[change_action.key] = change_action self.center_win.key_dict[curses.KEY_F7] = self.on_key_F7
def reset_actions(self): '''Reset the actions to the defaults, clearing any custom actions registered by individual screens ''' self.continue_action = Action(curses.KEY_F2, _("Continue"), self.screen_list.get_next) self.back_action = Action(curses.KEY_F3, _("Back"), self.screen_list.previous_screen) self.help_action = Action(curses.KEY_F6, _("Help"), self.screen_list.show_help) self.quit_action = Action(curses.KEY_F9, _("Quit"), self.screen_list.quit) self.set_default_actions()
def set_actions(self): '''Remove the continue key for help screen and Help key for help topics screen. Redirect F2_Continue to display the selected topic, when at the topics list ''' logging.debug("in set_actions self.class_name=%s", self.__class__.__name__) # change F6 description self.main_win.help_action.text = HelpScreen.HELP_INDEX # change continue to call continue_action, rather than # normal continue. Though we stay on the same screen, # we simulate the continue here by changing the screen text. # help_continue = Action(curses.KEY_F2, _("Continue"), self.continue_action) self.main_win.actions[help_continue.key] = help_continue if (self.screen == self.__class__.__name__): # help topics screen self.main_win.actions.pop(self.main_win.help_action.key, None) else: # help screen self.main_win.actions.pop(self.main_win.continue_action.key, None)
def set_actions(self): '''Remove all actions except Quit, and add actions for rebooting and viewing the log. ''' self.main_win.actions.pop(curses.KEY_F2) # Remove F2_Continue self.main_win.actions.pop(curses.KEY_F3) # Remove F3_Back self.main_win.actions.pop(curses.KEY_F6) # Remove F6_Help if self.install_profile.install_succeeded: reboot_action = Action(curses.KEY_F8, _("Reboot"), reboot_system) self.main_win.actions[reboot_action.key] = reboot_action log_action = Action(curses.KEY_F4, _("View Log"), self.main_win.screen_list.get_next) self.main_win.actions[log_action.key] = log_action
def set_actions(self): '''Replace the default F2_Continue with F2_Install''' install_action = Action(curses.KEY_F2, _("Install"), self.main_win.screen_list.get_next) self.main_win.actions[install_action.key] = install_action
def set_actions(self): '''Remove the F3_Back Action from the first screen''' self.main_win.actions.pop(self.main_win.back_action.key, None) zpool_install_action = Action(curses.KEY_F5, _("InstallToExistingPool"), self.zpool_install) self.main_win.actions[zpool_install_action.key] = zpool_install_action