예제 #1
0
def _collect_legacy_keywords():

    """
    Helper function to build a set of all permutations of platform/configuration prefixed keywords so we can flag them for deprecated
    wscript definitions
    :return:  The list of all possible deprecated keywords
    """
    # Build a set of all permutations so we can detect any legacy platform/config keyword name modifiers
    legacy_modifiers = set()
    for platform_details in LUMBERYARD_SETTINGS.get_all_platform_settings():
        platform_and_alias = [platform_details.platform] + list(platform_details.aliases)
        for platform in platform_and_alias:
            legacy_modifiers.add(platform)
            for configuration_details in LUMBERYARD_SETTINGS.get_build_configuration_settings():
                legacy_modifiers.add(
                    '{}_{}'.format(platform, configuration_details.build_config_name(is_test=False, is_server=False)))
                legacy_modifiers.add(
                    '{}_{}'.format(platform, configuration_details.build_config_name(is_test=False, is_server=True)))
                legacy_modifiers.add(
                    '{}_{}'.format(platform, configuration_details.build_config_name(is_test=True, is_server=False)))
                legacy_modifiers.add(
                    '{}_{}'.format(platform, configuration_details.build_config_name(is_test=True, is_server=True)))
            legacy_modifiers.add('{}_ndebug'.format(platform))

    legacy_keywords = set()
    for legacy_modifier in legacy_modifiers:
        for values in KEYWORD_TYPES.values():
            for value in values:
                legacy_keywords.add('{}_{}'.format(legacy_modifier, value))
        for value in SANITIZE_TO_LIST_KEYWORDS:
            legacy_keywords.add('{}_{}'.format(legacy_modifier, value))
    return legacy_keywords
예제 #2
0
    def create_option_widget(self, option_name, target_content_area):
        option_name = option_name.strip()

        # Ensure we are not adding the same option twice
        if self.options_widgets.get(option_name, None):
            return

        # Create options for category
        value = None
        default_value = ""
        default_description = ""

        user_settings = LUMBERYARD_SETTINGS.create_config()

        if user_settings.has_section(
                self.category_name) and user_settings.has_option(
                    self.category_name, option_name):
            value = user_settings.get(self.category_name, option_name)
            default_value, default_description = LUMBERYARD_SETTINGS.get_default_value_and_description(
                self.category_name, option_name)

        if not value:
            value = LUMBERYARD_SETTINGS.get_settings_value(option_name)
            default_value, default_description = LUMBERYARD_SETTINGS.get_default_value_and_description(
                self.category_name, option_name)

            # Before creating the widget, validate that it is valid
        (valValid, warning, error) = _verify_option(self.waf_ctx,
                                                    self.category_name,
                                                    option_name, value)

        # Spawn input dialog to inform user
        if not valValid:
            d = ForceValidationDialog(self.waf_ctx, self.content_area,
                                      self.category_name, option_name, value,
                                      default_description, default_value, None)
            if d.result:
                value = d.result

        self.options_widgets[option_name] = _create_option_widget(
            self.waf_ctx, self.category_name, option_name, value,
            default_description, default_value, target_content_area,
            self.resolve_option_dependencies)

        # Update to re-calculate size and set scroll area
        self.content_area.update_idletasks()
        self.canvas.configure(scrollregion=(0, 0,
                                            self.content_area.winfo_width(),
                                            self.content_area.winfo_height()))
예제 #3
0
    def __init__(self, category_name, parent):
        self.parent = parent
        self.category_name = category_name
        self.options_list = []
        self.options_widgets = {}
        self.waf_ctx = self.parent.waf_ctx

        # Get options for section
        self.default_options = LUMBERYARD_SETTINGS.get_default_options().get(
            self.category_name, [])

        # Get all valid option in order from the default settings
        for items in self.default_options:
            attribute = items.get('attribute', None)
            if attribute:
                self.options_list.append(attribute)

        # Add new tab
        self.outer_frame = ttk.Frame(self.parent.tab_widget)
        self.outer_frame.pack(expand=tk.YES, fill=tk.BOTH)

        scroll_x = Scrollbar(self.outer_frame, orient=HORIZONTAL)
        scroll_y = Scrollbar(self.outer_frame, orient=VERTICAL)

        self.canvas = Canvas(self.outer_frame,
                             bd=0,
                             height=350,
                             highlightthickness=0,
                             xscrollcommand=scroll_x.set,
                             yscrollcommand=scroll_y.set)
        scroll_x.config(command=self.canvas.xview)
        scroll_y.config(command=self.canvas.yview)

        self.content_area = Frame(self.canvas)
        self.canvas.create_window(0, 0, window=self.content_area, anchor=NW)

        # Control mouse wheel on in/out focus
        self.outer_frame.bind(
            "<FocusIn>",
            lambda event, self=self: self.canvas.bind_all(
                "<MouseWheel>",
                lambda event, self=self: self._on_mousewheel(event)))
        self.outer_frame.bind(
            "<FocusOut>",
            lambda event, self=self: self.canvas.unbind_all("<MouseWheel>"))

        scroll_y.pack(side=tk.RIGHT, fill=tk.Y)
        scroll_x.pack(side=tk.BOTTOM, fill=tk.X)
        self.canvas.pack(side=tk.LEFT, expand=tk.YES, fill=tk.BOTH)

        self.parent.tab_widget.add(self.outer_frame, text=category_name)
        self.parent.tab_widget.pack(anchor=W)
예제 #4
0
 def read_waf_option_config(self):
     # Loop over all sections
     for section in LUMBERYARD_SETTINGS.get_default_sections():
         self.categories[section] = UiCategory(section, self)
예제 #5
0
def update_settings_options_file(ctx):
    """
    Update the user_settings.options file if there are any changes from the command line
    """
    LUMBERYARD_SETTINGS.update_settings_file(True)
예제 #6
0
def set_settings_option(ctx, section_name, option_name, value):

    LUMBERYARD_SETTINGS.set_settings_value(option_name, value)
예제 #7
0
def save_user_settings(ctx):
    LUMBERYARD_SETTINGS.update_settings_file(True)
예제 #8
0
def get_default_settings_value(ctx, section_name, setting_name):
    return LUMBERYARD_SETTINGS.get_default_value_and_description(
        section_name, setting_name)
예제 #9
0
def options(ctx):
    LUMBERYARD_SETTINGS.apply_to_settings_context(ctx)