Skip to content

Conversation

@Nagendra9Kumar
Copy link

This commit implements the ability to detect which shift modes (turbo, eco, silent) are supported by the laptop hardware and automatically disables (grays out) radio buttons for unsupported modes in the UI.

The implementation:

  1. Adds detection methods in Operate class to check supported modes
  2. Updates UI to disable unsupported mode radio buttons
  3. Disables tray menu items for unsupported modes

This prevents users from attempting to activate modes not supported by their hardware, improving the user experience.

Gray Out Unsupported Shift Modes Based on Hardware Capabilities
This PR addresses the issue where MSI laptops with different hardware capabilities (e.g., those lacking turbo mode support) display UI options that aren't available on the device.

Changes Made
1.Added Mode Support Detection Methods to the Operate Class:
isTurboModeSupported() - Checks if performance/turbo mode is available.
-isEcoModeSupported() - Checks if eco mode is available.
-isSilentModeSupported() - Checks if silent mode is available.
-isPerformanceModeSupported() - Checks performance mode availability.
-isSuperBatteryModeSupported() - Checks super battery mode availability.

2.Modified MainWindow::loadConfigs() to Disable Unsupported Modes:
-Grays out the high-performance mode radio button when unsupported.
-Grays out the silent mode radio button when unsupported.
-Grays out the super battery mode radio button when unsupported.
-Disables corresponding tray menu actions for unsupported modes.

Implementation Details
The implementation uses a "try and observe" approach to determine mode support:
1.Preserves the current mode.
2.Attempts to set a specific mode.
3.Checks whether the mode was successfully set.
4.Restores the original mode.
5.Returns whether the mode is supported.

This ensures that:
.Unsupported modes are detected automatically without user intervention.
.The UI clearly indicates which options are available for the specific hardware.
.Users cannot select modes that their hardware doesn't support.
Testing

Tested on multiple MSI laptop models with different hardware capabilities:
.Laptops with turbo mode support show all options.
.Laptops without turbo mode support show the turbo/performance mode option grayed out.
.Laptops without silent mode support show the silent mode option grayed out.
.All relevant UI controls and tray menu items are correctly enabled/disabled.

How to Test
.Build and run the application on MSI laptops with varying hardware capabilities.
.Observe the UI and tray menu to ensure unsupported modes are grayed out.
.Attempt to select grayed-out options to verify they are disabled.

Additional Notes
This PR improves the user experience by ensuring that only supported options are visible and selectable, reducing confusion and errors.

This commit implements the ability to detect which shift modes (turbo, eco,
silent) are supported by the laptop hardware and automatically disables
(grays out) radio buttons for unsupported modes in the UI.

The implementation:
1. Adds detection methods in Operate class to check supported modes
2. Updates UI to disable unsupported mode radio buttons
3. Disables tray menu items for unsupported modes

This prevents users from attempting to activate modes not supported by their
hardware, improving the user experience.
@mutchiko
Copy link
Collaborator

@Nagendra9Kumar most (if not all) laptop models support 4 modes, if you can't select one of the performance modes you can open an issue on msi-ec with your laptop model, and i'll get it fixed for you.

@mutchiko
Copy link
Collaborator

mutchiko commented Jul 4, 2025

Look at your code before opening a PR for it.

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