Beispiel #1
0
    def update_ui_state(self):
        show_advanced_options = self.check_show_advanced_options.isChecked()

        # version
        def cb_mono_versions(versions):
            for version in versions:
                if version.executable == self.program.executable:
                    self.label_version.setText(version.version)
                    return

            self.label_version.setText('<unknown>')

        self.get_executable_versions('mono', cb_mono_versions)

        # start mode
        start_mode_api_name   = self.program.cast_custom_option_value('csharp.start_mode', str, '<unknown>')
        start_mode            = Constants.get_csharp_start_mode(start_mode_api_name)
        start_mode_executable = start_mode == Constants.CSHARP_START_MODE_EXECUTABLE

        self.label_start_mode.setText(Constants.csharp_start_mode_display_names[start_mode])

        # executable
        self.label_executable_title.setVisible(start_mode_executable)
        self.label_executable.setVisible(start_mode_executable)
        self.label_executable.setText(self.program.cast_custom_option_value('csharp.executable', str, '<unknown>'))

        # working directory
        self.label_working_directory_title.setVisible(show_advanced_options)
        self.label_working_directory.setVisible(show_advanced_options)
        self.label_working_directory.setText(self.program.working_directory)

        # options
        self.label_options_title.setVisible(show_advanced_options)
        self.label_options.setVisible(show_advanced_options)
        self.label_options.setText('\n'.join(self.program.cast_custom_option_value_list('csharp.options', str, [])))