Commit Graph

343 Commits

Author SHA1 Message Date
rbalsleyMSFT 004b42436e Refactor USB drive detection event handler
Moves the click event handler for detecting USB drives from the main UI script to the dedicated core handlers module.

This change centralizes UI logic, improving code organization and maintainability.
2025-06-18 13:24:38 -07:00
rbalsleyMSFT 5e5db62d2a Refactors CU checkbox logic to core handlers
Moves the event handling logic for the "Latest CU" and "Preview CU" checkboxes from the main UI script into the core handlers module.

This change centralizes UI event handling, improving code organization and maintainability. The new implementation is also more robust, accessing state via the window's `Tag` property rather than a global script variable.
2025-06-18 13:16:34 -07:00
rbalsleyMSFT fd39b0008e Refactor: Centralize Install Apps checkbox logic
Consolidates the state management for the "Install Apps" checkbox into a single, reusable function.

Previously, the logic to automatically check and disable "Install Apps" when selecting an update or installing Office was duplicated and scattered across multiple event handlers and files.

This change introduces a new core function that centralizes this behavior. A single event handler is now used for all relevant checkboxes (Updates and Office), simplifying the UI code, reducing redundancy, and making the logic more robust and maintainable. The initial state is also set correctly on startup.
2025-06-18 13:07:07 -07:00
rbalsleyMSFT af5d5206f8 Refactors Office UI event handlers into core module
Moves the event handling logic for the M365 Apps/Office options from the main UI script into the `FFUUI.Core.Handlers` module.

This change centralizes UI event handling, improving code organization and maintainability. It also decouples the handlers from the main script by using a local state object instead of a global script variable.
2025-06-17 22:55:42 -07:00
rbalsleyMSFT de0e014e50 Refactor UI event handlers to a new module
Moves all UI event handling logic from the initialization script into a new, dedicated module `FFUUI.Core.Handlers.psm1`.

This change improves code organization and separation of concerns by centralizing event handler registration.
2025-06-17 18:39:10 -07:00
rbalsleyMSFT 6bf38d369b Improves code formatting
Adds a blank line to improve readability by separating UI state initialization logic.
2025-06-17 18:34:00 -07:00
rbalsleyMSFT dbb98ba4fe Refactor: Improve code clarity and remove unused variable
Renames the event handler parameter from `$sender` to `$eventSource` for better readability.

Removes an unused variable in the parallel processing function to clean up the code.
2025-06-17 18:31:56 -07:00
rbalsleyMSFT 87c9bc769e Improve driver list data handling and filtering
Refactors the driver selection UI to enhance stability and performance by changing how the underlying data source is managed. Creating and re-assigning a new list when data changes, rather than modifying the bound collection in-place, prevents UI inconsistency errors.

- Updates the model search to use the native WPF `CollectionView.Filter` for more efficient and reliable filtering.
- Fixes an issue where HTML entities were not decoded in Microsoft driver model names.
- Ensures selected drivers from one manufacturer are preserved when fetching models for another.
- Centralizes driver-related button event handlers into the core initialization module.
2025-06-17 18:25:06 -07:00
rbalsleyMSFT f014d7ffcd Refactor: Move driver download logic to core module
Relocates the click event handler for the driver download button from the main UI script to the `FFUUI.Core` module.

This change centralizes UI logic within the core module, improving code organization and maintainability. The handler is updated to use the local window state object instead of global script variables.
2025-06-17 16:18:38 -07:00
rbalsleyMSFT 07306ff209 Refactors model filter event handling to core module
Moves the `TextChanged` event handler for the driver model filter from the UI script to the core `Register-EventHandlers` function.

This change centralizes the logic and makes the handler more generic by retrieving the UI state from the window's tag instead of relying on a global variable.
2025-06-17 16:11:18 -07:00
rbalsleyMSFT ab0b92ad5c Refactor Dell driver catalog download logic
Moves the logic for downloading and preparing the Dell driver catalog from the main build scripts directly into the specific Dell driver download task.

This change encapsulates all Dell-specific logic within the `Save-DellDriversTask` function, making it self-sufficient. Each parallel task now manages its own dependency on the catalog file, which simplifies the main script's responsibilities.

