Skip to content

Commit

Permalink
Added a new public property AdvancedFeaturesSupported to CurrentPlatf…
Browse files Browse the repository at this point in the history
…orm class.
  • Loading branch information
xvitaly committed Apr 18, 2024
1 parent e68dea3 commit 13b258b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/corelib/CurrentPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ protected static string AddQuotesToPath(string Source)
/// </summary>
public virtual bool AutoUpdateSupported => false;

/// <summary>
/// Return whether advanced features are supported on this platform.
/// </summary>
public virtual bool AdvancedFeaturesSupported => false;

/// <summary>
/// Immediately shut down application and return exit code.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/corelib/IPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public interface IPlatform
/// </summary>
bool AutoUpdateSupported { get; }

/// <summary>
/// Return whether advanced features are supported on this platform.
/// </summary>
bool AdvancedFeaturesSupported { get; }

/// <summary>
/// Immediately shut down application and return exit code.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/corelib/PlatformWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public override int StartElevatedProcess(string FileName)
/// </summary>
public override bool AutoUpdateSupported => true;

/// <summary>
/// Return whether advanced features are supported on this platform.
/// </summary>
public override bool AdvancedFeaturesSupported => true;

/// <summary>
/// Get platform-dependent Steam installation folder (directory) name.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/srcrepair/FrmMainW.cs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ private void RegisterPlugins()
{
try
{
if (App.Platform.OS == CurrentPlatform.OSType.Windows)
if (App.Platform.AdvancedFeaturesSupported)
{
MNUWinMnuDisabler.Enabled = App.Plugins["kbhelper"].Installed;
}
Expand Down Expand Up @@ -708,7 +708,7 @@ private void SetAppStrings()
private void ChangePrvControlState()
{
// Checking platform...
if (App.Platform.OS != CurrentPlatform.OSType.Windows)
if (!App.Platform.AdvancedFeaturesSupported)
{
// On Linux and MacOS we will disable some modules and features...
MNUReportBuilder.Enabled = false;
Expand Down

0 comments on commit 13b258b

Please sign in to comment.