Beispiel #1
0
    def initializePage(self):
        self.set_formatted_sub_title(
            'Specify when the {language} program [{name}] should be executed.')
        self.combo_start_mode.setCurrentIndex(Constants.DEFAULT_START_MODE)

        # if a program exists then this page is used in an edit wizard
        program = self.wizard().program

        if program != None:
            self.combo_start_mode.setCurrentIndex(
                Constants.get_start_mode(program.start_mode))
            self.check_continue_after_error.setChecked(
                program.continue_after_error)
            self.spin_start_interval.setValue(program.start_interval)

            if program.start_mode == REDProgram.START_MODE_CRON:
                self.edit_start_fields.setText(program.start_fields)
        elif self.combo_start_mode.count() <= Constants.START_MODE_SEPARATOR:
            self.combo_start_mode.insertSeparator(
                Constants.START_MODE_SEPARATOR)
            self.combo_start_mode.insertItem(Constants.START_MODE_ONCE,
                                             'Once After Upload')

        self.update_ui_state()
        self.update_interval_help()