Also includes minor code style formatting.
2025-06-17 16:02:34 -07:00
rbalsleyMSFT df96d14643 Clean up comments in build UI script
Removes several obsolete or redundant comments to improve code readability.
2025-06-17 15:52:58 -07:00
rbalsleyMSFT 61ec7509ad Refactor: Move model fetching logic to core UI module
Centralizes the `btnGetModels` click event handler from the main UI script into the `FFUUI.Core` module to improve code organization and separation of concerns.

The handler is updated to use the local state object instead of a global script variable. The logic for updating the model list is also improved to preserve the collection's object reference, ensuring data binding stability.
2025-06-17 15:07:18 -07:00
rbalsleyMSFT 0bcedadc5c Refactors UI event handlers into core module
Moves UI event handler registration logic from the main script to the `Register-EventHandlers` function in the `FFUUI.Core` module.

This change centralizes UI logic, improving code organization and modularity. The event handlers are also updated to access state via the window's tag, reducing reliance on script-scoped variables.
2025-06-17 15:03:12 -07:00
rbalsleyMSFT c1c5aa9239 Refactor: Move initial Windows settings population to core module
Moves the logic for the initial population of the Windows settings comboboxes from the UI's loaded event handler into the `Initialize-UIDefaults` function.

This change centralizes UI default value setup into a single location, improving code organization and maintainability.
2025-06-17 14:26:31 -07:00
rbalsleyMSFT ab7c8aa250 Refactor UI initialization and event handling
Moves the VM Switch data population and event handler logic from the main UI script into the `FFUUI.Core.Initialize` module.

This change improves code organization by centralizing UI initialization and event registration into dedicated functions, making the main script cleaner.

It also simplifies module manifests by changing explicit function exports to a wildcard.
2025-06-17 14:18:41 -07:00
rbalsleyMSFT 0fb9878cff Refactor Windows settings function for clarity
Renames the function for populating Windows settings UI controls to better reflect its purpose.

The `Get-` verb more accurately describes the function's action of retrieving information from the ISO file, as opposed to the previous `Initialize-` verb.
2025-06-17 13:21:56 -07:00
rbalsleyMSFT acd0092f26 Refactor UI initialization into core module
Extracts the logic for setting default UI control values from the main script into a new `Initialize-UIDefaults` function within the `FFUUI.Core` module.

This change cleans up the main UI script's window loaded event, improving code organization and separating UI setup from default value initialization.
2025-06-17 13:14:54 -07:00
rbalsleyMSFT 71a4923c56 Refactors UI control access for improved clarity
Replaces `$window.FindName` with  `$script:uiState.Controls` for accessing UI elements.

This change simplifies how UI controls are referenced, making the code easier to read and maintain.
2025-06-17 10:38:14 -07:00
rbalsleyMSFT dea59c5285 Removes unnecessary comment
Improves code readability by removing a redundant comment.
2025-06-17 10:21:40 -07:00
rbalsleyMSFT f1d0ab20cb Refactor function names and improve code formatting
Renames functions for better semantic clarity:
- `Refresh-WindowsSettingsCombos` becomes `Initialize-WindowsSettingsCombos` to better reflect its role in initial UI setup.
- `Filter-DriverModels` becomes `Search-DriverModels` to more accurately describe its use in user-driven model searches.

Enhances code readability in the UI script through consistent formatting of event handlers and multi-line script blocks.
2025-06-16 19:37:58 -07:00
rbalsleyMSFT fb9dc3fbc5 Refactors dynamic UI setup into core module for better organization
Moves initialization logic for several list views (driver models, Winget results, app script variables) and the features grid into a new `Initialize-DynamicUIElements` function.
This centralizes the setup of these UI components within the `FFUUI.Core.Initialize` module, improving code structure.

Additionally:
- Updates sort event handlers in the new module to correctly retrieve UI state from the window's tag.
- Enhances `Invoke-ListViewSort` by initializing sort state flags if they are not already present, improving sorting stability.
2025-06-16 18:28:04 -07:00
rbalsleyMSFT 49acd71ff9 Moves UI initialization logic to a new module
Extracts the UI control initialization functionality from the main core script into a dedicated module.
This improves code organization and modularity.
The module manifest is updated to include this new initialization module.
2025-06-16 17:00:26 -07:00
rbalsleyMSFT 026fdc0d33 Removes redundant comment from appsScriptVariablesDataList clearing logic 2025-06-15 14:22:13 -07:00
rbalsleyMSFT 08a4c1b732 Removes comments from driver UI logic
Cleans up the driver selection UI script by removing comments that were redundant, self-explanatory, or no longer relevant.
This enhances code readability and maintainability without altering functionality.
2025-06-15 13:58:27 -07:00
rbalsleyMSFT 3eaa8b6efd Removes comments from XAML
Removes unnecessary comments from the XAML file to improve readability.
2025-06-15 10:32:17 -07:00
rbalsleyMSFT 6c4e157b5c Updates module import path
Corrects the import path for the common module to `FFU.Common`.
2025-06-13 15:01:15 -07:00
rbalsleyMSFT b7847ebaad Refactors ListView helper functions to a shared module
Moves ListView item manipulation functions (`Update-ListViewPriorities`, `Move-ListViewItemTop`, `Move-ListViewItemUp`, `Move-ListViewItemDown`, `Move-ListViewItemBottom`) from the `FFUUI.Core.Applications` module to the `FFUUI.Core.Shared` module.

