def set_action(self, action_path): ActionPanel.set_action(self, action_path) if action_path != None: # fill action scripts list self.choice_script.Clear() script_list = fsm.get_action_scripts() script_list.sort() self.choice_script.AppendItems( script_list ) # select current action script action = self.get_action() action.rewindargs() script_name = action.getstringarg() self.choice_script.SetStringSelection( script_name )
def set_default_values(self): # get available action scripts, vetoing the change if there isn't any script_list = fsm.get_action_scripts() if len( script_list ) == 0: cjr.show_error_message( "There isn't any action script available.\n" \ "Couldn't set a default action script." ) return False # fill action scripts list and select the first one as the default one self.choice_script.Clear() script_list.sort() self.choice_script.AppendItems( script_list ) self.choice_script.SetSelection(0) return True