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

This commit is contained in:
Heiko 2025-01-08 15:03:27 +01:00 коммит произвёл GitHub
Родитель cd2a88704d
Коммит a29ff07ec0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
25 изменённых файлов: 95 добавлений и 25 удалений

Просмотреть файл

@ -16,7 +16,7 @@
"Author": string,
"Version": "1.0.0", // For future compatibility
"Language": "csharp", // So far we support only csharp
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/powertoys", // Has to be an absolute uri starting with "http://" or "https://".
"ExecuteFileName": string, // Should be {Type}.PowerToys.Run.Plugin.{PluginName}.dll
"IcoPathDark": string, // Path to dark theme icon. The path is relative to the root plugin folder
"IcoPathLight": string // Path to light theme icon. The path is relative to the root plugin folder
@ -42,3 +42,4 @@ In the PR that adds a new plugin, reference a new issue to track the work for fu
- [ ] Add the resource folder to https://github.com/microsoft/PowerToys/blob/21247c0bb09a1bee3d14d6efa53d0c247f7236af/installer/PowerToysSetup/Product.wxs#L825
- [ ] Add the resource files under the section https://github.com/microsoft/PowerToys/blob/21247c0bb09a1bee3d14d6efa53d0c247f7236af/installer/PowerToysSetup/Product.wxs#L882
- [ ] Your plugin's executable file (DLL) has to have correct version informations after building it. (This version information will be shown on the settings page.)

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "ThiefZero",
"Version": "0.0.1",
"Language": "csharp",
"Website": "https://github.com/ThiefZero",
"Website": "https://aka.ms/PowerToys",
"IcoPathDark": "Images\\unitconverter.dark.png",
"IcoPathLight": "Images\\unitconverter.light.png",
"ExecuteFileName": "Community.PowerToys.Run.Plugin.UnitConverter.dll"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "ricardosantos9521",
"Version": "1.2.0",
"Language": "csharp",
"Website": "https://github.com/ricardosantos9521/PowerToys/",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Community.PowerToys.Run.Plugin.VSCodeWorkspaces.dll",
"IsGlobal": false,
"IcoPathDark": "Images\\code.dark.png",

Просмотреть файл

@ -7,7 +7,7 @@
"Author": "IHorvalds",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://github/com/IHorvalds",
"Website": "https://aka.ms/PowerToys",
"IcoPathDark": "Images\\ValueGenerator.dark.png",
"IcoPathLight": "Images\\ValueGenerator.light.png",
"ExecuteFileName": "Community.PowerToys.Run.Plugin.ValueGenerator.dll"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "cyberrex5",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Community.PowerToys.Run.Plugin.WebSearch.dll",
"IcoPathDark": "Images\\WebSearch.dark.png",
"IcoPathLight": "Images\\WebSearch.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "qianlifeng",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.Plugin.Folder.dll",
"IcoPathDark": "Images\\folder.dark.png",
"IcoPathLight": "Images\\folder.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "qianlifeng",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.Plugin.Shell.dll",
"IcoPathDark": "Images\\shell.dark.png",
"IcoPathLight": "Images\\shell.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "Microsoft",
"Version": "1.0.0",
"Language": "csharp",
"Website": "http://aka.ms/PowerToys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.Plugin.Uri.dll",
"IcoPathDark": "Images\\uri.dark.png",
"IcoPathLight": "Images\\uri.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "betadele",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://www.windowwalker.com/",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.Plugin.WindowWalker.dll",
"IcoPathDark": "Images\\windowwalker.dark.png",
"IcoPathLight": "Images\\windowwalker.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "cxfksword",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Calculator.dll",
"IcoPathDark": "Images\\calculator.dark.png",
"IcoPathLight": "Images\\calculator.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "jefflord",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.History.dll",
"IcoPathDark": "Images\\history.dark.png",
"IcoPathLight": "Images\\history.light.png"

Просмотреть файл

@ -7,7 +7,7 @@
"Author": "palenshus",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.OneNote.dll",
"IcoPathDark": "Images\\oneNote.dark.png",
"IcoPathLight": "Images\\oneNote.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "davidegiacometti",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.PowerToys.dll",
"IcoPathDark": "Images\\PowerToys.dark.png",
"IcoPathLight": "Images\\PowerToys.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "TobiasSekan",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Registry.dll",
"IcoPathDark": "Images\\reg.dark.png",
"IcoPathLight": "Images\\reg.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "davidegiacometti",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Service.dll",
"IcoPathDark": "Images\\service.dark.png",
"IcoPathLight": "Images\\service.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "Wox",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.System.dll",
"IcoPathDark": "Images\\lock.dark.png",
"IcoPathLight": "Images\\lock.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "htcfreek",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.TimeDate.dll",
"IcoPathDark": "Images\\timeDate.dark.png",
"IcoPathLight": "Images\\timeDate.light.png"

Просмотреть файл