This improves code organization and reusability by centralizing common UI helper logic.
2025-06-13 14:40:02 -07:00
rbalsleyMSFT 1fe4e19239 Removes unnecessary module requirements from core and drivers modules 2025-06-13 14:15:26 -07:00
rbalsleyMSFT 4b4f5eba8c Refactors UI configuration and state management
Moves UI configuration loading and retrieval logic into a new `FFUUI.Core.Config` module.
Removes the `Set-UIValue` helper function from `BuildFFUVM_UI.ps1` and the `Get-UIConfig` function from `FFUUI.Core.psm1`.
This centralizes UI-related configuration handling for improved modularity.
2025-06-13 13:43:43 -07:00
rbalsleyMSFT 8c9d40eefa Refactor: Relocate Windows settings logic to new module
Moves functions and static data related to Windows releases, versions, SKUs, and optional features from the main UI script and core module into a new, dedicated `FFUUI.Core.WindowsSettings` module.

This change enhances code organization and modularity by centralizing Windows-specific configuration and UI helper functions. The UI script is updated to reflect these changes, including passing state to the refactored `BuildFeaturesGrid` function.
2025-06-13 13:22:43 -07:00
rbalsleyMSFT 925d2172ff Improves readability of allowed languages list
Formats the `$script:allowedLangs` array by placing each language code on a new line. This change enhances code readability and maintainability.
2025-06-13 12:16:14 -07:00
rbalsleyMSFT 6b0fb0385d Removes obsolete path variable definitions
Cleans up script initialization by removing unused path variables for application, application list, and user application list.
2025-06-13 11:55:32 -07:00
rbalsleyMSFT 2e9a7265e9 Refactors application management to a new module
Moves ListView manipulation, BYO application import/export, and copy task logic from the main UI script and core UI module into a new `FFUUI.Core.Applications` module.

This improves code organization and modularity for application-related features.
2025-06-13 11:53:14 -07:00
rbalsleyMSFT d1835c5c06 Refactor Winget functions into a dedicated module
Extracts Winget-related functionalities, including search, list management, installation, and download tasks, from `BuildFFUVM_UI.ps1` and `FFUUI.Core.psm1`.
Consolidates these features into a new module, `FFUUI.Core.Winget.psm1`, to improve code organization and maintainability.
2025-06-13 10:34:46 -07:00
rbalsleyMSFT 7babad8262 Refactor driver management into dedicated modules
Relocates driver-specific download, parsing, and management logic from the main UI script and the FFUUI.Core module into new, dedicated modules for each manufacturer (Dell, HP, Lenovo, Microsoft). This improves modularity and code organization.

Additionally, centralizes common HTTP headers and user agent strings in the FFUUI.Core module, accessible via a new helper function.
2025-06-12 15:47:46 -07:00
rbalsleyMSFT 9282b4231e Add FFU.Common and FFUUI.Core module manifests and shared UI functions
- Created module manifest for FFU.Common with initial version 0.0.1.
- Created module manifest for FFUUI.Core with initial version 0.0.1.
- Implemented shared UI functions in FFUUI.Shared.psm1, including:
  - Update-ListViewItemStatus: Updates the status of items in a ListView.
  - Update-OverallProgress: Updates a progress bar and status label.
  - Invoke-ProgressUpdate: Enqueues progress updates to the UI thread.
  - Add-SortableColumn: Adds sortable columns to a ListView.
  - Add-SelectableGridViewColumn: Adds a selectable column with a "Select All" checkbox.
  - Update-SelectAllHeaderCheckBoxState: Updates the state of the header checkbox.
  - Invoke-ListViewSort: Sorts ListView items based on specified properties.
  - Show-ModernFolderPicker: Displays a modern folder picker dialog.
