Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Settings > PT Run] Plugin manager: Add plugins version and website #36580

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
3 changes: 2 additions & 1 deletion doc/devdocs/modules/launcher/new-plugin-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.)
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Author": "ricardosantos9521",
"Version": "1.1.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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions src/modules/launcher/PowerLauncher/SettingsReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Abstractions;
using System.Linq;
Expand Down Expand Up @@ -251,7 +252,9 @@ private static IEnumerable<PowerLauncherPluginSettings> GetDefaultPluginsSetting
Id = x.Metadata.ID,
Name = x.Plugin == null ? x.Metadata.Name : x.Plugin.Name,
Description = x.Plugin?.Description,
Version = FileVersionInfo.GetVersionInfo(x.Metadata.ExecuteFilePath).ProductVersion,
Author = x.Metadata.Author,
Website = x.Metadata.Website,
Disabled = x.Metadata.Disabled,
IsGlobal = x.Metadata.IsGlobal,
ActionKeyword = x.Metadata.ActionKeyword,
Expand Down Expand Up @@ -281,7 +284,9 @@ private static void UpdateSettings(PowerLauncherSettings settings)
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ public class PowerLauncherPluginSettings

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.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,41 @@
MinHeight="0"
BorderThickness="0"
ContentAlignment="Right">
<TextBlock Opacity="{x:Bind DisabledOpacity}" Style="{ThemeResource SecondaryTextStyle}">
<Run x:Uid="PowerLauncher_AuthoredBy" />
<Run FontWeight="SemiBold" Text="{x:Bind Author}" />
</TextBlock>
<StackPanel
HorizontalAlignment="Right"
Orientation="Horizontal"
Spacing="5">
<TextBlock Opacity="{x:Bind DisabledOpacity}" Style="{ThemeResource SecondaryTextStyle}">
<Run x:Uid="PowerLauncher_PluginVersion" />
<Run FontWeight="SemiBold" Text="{x:Bind Version}" />
</TextBlock>
<TextBlock
htcfreek marked this conversation as resolved.
Show resolved Hide resolved
Opacity="{x:Bind DisabledOpacity}"
Style="{ThemeResource SecondaryTextStyle}"
Text="&#x2022;" />
htcfreek marked this conversation as resolved.
Show resolved Hide resolved
<TextBlock Opacity="{x:Bind DisabledOpacity}" Style="{ThemeResource SecondaryTextStyle}">
<Run x:Uid="PowerLauncher_AuthoredBy" />
<Run FontWeight="SemiBold" Text="{x:Bind Author}" />
</TextBlock>
<TextBlock
Opacity="{x:Bind DisabledOpacity}"
Style="{ThemeResource SecondaryTextStyle}"
Text="&#x2022;"
Visibility="{x:Bind HasWebsiteUri, Converter={StaticResource BoolToVisibilityConverter}}" />
<HyperlinkButton
Margin="0"
Padding="0"
NavigateUri="{x:Bind Website}"
Style="{StaticResource TextButtonStyle}"
ToolTipService.ToolTip="{x:Bind Website}"
Visibility="{x:Bind HasValidWebsiteUri, Converter={StaticResource BoolToVisibilityConverter}}">
<TextBlock
x:Uid="PowerLauncher_PluginWebsite"
FontWeight="SemiBold"
Opacity="{x:Bind DisabledOpacity}"
Style="{ThemeResource SecondaryLinkTextStyle}" />
</HyperlinkButton>
</StackPanel>
</tkcontrols:SettingsCard>
</tkcontrols:SettingsExpander.Items>
</tkcontrols:SettingsExpander>
Expand Down
8 changes: 7 additions & 1 deletion src/settings-ui/Settings.UI/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3966,7 +3966,7 @@ Activate by holding the key for the character you want to add an accent to, then
</data>
<data name="AdvancedPaste_EnableAdvancedAI.Description" xml:space="preserve">
<value>Add advanced capabilities when using 'Paste with AI' including the power to 'chain' multiple transformations together and work with images and files. This feature may consume more API credits when used.</value>
</data>
</data>
<data name="Oobe_AdvancedPaste.Description" xml:space="preserve">
<value>Advanced Paste is a tool to put your clipboard content into any format you need, focused towards developer workflows. It can paste as plain text, markdown, or json directly with the UX or with a direct keystroke invoke. These are fully locally executed. In addition, it has an AI powered option that is 100% opt-in and requires an Open AI key. Note: this will replace the formatted text in your clipboard with the selected format.</value>
</data>
Expand Down Expand Up @@ -4695,4 +4695,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>Open website</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ public PowerLauncherPluginViewModel(PowerLauncherPluginSettings settings, Func<b

public string Description { get => settings.Description; }

public string Version { get => settings.Version; }

public string Author { get => settings.Author; }

public string Website { get => settings.Website; }

public bool HasValidWebsiteUri { get => Uri.IsWellFormedUriString(settings.Website, UriKind.Absolute); }

private GpoRuleConfigured _enabledGpoRuleConfiguration;
private bool _enabledGpoRuleIsConfigured;

Expand Down
Loading