microsoft / mu_feature_config

Project Mu - Feature Repo - UEFI User Config and Management Support
https://microsoft.github.io/mu/
Other
20 stars 27 forks source link

[Feature]: Add an optional prompt field in XML, and if it is defined, show the prompt string instead of name string in the ConfigEdiror UI tool #350

Closed MarcChen46 closed 5 months ago

MarcChen46 commented 5 months ago

Feature Overview

For the ConfigEditor.py tool, currently what it show up in the UI is the "name" field in the XML, which is also used for generating profile header file that will be consumed by C code, so the naming must follow the C coding rules, but from the user point of view, sometimes the variable name is hard to understand.

For providing more flexibility about the string show up in the tool, it would be better to support the ConfigKnob show up as a string that support white space. ex "Boot Option 1" instead of "BootOption1"

Solution Overview

Add one more field called "Prompt", then in the XML, it would like below example.

For the ConfigEditor.py.

<ConfigSchema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="configschema.xsd">
    <Enums>
        <Enum name="BOOT_OPTION" help="Boot Option Type">
            <Value prompt="USB Device" name="USB" value="0" help="Usb Device" />
            <Value prompt="Hard Disk" name="HDD" value="1" help="Hard Disk" />
            <Value prompt="NVMe device" name="NVME" value="2" help="Nvme" />
            <Value prompt="CD/DVD" name="ODD" value="3" help="Cd/Dvd" />
            <Value prompt="SD/EMMC" name="SD" value="4" help="Sd/Emmc" />
            <Value prompt="Network Device" name="NETWORK" value="5" help="Network" />
            <Value prompt="Ramdisk" name="RAMDISK" value="6" help="Ramdisk" />
            <Value prompt="Disabled" name="Disabled" value="8" help="Disabled" />
        </Enum>
    </Enums>
    <Structs>
        <Struct name="BOOT_CFG_DATA" help="Boot Config Data">
            <Member prompt="Boot Option 1" name="BootOption1" type="BOOT_OPTION" default="USB" />
            <Member prompt="Boot Option 2" name="BootOption2" type="BOOT_OPTION" default="NETWORK" />
            <Member prompt="Boot Option 3" name="BootOption3" type="BOOT_OPTION" default="HDD" />
            <Member prompt="Boot Option 4" name="BootOption4" type="BOOT_OPTION" default="NVME" />
            <Member prompt="Boot Option 5" name="BootOption5" type="BOOT_OPTION" default="ODD" />
            <Member prompt="Boot Option 6" name="BootOption6" type="BOOT_OPTION" default="SD" />
        </Struct>
    </Structs>
    <Knobs namespace="{D7ADABDD-B9CA-4E1D-87B6-9FA985D8AC69}">
        <Knob prompt="Boot Configuration" type="BOOT_CFG_DATA" name="BootConfiguration" />
    </Knobs>
</ConfigSchema>

Alternatives Considered

No response

Urgency

Low

Are you going to implement the feature request?

Someone else needs to implement the feature

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

changray@microsoft.com would be the one to study and create PR for review.