[Settings][PTRun]Show plugin version and website (#36580)

This commit is contained in:
Heiko
2025-01-08 15:03:27 +01:00
committed by GitHub
parent cd2a88704d
commit a29ff07ec0
25 changed files with 95 additions and 25 deletions

View File

@@ -38,6 +38,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_enabledGpoRuleConfiguration = (GpoRuleConfigured)settings.EnabledPolicyUiState;
_enabledGpoRuleIsConfigured = _enabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _enabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
_hasValidWebsiteUri = Uri.IsWellFormedUriString(settings.Website, UriKind.Absolute);
_websiteUri = _hasValidWebsiteUri ? settings.Website : WebsiteFallbackUri;
}
public string Id { get => settings.Id; }
@@ -46,8 +49,19 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
public string Description { get => settings.Description; }
public string Version { get => settings.Version; }
public string Author { get => settings.Author; }
// Fallback value for the website in case the uri from json is not well formatted
private const string WebsiteFallbackUri = "https://aka.ms/PowerToys";
private string _websiteUri;
private bool _hasValidWebsiteUri;
public string WebsiteUri => _websiteUri;
public bool HasValidWebsiteUri => _hasValidWebsiteUri;
private GpoRuleConfigured _enabledGpoRuleConfiguration;
private bool _enabledGpoRuleIsConfigured;