2025-06-11 20:50:51 -07:00
rbalsleyMSFT e4201aebff Refactor UI initialization to utilize centralized state object for control management
- Introduced the Initialize-UIControls function to streamline the assignment of UI control references to the centralized state object.
- Removed repetitive control assignments from the window loading event, enhancing maintainability and readability.
- Improved the overall structure of the UI initialization process for better consistency across the application.
2025-06-10 20:09:13 -07:00
rbalsleyMSFT 1fb42bffdc Implement code changes to enhance functionality and improve performance 2025-06-10 19:04:25 -07:00
rbalsleyMSFT 9d7d0a0ec9 Remove debug logging statements from UI initialization for cleaner code 2025-06-09 20:32:54 -07:00
rbalsleyMSFT c5730230f6 Refactor functions to utilize a centralized state object for improved consistency and maintainability
Refactor functions to use a centralized state object

Modifies various functions to accept and utilize a `$State` parameter, replacing direct access to `$script:uiState` and module-scoped variables.

This change centralizes state management, improving code consistency and maintainability by passing necessary UI elements, data, and default configurations explicitly.
2025-06-09 20:30:57 -07:00
rbalsleyMSFT 19867cbcd9 Remove verbose flag from BuildFFUVM script execution for cleaner output 2025-06-07 20:21:44 -07:00
rbalsleyMSFT 131bd63a5b Refactor MainThreadLogPath to use script:uiState.LogFilePath for consistency 2025-06-07 19:07:05 -07:00
rbalsleyMSFT 562529a26b Refactor Get-ModelsForMake and Update-CopyButtonState to use State parameter
- Updated functions to accept a State parameter for improved scope management.
- Replaced direct window control access with State object references for better encapsulation and consistency.
- Ensured proper handling of UI elements within the context of the State object.

Refactors UI functions to use a State parameter

Improves scope management and encapsulation by passing a `State` object to UI-interacting functions.

This change modifies several functions, including `Get-ModelsForMake` and `Update-CopyButtonState`, to accept a `State` parameter.
It replaces direct access to UI controls via `$window.FindName` with references from the `State` object, leading to more consistent and maintainable code.
2025-06-07 18:47:15 -07:00
rbalsleyMSFT 6eae7226be Refactor UpdateInstallApps logic to use state object
- Moved the UpdateInstallAppsBasedOnUpdates function to the Controls section of the uiState object for better encapsulation.
- Updated the function to accept a state parameter, reducing reliance on the script scope.
- Adjusted event handlers to pass the state object, ensuring consistent access to UI state.
- Removed the previous definition of the function from the script scope to streamline the code.
2025-06-07 18:12:12 -07:00
rbalsleyMSFT 0091a4da92 Docs: Correct comment for Windows SKU combo population
The comment explaining how the Windows SKU combo box's ItemsSource is populated was outdated. It incorrectly stated that the `Update-WindowsSkuCombo` function was called via `RefreshWindowsSettingsCombos`.

This change removes the inaccurate reference, clarifying that `Update-WindowsSkuCombo` is now called directly.
2025-06-07 17:57:24 -07:00
rbalsleyMSFT 11084f6689 Added new $state object and refactored code to use the $state reference instead.
- Moved Get-UIConfig from BuildFFUVM_UI.ps1 to FFUUI.Core.psm1 to enhance separation of concerns.
- Updated Get-UIConfig to accept a central $State object, removing direct dependencies on global UI variables.
- Modified internal logic to access UI control values from the $State.Controls hashtable.
- Updated calls in BuildFFUVM_UI.ps1 to pass the $script:uiState object to the refactored function.
- Exported Get-UIConfig from FFUUI.Core.psm1 for accessibility in the main UI script.
2025-06-07 17:36:30 -07:00
rbalsleyMSFT 1b5fa5129c Updated formatting 2025-06-05 16:31:44 -07:00
rbalsleyMSFT 00a27fc4a8 Enhance MSRT handling for Windows installations by differentiating between client and LTSB/LTSC types 2025-05-29 20:09:22 -07:00
rbalsleyMSFT e1b1dfafac Reorder script execution list to ensure Install-Office.ps1 runs after Update-Defender.ps1 and remove unnecessary pause 2025-05-29 19:33:11 -07:00