mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Removes redundant optional features textbox
Eliminates the read-only field and derives the features list directly from the checked items, producing a sorted semicolon string when collecting config. Avoids duplicated state, prevents desynchronization between UI elements, and yields deterministic ordering for persistence.
This commit is contained in:
@@ -71,7 +71,7 @@ function Get-UIConfig {
|
||||
OfficeConfigXMLFile = $State.Controls.txtOfficeConfigXMLFilePath.Text
|
||||
OfficePath = $State.Controls.txtOfficePath.Text
|
||||
Optimize = $State.Controls.chkOptimize.IsChecked
|
||||
OptionalFeatures = $State.Controls.txtOptionalFeatures.Text
|
||||
OptionalFeatures = (($State.Controls.featureCheckBoxes.GetEnumerator() | Where-Object { $_.Value.IsChecked } | ForEach-Object { $_.Key } | Sort-Object) -join ';')
|
||||
OrchestrationPath = "$($State.Controls.txtApplicationPath.Text)\Orchestration"
|
||||
PEDriversFolder = $State.Controls.txtPEDriversFolder.Text
|
||||
Processors = [int]$State.Controls.txtProcessors.Text
|
||||
@@ -419,10 +419,9 @@ function Update-UIFromConfig {
|
||||
Set-UIValue -ControlName 'cmbWindowsSKU' -PropertyName 'SelectedItem' -ConfigObject $ConfigContent -ConfigKey 'WindowsSKU' -State $State
|
||||
Set-UIValue -ControlName 'cmbMediaType' -PropertyName 'SelectedItem' -ConfigObject $ConfigContent -ConfigKey 'MediaType' -State $State
|
||||
Set-UIValue -ControlName 'txtProductKey' -PropertyName 'Text' -ConfigObject $ConfigContent -ConfigKey 'ProductKey' -State $State
|
||||
Set-UIValue -ControlName 'txtOptionalFeatures' -PropertyName 'Text' -ConfigObject $ConfigContent -ConfigKey 'OptionalFeatures' -State $State
|
||||
|
||||
# Update Optional Features checkboxes based on the loaded text
|
||||
$loadedFeaturesString = $State.Controls.txtOptionalFeatures.Text
|
||||
|
||||
# Update Optional Features checkboxes
|
||||
$loadedFeaturesString = $ConfigContent.OptionalFeatures
|
||||
if (-not [string]::IsNullOrWhiteSpace($loadedFeaturesString)) {
|
||||
$loadedFeaturesArray = $loadedFeaturesString.Split(';')
|
||||
WriteLog "LoadConfig: Updating Optional Features checkboxes. Loaded features: $($loadedFeaturesArray -join ', ')"
|
||||
|
||||
Reference in New Issue
Block a user