@ -6,7 +6,7 @@
"Author": "TobiasSekan",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.WindowsSettings.dll",
"IcoPathDark": "Images\\WindowsSettings.dark.png",
"IcoPathLight": "Images\\WindowsSettings.light.png"

Просмотреть файл

@ -7,7 +7,7 @@
"Author": "davidegiacometti",
"Version": "1.0.0",
"Language": "csharp",
"Website": "https://aka.ms/powertoys",
"Website": "https://aka.ms/PowerToys",
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.WindowsTerminal.dll",
"IcoPathDark": "Images\\WindowsTerminal.dark.png",
"IcoPathLight": "Images\\WindowsTerminal.light.png"

Просмотреть файл

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Abstractions;
using System.Linq;
@ -251,7 +252,9 @@ namespace PowerLauncher
Id = x.Metadata.ID,
Name = x.Plugin == null ? x.Metadata.Name : x.Plugin.Name,
Description = x.Plugin?.Description,
Version = FileVersionInfo.GetVersionInfo(x.Metadata.ExecuteFilePath).FileVersion,
Author = x.Metadata.Author,
Website = x.Metadata.Website,
Disabled = x.Metadata.Disabled,
IsGlobal = x.Metadata.IsGlobal,
ActionKeyword = x.Metadata.ActionKeyword,
@ -281,7 +284,9 @@ namespace PowerLauncher
var enabledPolicyState = GPOWrapper.GetRunPluginEnabledValue(id);
plugin.Name = name;
plugin.Description = value.Description;
plugin.Version = value.Version;
plugin.Author = value.Author;
plugin.Website = value.Website;
plugin.IconPathDark = value.IconPathDark;
plugin.IconPathLight = value.IconPathLight;
plugin.EnabledPolicyUiState = (int)enabledPolicyState;

Просмотреть файл

@ -14,8 +14,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public string Description { get; set; }
public string Version { get; set; }
public string Author { get; set; }
public string Website { get; set; }
public bool Disabled { get; set; }
// Use to communicate the state to settings UI (Using int type because we can't reference GPOWrapper.)

Просмотреть файл

@ -19,6 +19,11 @@
<Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
</Style>
<x:Double x:Key="SecondaryLinkFontSize">12</x:Double>
<Style x:Key="SecondaryLinkTextStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource SecondaryTextFontSize}" />
</Style>
<x:Double x:Key="HeaderTextFontSize">12</x:Double>
<Style x:Key="HeaderTextStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource HeaderTextFontSize}" />

Просмотреть файл

@ -687,11 +687,46 @@
<tkcontrols:SettingsCard
MinHeight="0"
BorderThickness="0"
ContentAlignment="Right">
ContentAlignment="Right"
IsEnabled="{x:Bind Enabled, Mode=OneWay}">
<StackPanel
HorizontalAlignment="Right"
Orientation="Horizontal"
Spacing="4">
<TextBlock Opacity="{x:Bind DisabledOpacity}" Style="{ThemeResource SecondaryTextStyle}">
<Run x:Uid="PowerLauncher_PluginVersion" />
<Run FontWeight="SemiBold" Text="{x:Bind Version}" />
</TextBlock>
<TextBlock
AutomationProperties.Name=","
IsTabStop="False"
Opacity="{x:Bind DisabledOpacity}"
Style="{ThemeResource SecondaryTextStyle}"
Text="|" />
<TextBlock Opacity="{x:Bind DisabledOpacity}" Style="{ThemeResource SecondaryTextStyle}">
<Run x:Uid="PowerLauncher_AuthoredBy" />
<Run FontWeight="SemiBold" Text="{x:Bind Author}" />
</TextBlock>
<TextBlock
AutomationProperties.Name=","
IsTabStop="False"
Opacity="{x:Bind DisabledOpacity}"
Style="{ThemeResource SecondaryTextStyle}"
Text="|"
Visibility="{x:Bind HasValidWebsiteUri, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<HyperlinkButton
Margin="0"
Padding="0"
NavigateUri="{x:Bind WebsiteUri}"
Opacity="{x:Bind DisabledOpacity}"
Style="{StaticResource TextButtonStyle}"
Visibility="{x:Bind HasValidWebsiteUri, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
<TextBlock
x:Uid="PowerLauncher_PluginWebsite"
FontWeight="SemiBold"
Style="{ThemeResource SecondaryLinkTextStyle}" />
</HyperlinkButton>
</StackPanel>
</tkcontrols:SettingsCard>
</tkcontrols:SettingsExpander.Items>
</tkcontrols:SettingsExpander>

Просмотреть файл

@ -4698,4 +4698,10 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="Enable_Module.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Enable module</value>
</data>
<data name="PowerLauncher_PluginVersion.Text" xml:space="preserve">
<value>Version</value>
</data>
<data name="PowerLauncher_PluginWebsite.Text" xml:space="preserve">
<value>Project website</value>
</data>
</root>

Просмотреть файл

@ -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;