Skip to content

Code cleanup and optimization of video controller information retrieval and UI handling. - #140

Merged
Timthreetwelve merged 3 commits into
mainfrom
fix/video-controller-data-mismatch
Jul 24, 2026
Merged

Code cleanup and optimization of video controller information retrieval and UI handling.#140
Timthreetwelve merged 3 commits into
mainfrom
fix/video-controller-data-mismatch

Conversation

@Timthreetwelve

Copy link
Copy Markdown
Owner

Refactored video controller data retrieval to eliminate mismatched data, improve efficiency and updated related UI and localization.

  • VideoHelpers: Replaced per-controller queries with a single GetAllVideoControllers method, improved null safety, and returned localized "Not Available" strings.
  • VideoViewModel: Updated to use the new retrieval method, storing all controller info in a list and improving selection logic.
  • Video adapter selection XAML: Adjusted for better spacing and alignment.
  • Languages/Strings.en-US.xaml: Added GraphicsInfo_Unknown resource and updated localization change logs.

Refactored video controller (GPU) data retrieval to fetch all details in a single call, replacing per-DeviceID queries. Updated ViewModel to store controller info as a list of dictionaries and adjusted UI binding and ComboBox logic to match. Improved helper methods for null handling and localization, and added new resource strings for "Unknown" and "billion". Enhanced layout and resource usage for better maintainability and localization support.
Copilot AI review requested due to automatic review settings July 24, 2026 17:02
@Timthreetwelve
Timthreetwelve merged commit 5777e84 into main Jul 24, 2026
3 checks passed
@Timthreetwelve
Timthreetwelve deleted the fix/video-controller-data-mismatch branch July 24, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the graphics/video controller data pipeline so the app retrieves all video controller information in one WMI query, then updates the ViewModel/UI to consume that unified dataset and adds a new localization string used for missing adapter names.

Changes:

  • Replaced per-controller WMI queries with a single GetAllVideoControllers() method and improved null-handling/localized fallback strings in VideoHelpers.
  • Updated VideoViewModel to store all controller dictionaries, generate a controller display list from them, and select controllers by index.
  • Tweaked the video adapter selector layout and added GraphicsInfo_Unknown to the en-US resource dictionary (with changelog entry).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
TimVer/Helpers/VideoHelpers.cs Consolidates WMI querying into a single controller enumeration and formats controller fields for display.
TimVer/ViewModels/VideoViewModel.cs Switches the ViewModel to consume the consolidated controller list and improves selection bounds checks.
TimVer/Views/VideoPage.xaml Minor spacing/alignment update for the adapter selection UI.
TimVer/Languages/Strings.en-US.xaml Adds GraphicsInfo_Unknown and updates the localization changelog.
TimVer/TimVer.csproj Bumps app version and sets prerelease identifier.

Comment on lines +20 to 24
AllControllers = VideoHelpers.GetAllVideoControllers();
ControllerList = [.. AllControllers.Select(c =>
c.GetValueOrDefault( GetStringResource("GraphicsInfo_GraphicsAdapter"), GetStringResource("GraphicsInfo_Unknown")))];
VideoInfoCollection = AllControllers.FirstOrDefault();
}
Comment on lines 132 to 136
#pragma warning disable RCS1213 // Remove unused member declaration
// Leaving this method in place for now as I may add it back in the future. It is currently commented out in the GetVideoInfo method.
// Leaving this method in place for now as I may add it back in the future. It is currently commented out in the GetAllVideoControllers method.
private static string FormatAdapterRamInfo(CimInstance instance)
#pragma warning restore RCS1213 // Remove unused member declaration
{
Comment on lines 185 to 189
@@ -197,21 +188,8 @@ private static string FormatColorsInfo(CimInstance instance)
return GetStringResource("MsgText_NotAvailable");
}
<sys:String x:Key="GraphicsInfo_SelectAdapter">Select Adapter</sys:String>
<sys:String x:Key="GraphicsInfo_SelectAdapterToolTipLine1">If there is more than one video adapter installed</sys:String>
<sys:String x:Key="GraphicsInfo_SelectAdapterToolTipLine2">use the drop-down to select the adapter to display.</sys:String>
<sys:String x:Key="GraphicsInfo_Unknown">Unknown</sys:String>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants