mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -2,7 +2,7 @@ blank_issues_enabled: false
|
|||||||
contact_links:
|
contact_links:
|
||||||
- name: "\U0001F4F7 Video Conference Mute Issue"
|
- name: "\U0001F4F7 Video Conference Mute Issue"
|
||||||
url: https://github.com/microsoft/PowerToys/issues/6246
|
url: https://github.com/microsoft/PowerToys/issues/6246
|
||||||
about: Report Bug for the Video Conference Mute utiltity
|
about: Report Bug for the Video Conference Mute utility
|
||||||
- name: "\U0001F6A8 Microsoft Security Response Center (MSRC)"
|
- name: "\U0001F6A8 Microsoft Security Response Center (MSRC)"
|
||||||
url: https://msrc.microsoft.com/create-report
|
url: https://msrc.microsoft.com/create-report
|
||||||
about: Report security bugs
|
about: Report security bugs
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ Install the [pre-release experimental version of PowerToys][github-prerelease-li
|
|||||||
|
|
||||||
### Other install methods
|
### Other install methods
|
||||||
|
|
||||||
There are [community driven install methods](./doc/unofficalInstallMethods.md) such as Chocolatey and Scoop. If these are your preferred install solutions, this will have the install instructions.
|
There are [community driven install methods](./doc/unofficialInstallMethods.md) such as Chocolatey and Scoop. If these are your preferred install solutions, this will have the install instructions.
|
||||||
|
|
||||||
### Known issues
|
### Known issues
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ The following basic functions are common to each of the plugins. They perform so
|
|||||||
Each plugin implements the `IPlugin` interface which comprises of the `Init()` and `Query()` functions.
|
Each plugin implements the `IPlugin` interface which comprises of the `Init()` and `Query()` functions.
|
||||||
|
|
||||||
### `Init`
|
### `Init`
|
||||||
- The `Init()` function initializes the context, storage and settings of each plugin. This is equivalent to a contructor and is the first function to be called in the `Main.cs` file for each plugin.
|
- The `Init()` function initializes the context, storage and settings of each plugin. This is equivalent to a constructor and is the first function to be called in the `Main.cs` file for each plugin.
|
||||||
|
|
||||||
### `Query`
|
### `Query`
|
||||||
- For every query that the user enters into PT Run, the `PluginManager.cs` executes the `Query()` function in the `Main.cs` file corresponding to each Plugin.
|
- For every query that the user enters into PT Run, the `PluginManager.cs` executes the `Query()` function in the `Main.cs` file corresponding to each Plugin.
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ Our installer is two parts, an EXE and an MSI. The EXE contains the MSI and han
|
|||||||
- From the `installer` folder open `PowerToysSetup.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`, from the `Build` menu choose `Build Solution`.
|
- From the `installer` folder open `PowerToysSetup.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`, from the `Build` menu choose `Build Solution`.
|
||||||
- The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder.
|
- The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder.
|
||||||
|
|
||||||
### Compiling Bootstraper Installer (.EXE)
|
### Compiling Bootstrapper Installer (.EXE)
|
||||||
|
|
||||||
- MSI Installer needs to be built in release mode
|
- MSI Installer needs to be built in release mode
|
||||||
- Build `PowerToysBootstrapper` solution (`installer\PowerToysBootstrapper\`)
|
- Build `PowerToysBootstrapper` solution (`installer\PowerToysBootstrapper\`)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ The viewmodels are located within the [`Microsoft.PowerToys.Settings.UI.Library`
|
|||||||
### Settings viewmodel anomalies
|
### Settings viewmodel anomalies
|
||||||
- The reason behind using the `SettingsRepository` is to ensure that the settings process does not try to access the `settings.json` files directly but rather does it through this class which encapsulates all the file operations from the viewmodels.
|
- The reason behind using the `SettingsRepository` is to ensure that the settings process does not try to access the `settings.json` files directly but rather does it through this class which encapsulates all the file operations from the viewmodels.
|
||||||
- However, this could not be expanded to all the viewmodels directly for the following reasons. Some refactoring must be done to unify these cases and to bring them under the same model:
|
- However, this could not be expanded to all the viewmodels directly for the following reasons. Some refactoring must be done to unify these cases and to bring them under the same model:
|
||||||
- The PowerRename viewodel does not save the settings configurations in the same format as the rest of the powertoys, ie. {name, version, properties}. However, it only stores the properties directly.
|
- The PowerRename viewmodel does not save the settings configurations in the same format as the rest of the powertoys, ie. {name, version, properties}. However, it only stores the properties directly.
|
||||||
- Some viewmodels expect the runner to create the file instead of creating the file themselves, like in keyboard manager.
|
- Some viewmodels expect the runner to create the file instead of creating the file themselves, like in keyboard manager.
|
||||||
- The colorpicker powertoy creates the `settings.json` within the module. This must be taken care of when encapsulated within the settingsRepository.
|
- The colorpicker powertoy creates the `settings.json` within the module. This must be taken care of when encapsulated within the settingsRepository.
|
||||||
- Currently, all modules use the `SettingsRepository` to access the General Settings config.
|
- Currently, all modules use the `SettingsRepository` to access the General Settings config.
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
|
|
||||||
[assembly: SuppressMessage("Microsoft.Design", "CA1009:DeclareEventHandlersCorrectly", Scope = "member", Target = "Microsoft.Templates.Core.Locations.TemplatesSynchronization.#SyncStatusChanged", Justification = "Using an Action<object, SyncStatusEventArgs> does not allow the required notation")]
|
[assembly: SuppressMessage("Microsoft.Design", "CA1009:DeclareEventHandlersCorrectly", Scope = "member", Target = "Microsoft.Templates.Core.Locations.TemplatesSynchronization.#SyncStatusChanged", Justification = "Using an Action<object, SyncStatusEventArgs> does not allow the required notation")]
|
||||||
|
|
||||||
// Non general supressions
|
// Non general suppressions
|
||||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "The WebBrowser is loading source code to be shown to the user. No localization required.", MessageId = "System.Windows.Controls.WebBrowser.NavigateToString(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Controls.CodeViewer.#UpdateCodeView(System.Func`2<System.String,System.String>,System.String,System.String,System.Boolean)")]
|
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "The WebBrowser is loading source code to be shown to the user. No localization required.", MessageId = "System.Windows.Controls.WebBrowser.NavigateToString(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Controls.CodeViewer.#UpdateCodeView(System.Func`2<System.String,System.String>,System.String,System.String,System.Boolean)")]
|
||||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "This is part of the markdown processing", MessageId = "System.Windows.Documents.Run.#ctor(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Controls.Markdown.#ImageInlineEvaluator(System.Text.RegularExpressions.Match)")]
|
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "This is part of the markdown processing", MessageId = "System.Windows.Documents.Run.#ctor(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Controls.Markdown.#ImageInlineEvaluator(System.Text.RegularExpressions.Match)")]
|
||||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer especification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.ITemplateInfoExtensions.#GetQueryableProperties(Microsoft.TemplateEngine.Abstractions.ITemplateInfo)")]
|
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer specification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.ITemplateInfoExtensions.#GetQueryableProperties(Microsoft.TemplateEngine.Abstractions.ITemplateInfo)")]
|
||||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer especification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.Composition.CompositionQuery.#Match(System.Collections.Generic.IEnumerable`1<Microsoft.Templates.Core.Composition.QueryNode>,Microsoft.Templates.Core.Composition.QueryablePropertyDictionary)")]
|
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer specification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.Composition.CompositionQuery.#Match(System.Collections.Generic.IEnumerable`1<Microsoft.Templates.Core.Composition.QueryNode>,Microsoft.Templates.Core.Composition.QueryablePropertyDictionary)")]
|
||||||
[assembly: SuppressMessage("Usage", "VSTHRD103:Call async methods when in an async method", Justification = "Resource DictionaryWriter does not implement flush async", Scope = "member", Target = "~M:Microsoft.Templates.Core.PostActions.Catalog.Merge.MergeResourceDictionaryPostAction.ExecuteInternalAsync~System.Threading.Tasks.Task")]
|
[assembly: SuppressMessage("Usage", "VSTHRD103:Call async methods when in an async method", Justification = "Resource DictionaryWriter does not implement flush async", Scope = "member", Target = "~M:Microsoft.Templates.Core.PostActions.Catalog.Merge.MergeResourceDictionaryPostAction.ExecuteInternalAsync~System.Threading.Tasks.Task")]
|
||||||
|
|
||||||
// Threading supressions
|
// Threading suppressions
|
||||||
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.Controls.Notification.OnClose")]
|
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.Controls.Notification.OnClose")]
|
||||||
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.ViewModels.Common.SavedTemplateViewModel.OnDelete")]
|
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.ViewModels.Common.SavedTemplateViewModel.OnDelete")]
|
||||||
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.ViewModels.Common.WizardNavigation.GoBack")]
|
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.ViewModels.Common.WizardNavigation.GoBack")]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RuleSet Name="PowerToys Rules" Description="Based on Microsoft Minimum Recomended Rules and customized to include other required rules. These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="15.0">
|
<RuleSet Name="PowerToys Rules" Description="Based on Microsoft Minimum Recommended Rules and customized to include other required rules. These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="15.0">
|
||||||
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
|
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
|
||||||
<Rule Id="CA1001" Action="Warning" />
|
<Rule Id="CA1001" Action="Warning" />
|
||||||
<Rule Id="CA1009" Action="Warning" />
|
<Rule Id="CA1009" Action="Warning" />
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
|
|||||||
|
|
||||||
public bool CreateDirectory(string path)
|
public bool CreateDirectory(string path)
|
||||||
{
|
{
|
||||||
var directioryInfo = _directory.CreateDirectory(path);
|
var directoryInfo = _directory.CreateDirectory(path);
|
||||||
return directioryInfo != null;
|
return directoryInfo != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteDirectory(string path)
|
public void DeleteDirectory(string path)
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
|||||||
shellPage.Refresh();
|
shellPage.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// XAML Islands: If the window is open, explicity force it to be shown to solve the blank dialog issue https://github.com/microsoft/PowerToys/issues/3384
|
// XAML Islands: If the window is open, explicitly force it to be shown to solve the blank dialog issue https://github.com/microsoft/PowerToys/issues/3384
|
||||||
if (isOpen)
|
if (isOpen)
|
||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace ViewModelTests
|
|||||||
ColorPickerViewModel viewModel = new ColorPickerViewModel(mockSettingsUtils, generalSettingsRepository, ColorPickerIsEnabledByDefaultIPC);
|
ColorPickerViewModel viewModel = new ColorPickerViewModel(mockSettingsUtils, generalSettingsRepository, ColorPickerIsEnabledByDefaultIPC);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
// Verifiy that the old settings persisted
|
// Verify that the old settings persisted
|
||||||
Assert.AreEqual(originalGeneralSettings.Enabled.ColorPicker, viewModel.IsEnabled);
|
Assert.AreEqual(originalGeneralSettings.Enabled.ColorPicker, viewModel.IsEnabled);
|
||||||
Assert.AreEqual(originalSettings.Properties.ActivationShortcut.ToString(), viewModel.ActivationShortcut.ToString());
|
Assert.AreEqual(originalSettings.Properties.ActivationShortcut.ToString(), viewModel.ActivationShortcut.ToString());
|
||||||
Assert.AreEqual(originalSettings.Properties.ChangeCursor, viewModel.ChangeCursor);
|
Assert.AreEqual(originalSettings.Properties.ChangeCursor, viewModel.ChangeCursor);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace ViewModelTests
|
|||||||
// Initialise View Model with test Config files
|
// Initialise View Model with test Config files
|
||||||
FancyZonesViewModel viewModel = new FancyZonesViewModel(generalSettingsRepository, fancyZonesRepository, ColorPickerIsEnabledByDefault_IPC);
|
FancyZonesViewModel viewModel = new FancyZonesViewModel(generalSettingsRepository, fancyZonesRepository, ColorPickerIsEnabledByDefault_IPC);
|
||||||
|
|
||||||
// Verifiy that the old settings persisted
|
// Verify that the old settings persisted
|
||||||
Assert.AreEqual(originalGeneralSettings.Enabled.FancyZones, viewModel.IsEnabled);
|
Assert.AreEqual(originalGeneralSettings.Enabled.FancyZones, viewModel.IsEnabled);
|
||||||
Assert.AreEqual(originalSettings.Properties.FancyzonesAppLastZoneMoveWindows.Value, viewModel.AppLastZoneMoveWindows);
|
Assert.AreEqual(originalSettings.Properties.FancyzonesAppLastZoneMoveWindows.Value, viewModel.AppLastZoneMoveWindows);
|
||||||
Assert.AreEqual(originalSettings.Properties.FancyzonesBorderColor.Value, viewModel.ZoneBorderColor);
|
Assert.AreEqual(originalSettings.Properties.FancyzonesBorderColor.Value, viewModel.ZoneBorderColor);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace ViewModelTests
|
|||||||
ipcMSGCheckForUpdatesCallBackFunc: SendCheckForUpdatesIPCMessage,
|
ipcMSGCheckForUpdatesCallBackFunc: SendCheckForUpdatesIPCMessage,
|
||||||
configFileSubfolder: string.Empty);
|
configFileSubfolder: string.Empty);
|
||||||
|
|
||||||
// Verifiy that the old settings persisted
|
// Verify that the old settings persisted
|
||||||
Assert.AreEqual(originalGeneralSettings.AutoDownloadUpdates, viewModel.AutoDownloadUpdates);
|
Assert.AreEqual(originalGeneralSettings.AutoDownloadUpdates, viewModel.AutoDownloadUpdates);
|
||||||
Assert.AreEqual(originalGeneralSettings.Packaged, viewModel.Packaged);
|
Assert.AreEqual(originalGeneralSettings.Packaged, viewModel.Packaged);
|
||||||
Assert.AreEqual(originalGeneralSettings.PowertoysVersion, viewModel.PowerToysVersion);
|
Assert.AreEqual(originalGeneralSettings.PowertoysVersion, viewModel.PowerToysVersion);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace ViewModelTests
|
|||||||
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
||||||
ImageResizerViewModel viewModel = new ImageResizerViewModel(mockSettingsUtils, generalSettingsRepository, SendMockIPCConfigMSG);
|
ImageResizerViewModel viewModel = new ImageResizerViewModel(mockSettingsUtils, generalSettingsRepository, SendMockIPCConfigMSG);
|
||||||
|
|
||||||
// Verifiy that the old settings persisted
|
// Verify that the old settings persisted
|
||||||
Assert.AreEqual(originalGeneralSettings.Enabled.ImageResizer, viewModel.IsEnabled);
|
Assert.AreEqual(originalGeneralSettings.Enabled.ImageResizer, viewModel.IsEnabled);
|
||||||
Assert.AreEqual(ImageResizerViewModel.GetEncoderIndex(originalSettings.Properties.ImageresizerFallbackEncoder.Value), viewModel.Encoder);
|
Assert.AreEqual(ImageResizerViewModel.GetEncoderIndex(originalSettings.Properties.ImageresizerFallbackEncoder.Value), viewModel.Encoder);
|
||||||
Assert.AreEqual(originalSettings.Properties.ImageresizerFileName.Value, viewModel.FileName);
|
Assert.AreEqual(originalSettings.Properties.ImageresizerFileName.Value, viewModel.FileName);
|
||||||
@@ -240,7 +240,7 @@ namespace ViewModelTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void UpdateWidthAndHeightShouldUpateSizeWhenCorrectValuesAreProvided()
|
public void UpdateWidthAndHeightShouldUpdateSizeWhenCorrectValuesAreProvided()
|
||||||
{
|
{
|
||||||
// arrange
|
// arrange
|
||||||
ImageSize imageSize = new ImageSize()
|
ImageSize imageSize = new ImageSize()
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace ViewModelTests
|
|||||||
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
||||||
PowerLauncherViewModel viewModel = new PowerLauncherViewModel(mockSettingsUtils, generalSettingsRepository, SendMockIPCConfigMSG, 32);
|
PowerLauncherViewModel viewModel = new PowerLauncherViewModel(mockSettingsUtils, generalSettingsRepository, SendMockIPCConfigMSG, 32);
|
||||||
|
|
||||||
// Verifiy that the old settings persisted
|
// Verify that the old settings persisted
|
||||||
Assert.AreEqual(originalGeneralSettings.Enabled.PowerLauncher, viewModel.EnablePowerLauncher);
|
Assert.AreEqual(originalGeneralSettings.Enabled.PowerLauncher, viewModel.EnablePowerLauncher);
|
||||||
Assert.AreEqual(originalSettings.Properties.ClearInputOnLaunch, viewModel.ClearInputOnLaunch);
|
Assert.AreEqual(originalSettings.Properties.ClearInputOnLaunch, viewModel.ClearInputOnLaunch);
|
||||||
Assert.AreEqual(originalSettings.Properties.CopyPathLocation.ToString(), viewModel.CopyPathLocation.ToString());
|
Assert.AreEqual(originalSettings.Properties.CopyPathLocation.ToString(), viewModel.CopyPathLocation.ToString());
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace ViewModelTests
|
|||||||
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
||||||
PowerPreviewViewModel viewModel = new PowerPreviewViewModel(repository, generalSettingsRepository, SendMockIPCConfigMSG);
|
PowerPreviewViewModel viewModel = new PowerPreviewViewModel(repository, generalSettingsRepository, SendMockIPCConfigMSG);
|
||||||
|
|
||||||
// Verifiy that the old settings persisted
|
// Verify that the old settings persisted
|
||||||
Assert.AreEqual(originalGeneralSettings.IsElevated, viewModel.IsElevated);
|
Assert.AreEqual(originalGeneralSettings.IsElevated, viewModel.IsElevated);
|
||||||
Assert.AreEqual(originalSettings.Properties.EnableMdPreview, viewModel.MDRenderIsEnabled);
|
Assert.AreEqual(originalSettings.Properties.EnableMdPreview, viewModel.MDRenderIsEnabled);
|
||||||
Assert.AreEqual(originalSettings.Properties.EnableSvgPreview, viewModel.SVGRenderIsEnabled);
|
Assert.AreEqual(originalSettings.Properties.EnableSvgPreview, viewModel.SVGRenderIsEnabled);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace ViewModelTests
|
|||||||
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
||||||
PowerRenameViewModel viewModel = new PowerRenameViewModel(mockSettingsUtils, generalSettingsRepository, SendMockIPCConfigMSG);
|
PowerRenameViewModel viewModel = new PowerRenameViewModel(mockSettingsUtils, generalSettingsRepository, SendMockIPCConfigMSG);
|
||||||
|
|
||||||
// Verifiy that the old settings persisted
|
// Verify that the old settings persisted
|
||||||
Assert.AreEqual(originalGeneralSettings.Enabled.PowerRename, viewModel.IsEnabled);
|
Assert.AreEqual(originalGeneralSettings.Enabled.PowerRename, viewModel.IsEnabled);
|
||||||
Assert.AreEqual(originalSettings.ExtendedContextMenuOnly, viewModel.EnabledOnContextExtendedMenu);
|
Assert.AreEqual(originalSettings.ExtendedContextMenuOnly, viewModel.EnabledOnContextExtendedMenu);
|
||||||
Assert.AreEqual(originalSettings.MRUEnabled, viewModel.MRUEnabled);
|
Assert.AreEqual(originalSettings.MRUEnabled, viewModel.MRUEnabled);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace ViewModelTests
|
|||||||
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
Func<string, int> SendMockIPCConfigMSG = msg => { return 0; };
|
||||||
ShortcutGuideViewModel viewModel = new ShortcutGuideViewModel(generalSettingsRepository, shortcutSettingsRepository, SendMockIPCConfigMSG);
|
ShortcutGuideViewModel viewModel = new ShortcutGuideViewModel(generalSettingsRepository, shortcutSettingsRepository, SendMockIPCConfigMSG);
|
||||||
|
|
||||||
// Verifiy that the old settings persisted
|
// Verify that the old settings persisted
|
||||||
Assert.AreEqual(originalGeneralSettings.Enabled.ShortcutGuide, viewModel.IsEnabled);
|
Assert.AreEqual(originalGeneralSettings.Enabled.ShortcutGuide, viewModel.IsEnabled);
|
||||||
Assert.AreEqual(originalSettings.Properties.OverlayOpacity.Value, viewModel.OverlayOpacity);
|
Assert.AreEqual(originalSettings.Properties.OverlayOpacity.Value, viewModel.OverlayOpacity);
|
||||||
Assert.AreEqual(originalSettings.Properties.PressTime.Value, viewModel.PressTime);
|
Assert.AreEqual(originalSettings.Properties.PressTime.Value, viewModel.PressTime);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Microsoft.PowerToys.Settings.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore", Justification = "Interop naming consistancy")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore", Justification = "Interop naming consistency")]
|
||||||
public const int SW_HIDE = 0;
|
public const int SW_HIDE = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ using Microsoft.PowerToys.Settings.UI.Library;
|
|||||||
namespace ColorPicker.Helpers
|
namespace ColorPicker.Helpers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper class to easier work with color represantation
|
/// Helper class to easier work with color representation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class ColorRepresentationHelper
|
internal static class ColorRepresentationHelper
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ namespace ColorPicker.Helpers
|
|||||||
{
|
{
|
||||||
public interface IThrottledActionInvoker
|
public interface IThrottledActionInvoker
|
||||||
{
|
{
|
||||||
void ScheduleAction(Action action, int miliseconds);
|
void ScheduleAction(Action action, int milliseconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace ColorPicker.Helpers
|
|||||||
_timer.Tick += Timer_Tick;
|
_timer.Tick += Timer_Tick;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScheduleAction(Action action, int miliseconds)
|
public void ScheduleAction(Action action, int milliseconds)
|
||||||
{
|
{
|
||||||
if (_timer.IsEnabled)
|
if (_timer.IsEnabled)
|
||||||
{
|
{
|
||||||
@@ -29,7 +29,7 @@ namespace ColorPicker.Helpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
_actionToRun = action;
|
_actionToRun = action;
|
||||||
_timer.Interval = new TimeSpan(0, 0, 0, 0, miliseconds);
|
_timer.Interval = new TimeSpan(0, 0, 0, 0, milliseconds);
|
||||||
|
|
||||||
_timer.Start();
|
_timer.Start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,24 +370,24 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
if (delta > 0)
|
if (delta > 0)
|
||||||
{
|
{
|
||||||
int sourcRow = 0;
|
int sourceRow = 0;
|
||||||
for (int row = 0; row < rows; row++)
|
for (int row = 0; row < rows; row++)
|
||||||
{
|
{
|
||||||
for (int col = 0; col < cols; col++)
|
for (int col = 0; col < cols; col++)
|
||||||
{
|
{
|
||||||
if (row == draggedResizerStartRow + 1 && (col < resizer.StartCol || col >= resizer.EndCol))
|
if (row == draggedResizerStartRow + 1 && (col < resizer.StartCol || col >= resizer.EndCol))
|
||||||
{
|
{
|
||||||
newCellChildMap[row, col] = cellChildMap[sourcRow + 1, col];
|
newCellChildMap[row, col] = cellChildMap[sourceRow + 1, col];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newCellChildMap[row, col] = cellChildMap[sourcRow, col];
|
newCellChildMap[row, col] = cellChildMap[sourceRow, col];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row != draggedResizerStartRow)
|
if (row != draggedResizerStartRow)
|
||||||
{
|
{
|
||||||
sourcRow++;
|
sourceRow++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -461,10 +461,10 @@ namespace FancyZonesEditor
|
|||||||
_resizers.Clear();
|
_resizers.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasSnappedNonAdjascentResizers(GridResizer resizer)
|
public bool HasSnappedNonAdjacentResizers(GridResizer resizer)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Resizers between zones 0,1 and 4,5 are snapped to each other and not adjascent.
|
* Resizers between zones 0,1 and 4,5 are snapped to each other and not adjacent.
|
||||||
* ------------------------------
|
* ------------------------------
|
||||||
* | 0 | 1 |
|
* | 0 | 1 |
|
||||||
* ------------------------------
|
* ------------------------------
|
||||||
@@ -473,7 +473,7 @@ namespace FancyZonesEditor
|
|||||||
* | 4 | 5 |
|
* | 4 | 5 |
|
||||||
* ------------------------------
|
* ------------------------------
|
||||||
*
|
*
|
||||||
* Resizers between zones 0,1 and 2,3 are snapped to each other and adjascent.
|
* Resizers between zones 0,1 and 2,3 are snapped to each other and adjacent.
|
||||||
* ------------------------------
|
* ------------------------------
|
||||||
* | 0 | 1 |
|
* | 0 | 1 |
|
||||||
* ------------------------------
|
* ------------------------------
|
||||||
@@ -484,7 +484,7 @@ namespace FancyZonesEditor
|
|||||||
*
|
*
|
||||||
* Vertical resizers should have same StartColumn and different StartRow.
|
* Vertical resizers should have same StartColumn and different StartRow.
|
||||||
* Horizontal resizers should have same StartRow and different StartColumn.
|
* Horizontal resizers should have same StartRow and different StartColumn.
|
||||||
* Difference between rows or colums should be more than 1.
|
* Difference between rows or columns should be more than 1.
|
||||||
*/
|
*/
|
||||||
foreach (GridResizer r in _resizers)
|
foreach (GridResizer r in _resizers)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ namespace FancyZonesEditor
|
|||||||
GridData.ResizeInfo resizeInfo = _data.CalculateResizeInfo(resizer, delta);
|
GridData.ResizeInfo resizeInfo = _data.CalculateResizeInfo(resizer, delta);
|
||||||
if (resizeInfo.IsResizeAllowed)
|
if (resizeInfo.IsResizeAllowed)
|
||||||
{
|
{
|
||||||
if (_dragHandles.HasSnappedNonAdjascentResizers(resizer))
|
if (_dragHandles.HasSnappedNonAdjacentResizers(resizer))
|
||||||
{
|
{
|
||||||
double spacing = 0;
|
double spacing = 0;
|
||||||
Settings settings = ((App)Application.Current).ZoneSettings;
|
Settings settings = ((App)Application.Current).ZoneSettings;
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ IFACEMETHODIMP_(void) FancyZonesSettings::CallCustomAction(PCWSTR action) noexce
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
// Currently only custom action comming from main PowerToys window is request to launch editor.
|
// Currently only custom action coming from main PowerToys window is request to launch editor.
|
||||||
// If new custom action is added, error message need to be modified.
|
// If new custom action is added, error message need to be modified.
|
||||||
std::wstring errorMessage = GET_RESOURCE_STRING(IDS_FANCYZONES_EDITOR_LAUNCH_ERROR) + L" " + NonLocalizable::PowerToysIssuesURL;
|
std::wstring errorMessage = GET_RESOURCE_STRING(IDS_FANCYZONES_EDITOR_LAUNCH_ERROR) + L" " + NonLocalizable::PowerToysIssuesURL;
|
||||||
MessageBox(NULL,
|
MessageBox(NULL,
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace VirtualDesktopUtils
|
|||||||
// Second fallback scenario is to get array of virtual desktops stored in registry, but not kept per
|
// Second fallback scenario is to get array of virtual desktops stored in registry, but not kept per
|
||||||
// session. Note that we are taking first element from virtual desktop array, which is primary desktop.
|
// session. Note that we are taking first element from virtual desktop array, which is primary desktop.
|
||||||
// If user has more than one virtual desktop, one of previous functions should return correct value,
|
// If user has more than one virtual desktop, one of previous functions should return correct value,
|
||||||
// as desktop switch occured in current session.
|
// as desktop switch occurred in current session.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::vector<GUID> ids{};
|
std::vector<GUID> ids{};
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
|
|
||||||
[assembly: SuppressMessage("Microsoft.Design", "CA1009:DeclareEventHandlersCorrectly", Scope = "member", Target = "Microsoft.Templates.Core.Locations.TemplatesSynchronization.#SyncStatusChanged", Justification = "Using an Action<object, SyncStatusEventArgs> does not allow the required notation")]
|
[assembly: SuppressMessage("Microsoft.Design", "CA1009:DeclareEventHandlersCorrectly", Scope = "member", Target = "Microsoft.Templates.Core.Locations.TemplatesSynchronization.#SyncStatusChanged", Justification = "Using an Action<object, SyncStatusEventArgs> does not allow the required notation")]
|
||||||
|
|
||||||
// Non general supressions
|
// Non general suppressions
|
||||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "The WebBrowser is loading source code to be shown to the user. No localization required.", MessageId = "System.Windows.Controls.WebBrowser.NavigateToString(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Controls.CodeViewer.#UpdateCodeView(System.Func`2<System.String,System.String>,System.String,System.String,System.Boolean)")]
|
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "The WebBrowser is loading source code to be shown to the user. No localization required.", MessageId = "System.Windows.Controls.WebBrowser.NavigateToString(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Controls.CodeViewer.#UpdateCodeView(System.Func`2<System.String,System.String>,System.String,System.String,System.Boolean)")]
|
||||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "This is part of the markdown processing", MessageId = "System.Windows.Documents.Run.#ctor(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Controls.Markdown.#ImageInlineEvaluator(System.Text.RegularExpressions.Match)")]
|
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "This is part of the markdown processing", MessageId = "System.Windows.Documents.Run.#ctor(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Controls.Markdown.#ImageInlineEvaluator(System.Text.RegularExpressions.Match)")]
|
||||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer especification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.ITemplateInfoExtensions.#GetQueryableProperties(Microsoft.TemplateEngine.Abstractions.ITemplateInfo)")]
|
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer specification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.ITemplateInfoExtensions.#GetQueryableProperties(Microsoft.TemplateEngine.Abstractions.ITemplateInfo)")]
|
||||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer especification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.Composition.CompositionQuery.#Match(System.Collections.Generic.IEnumerable`1<Microsoft.Templates.Core.Composition.QueryNode>,Microsoft.Templates.Core.Composition.QueryablePropertyDictionary)")]
|
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer specification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.Composition.CompositionQuery.#Match(System.Collections.Generic.IEnumerable`1<Microsoft.Templates.Core.Composition.QueryNode>,Microsoft.Templates.Core.Composition.QueryablePropertyDictionary)")]
|
||||||
[assembly: SuppressMessage("Usage", "VSTHRD103:Call async methods when in an async method", Justification = "Resource DictionaryWriter does not implement flush async", Scope = "member", Target = "~M:Microsoft.Templates.Core.PostActions.Catalog.Merge.MergeResourceDictionaryPostAction.ExecuteInternalAsync~System.Threading.Tasks.Task")]
|
[assembly: SuppressMessage("Usage", "VSTHRD103:Call async methods when in an async method", Justification = "Resource DictionaryWriter does not implement flush async", Scope = "member", Target = "~M:Microsoft.Templates.Core.PostActions.Catalog.Merge.MergeResourceDictionaryPostAction.ExecuteInternalAsync~System.Threading.Tasks.Task")]
|
||||||
|
|
||||||
// Threading supressions
|
// Threading suppressions
|
||||||
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.Controls.Notification.OnClose")]
|
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.Controls.Notification.OnClose")]
|
||||||
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.ViewModels.Common.SavedTemplateViewModel.OnDelete")]
|
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.ViewModels.Common.SavedTemplateViewModel.OnDelete")]
|
||||||
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.ViewModels.Common.WizardNavigation.GoBack")]
|
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.ViewModels.Common.WizardNavigation.GoBack")]
|
||||||
|
|||||||
@@ -270,13 +270,13 @@ namespace KeyboardManagerHelper
|
|||||||
return process_name;
|
return process_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to set key events for modifier keys: When shortcutToCompare is passed (non-empty shortcut), then the key event is sent only if both shortcut's don't have the same modifier key. When keyToBeReleased is passed (non-NULL), then the key event is sent if either the shortcuts don't have the same modfifier or if the shortcutToBeSent's modifier matches the keyToBeReleased
|
// Function to set key events for modifier keys: When shortcutToCompare is passed (non-empty shortcut), then the key event is sent only if both shortcut's don't have the same modifier key. When keyToBeReleased is passed (non-NULL), then the key event is sent if either the shortcuts don't have the same modifier or if the shortcutToBeSent's modifier matches the keyToBeReleased
|
||||||
void SetModifierKeyEvents(const Shortcut& shortcutToBeSent, const ModifierKey& winKeyInvoked, LPINPUT keyEventArray, int& index, bool isKeyDown, ULONG_PTR extraInfoFlag, const Shortcut& shortcutToCompare, const DWORD& keyToBeReleased)
|
void SetModifierKeyEvents(const Shortcut& shortcutToBeSent, const ModifierKey& winKeyInvoked, LPINPUT keyEventArray, int& index, bool isKeyDown, ULONG_PTR extraInfoFlag, const Shortcut& shortcutToCompare, const DWORD& keyToBeReleased)
|
||||||
{
|
{
|
||||||
// If key down is to be sent, send in the order Win, Ctrl, Alt, Shift
|
// If key down is to be sent, send in the order Win, Ctrl, Alt, Shift
|
||||||
if (isKeyDown)
|
if (isKeyDown)
|
||||||
{
|
{
|
||||||
// If shortcutToCompare is non-empty, then the key event is sent only if both shortcut's don't have the same modifier key. If keyToBeReleased is non-NULL, then the key event is sent if either the shortcuts don't have the same modfifier or if the shortcutToBeSent's modifier matches the keyToBeReleased
|
// If shortcutToCompare is non-empty, then the key event is sent only if both shortcut's don't have the same modifier key. If keyToBeReleased is non-NULL, then the key event is sent if either the shortcuts don't have the same modifier or if the shortcutToBeSent's modifier matches the keyToBeReleased
|
||||||
if (shortcutToBeSent.GetWinKey(winKeyInvoked) != NULL && (shortcutToCompare.IsEmpty() || shortcutToBeSent.GetWinKey(winKeyInvoked) != shortcutToCompare.GetWinKey(winKeyInvoked)) && (keyToBeReleased == NULL || !shortcutToBeSent.CheckWinKey(keyToBeReleased)))
|
if (shortcutToBeSent.GetWinKey(winKeyInvoked) != NULL && (shortcutToCompare.IsEmpty() || shortcutToBeSent.GetWinKey(winKeyInvoked) != shortcutToCompare.GetWinKey(winKeyInvoked)) && (keyToBeReleased == NULL || !shortcutToBeSent.CheckWinKey(keyToBeReleased)))
|
||||||
{
|
{
|
||||||
KeyboardManagerHelper::SetKeyEvent(keyEventArray, index, INPUT_KEYBOARD, (WORD)shortcutToBeSent.GetWinKey(winKeyInvoked), 0, extraInfoFlag);
|
KeyboardManagerHelper::SetKeyEvent(keyEventArray, index, INPUT_KEYBOARD, (WORD)shortcutToBeSent.GetWinKey(winKeyInvoked), 0, extraInfoFlag);
|
||||||
@@ -302,7 +302,7 @@ namespace KeyboardManagerHelper
|
|||||||
// If key up is to be sent, send in the order Shift, Alt, Ctrl, Win
|
// If key up is to be sent, send in the order Shift, Alt, Ctrl, Win
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If shortcutToCompare is non-empty, then the key event is sent only if both shortcut's don't have the same modifier key. If keyToBeReleased is non-NULL, then the key event is sent if either the shortcuts don't have the same modfifier or if the shortcutToBeSent's modifier matches the keyToBeReleased
|
// If shortcutToCompare is non-empty, then the key event is sent only if both shortcut's don't have the same modifier key. If keyToBeReleased is non-NULL, then the key event is sent if either the shortcuts don't have the same modifier or if the shortcutToBeSent's modifier matches the keyToBeReleased
|
||||||
if (shortcutToBeSent.GetShiftKey() != NULL && (shortcutToCompare.IsEmpty() || shortcutToBeSent.GetShiftKey() != shortcutToCompare.GetShiftKey() || shortcutToBeSent.CheckShiftKey(keyToBeReleased)))
|
if (shortcutToBeSent.GetShiftKey() != NULL && (shortcutToCompare.IsEmpty() || shortcutToBeSent.GetShiftKey() != shortcutToCompare.GetShiftKey() || shortcutToBeSent.CheckShiftKey(keyToBeReleased)))
|
||||||
{
|
{
|
||||||
KeyboardManagerHelper::SetKeyEvent(keyEventArray, index, INPUT_KEYBOARD, (WORD)shortcutToBeSent.GetShiftKey(), KEYEVENTF_KEYUP, extraInfoFlag);
|
KeyboardManagerHelper::SetKeyEvent(keyEventArray, index, INPUT_KEYBOARD, (WORD)shortcutToBeSent.GetShiftKey(), KEYEVENTF_KEYUP, extraInfoFlag);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace KeyboardManagerHelper
|
|||||||
// Function to return the executable name of the application in focus
|
// Function to return the executable name of the application in focus
|
||||||
std::wstring GetCurrentApplication(bool keepPath);
|
std::wstring GetCurrentApplication(bool keepPath);
|
||||||
|
|
||||||
// Function to set key events for modifier keys: When shortcutToCompare is passed (non-empty shortcut), then the key event is sent only if both shortcut's don't have the same modifier key. When keyToBeReleased is passed (non-NULL), then the key event is sent if either the shortcuts don't have the same modfifier or if the shortcutToBeSent's modifier matches the keyToBeReleased
|
// Function to set key events for modifier keys: When shortcutToCompare is passed (non-empty shortcut), then the key event is sent only if both shortcut's don't have the same modifier key. When keyToBeReleased is passed (non-NULL), then the key event is sent if either the shortcuts don't have the same modifier or if the shortcutToBeSent's modifier matches the keyToBeReleased
|
||||||
void SetModifierKeyEvents(const Shortcut& shortcutToBeSent, const ModifierKey& winKeyInvoked, LPINPUT keyEventArray, int& index, bool isKeyDown, ULONG_PTR extraInfoFlag, const Shortcut& shortcutToCompare = Shortcut(), const DWORD& keyToBeReleased = NULL);
|
void SetModifierKeyEvents(const Shortcut& shortcutToBeSent, const ModifierKey& winKeyInvoked, LPINPUT keyEventArray, int& index, bool isKeyDown, ULONG_PTR extraInfoFlag, const Shortcut& shortcutToCompare = Shortcut(), const DWORD& keyToBeReleased = NULL);
|
||||||
|
|
||||||
// Function to filter the key codes for artificial key codes
|
// Function to filter the key codes for artificial key codes
|
||||||
|
|||||||
@@ -618,13 +618,13 @@ std::wstring KeyboardManagerState::GetCurrentConfigName()
|
|||||||
return currentConfig;
|
return currentConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets the activated target application in app-specfic shortcut
|
// Sets the activated target application in app-specific shortcut
|
||||||
void KeyboardManagerState::SetActivatedApp(const std::wstring& appName)
|
void KeyboardManagerState::SetActivatedApp(const std::wstring& appName)
|
||||||
{
|
{
|
||||||
activatedAppSpecificShortcutTarget = appName;
|
activatedAppSpecificShortcutTarget = appName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the activated target application in app-specfic shortcut
|
// Gets the activated target application in app-specific shortcut
|
||||||
std::wstring KeyboardManagerState::GetActivatedApp()
|
std::wstring KeyboardManagerState::GetActivatedApp()
|
||||||
{
|
{
|
||||||
return activatedAppSpecificShortcutTarget;
|
return activatedAppSpecificShortcutTarget;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ private:
|
|||||||
std::map<DWORD, std::unique_ptr<KeyDelay>> keyDelays;
|
std::map<DWORD, std::unique_ptr<KeyDelay>> keyDelays;
|
||||||
std::mutex keyDelays_mutex;
|
std::mutex keyDelays_mutex;
|
||||||
|
|
||||||
// Stores the activated target application in app-specfic shortcut
|
// Stores the activated target application in app-specific shortcut
|
||||||
std::wstring activatedAppSpecificShortcutTarget;
|
std::wstring activatedAppSpecificShortcutTarget;
|
||||||
|
|
||||||
// Thread safe boolean value to check if remappings are currently enabled. This is used to disable remappings while the remap tables are being updated by the UI thread
|
// Thread safe boolean value to check if remappings are currently enabled. This is used to disable remappings while the remap tables are being updated by the UI thread
|
||||||
@@ -225,10 +225,10 @@ public:
|
|||||||
// Gets the Current Active Configuration Name.
|
// Gets the Current Active Configuration Name.
|
||||||
std::wstring GetCurrentConfigName();
|
std::wstring GetCurrentConfigName();
|
||||||
|
|
||||||
// Sets the activated target application in app-specfic shortcut
|
// Sets the activated target application in app-specific shortcut
|
||||||
void SetActivatedApp(const std::wstring& appName);
|
void SetActivatedApp(const std::wstring& appName);
|
||||||
|
|
||||||
// Gets the activated target application in app-specfic shortcut
|
// Gets the activated target application in app-specific shortcut
|
||||||
std::wstring GetActivatedApp();
|
std::wstring GetActivatedApp();
|
||||||
|
|
||||||
bool AreRemappingsEnabled();
|
bool AreRemappingsEnabled();
|
||||||
|
|||||||
@@ -2237,7 +2237,7 @@ namespace RemappingLogicTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test that shortcut is not disabled if the shortcut which was remapped to Disable is pressed followed by another key
|
// Test that shortcut is not disabled if the shortcut which was remapped to Disable is pressed followed by another key
|
||||||
TEST_METHOD (ShortcutDisable_ShouldNotDisableShortcutSuperset_AfterShorcutWasDisabled)
|
TEST_METHOD (ShortcutDisable_ShouldNotDisableShortcutSuperset_AfterShortcutWasDisabled)
|
||||||
{
|
{
|
||||||
Shortcut src;
|
Shortcut src;
|
||||||
src.SetKey(VK_CONTROL);
|
src.SetKey(VK_CONTROL);
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ namespace Microsoft.Plugin.Indexer
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Function to add the context menu item to run as admin
|
// Function to add the context menu item to run as admin
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "We want to keep the process alive, and instead log the exeption message")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "We want to keep the process alive, and instead log the exception message")]
|
||||||
private static ContextMenuResult CreateRunAsAdminContextMenu(SearchResult record)
|
private static ContextMenuResult CreateRunAsAdminContextMenu(SearchResult record)
|
||||||
{
|
{
|
||||||
return new ContextMenuResult
|
return new ContextMenuResult
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Microsoft.Plugin.Program.UnitTests.ProgramArgumentParser
|
|||||||
var argumentParsers = new IProgramArgumentParser[]
|
var argumentParsers = new IProgramArgumentParser[]
|
||||||
{
|
{
|
||||||
new DoubleDashProgramArgumentParser(),
|
new DoubleDashProgramArgumentParser(),
|
||||||
new InferedProgramArgumentParser(),
|
new InferredProgramArgumentParser(),
|
||||||
new NoArgumentsArgumentParser(),
|
new NoArgumentsArgumentParser(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Assert that this does not throw. Collections that aren't syncronized will throw an invalidoperatioexception if the list is modified while enumerating
|
// Assert that this does not throw. Collections that aren't synchronized will throw an invalidoperatioexception if the list is modified while enumerating
|
||||||
await Task.WhenAll(new Task[] { iterationTask, addTask }).ConfigureAwait(false);
|
await Task.WhenAll(new Task[] { iterationTask, addTask }).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Assert that this does not throw. Collections that aren't syncronized will throw an invalidoperatioexception if the list is modified while enumerating
|
// Assert that this does not throw. Collections that aren't synchronized will throw an invalidoperatioexception if the list is modified while enumerating
|
||||||
await Task.WhenAll(new Task[] { iterationTask, addTask }).ConfigureAwait(false);
|
await Task.WhenAll(new Task[] { iterationTask, addTask }).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Microsoft.Plugin.Program
|
|||||||
private static readonly IProgramArgumentParser[] _programArgumentParsers = new IProgramArgumentParser[]
|
private static readonly IProgramArgumentParser[] _programArgumentParsers = new IProgramArgumentParser[]
|
||||||
{
|
{
|
||||||
new DoubleDashProgramArgumentParser(),
|
new DoubleDashProgramArgumentParser(),
|
||||||
new InferedProgramArgumentParser(),
|
new InferredProgramArgumentParser(),
|
||||||
new NoArgumentsArgumentParser(),
|
new NoArgumentsArgumentParser(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Wox.Plugin;
|
|||||||
|
|
||||||
namespace Microsoft.Plugin.Program
|
namespace Microsoft.Plugin.Program
|
||||||
{
|
{
|
||||||
public class InferedProgramArgumentParser : IProgramArgumentParser
|
public class InferredProgramArgumentParser : IProgramArgumentParser
|
||||||
{
|
{
|
||||||
private static readonly Regex ArgumentPrefixRegex = new Regex("^(-|--|/)[a-zA-Z]+", RegexOptions.Compiled);
|
private static readonly Regex ArgumentPrefixRegex = new Regex("^(-|--|/)[a-zA-Z]+", RegexOptions.Compiled);
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ namespace Microsoft.Plugin.Program.Programs
|
|||||||
Version = PackageVersion.Unknown;
|
Version = PackageVersion.Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentially keeping the process alive.")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentionally keeping the process alive.")]
|
||||||
public static UWPApplication[] All()
|
public static UWPApplication[] All()
|
||||||
{
|
{
|
||||||
var windows10 = new Version(10, 0);
|
var windows10 = new Version(10, 0);
|
||||||
@@ -172,7 +172,7 @@ namespace Microsoft.Plugin.Program.Programs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentially keeping the process alive.")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentionally keeping the process alive.")]
|
||||||
private static IEnumerable<IPackage> CurrentUserPackages()
|
private static IEnumerable<IPackage> CurrentUserPackages()
|
||||||
{
|
{
|
||||||
var ps = PackageManagerWrapper.FindPackagesForCurrentUser();
|
var ps = PackageManagerWrapper.FindPackagesForCurrentUser();
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ namespace Microsoft.Plugin.Program.Programs
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentially keeping the process alive.")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentionally keeping the process alive.")]
|
||||||
public List<ContextMenuResult> ContextMenus(string queryArguments, IPublicAPI api)
|
public List<ContextMenuResult> ContextMenus(string queryArguments, IPublicAPI api)
|
||||||
{
|
{
|
||||||
if (api == null)
|
if (api == null)
|
||||||
@@ -202,7 +202,7 @@ namespace Microsoft.Plugin.Program.Programs
|
|||||||
return contextMenus;
|
return contextMenus;
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentially keeping the process alive, and showing the user an error message")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentionally keeping the process alive, and showing the user an error message")]
|
||||||
private async void Launch(IPublicAPI api, string queryArguments)
|
private async void Launch(IPublicAPI api, string queryArguments)
|
||||||
{
|
{
|
||||||
var appManager = new ApplicationActivationHelper.ApplicationActivationManager();
|
var appManager = new ApplicationActivationHelper.ApplicationActivationManager();
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ namespace Microsoft.Plugin.Program.Programs
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentially keeping the process alive.")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentionally keeping the process alive.")]
|
||||||
public List<ContextMenuResult> ContextMenus(string queryArguments, IPublicAPI api)
|
public List<ContextMenuResult> ContextMenus(string queryArguments, IPublicAPI api)
|
||||||
{
|
{
|
||||||
if (api == null)
|
if (api == null)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Microsoft.Plugin.Program.Storage
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A repository for storing packaged applications such as UWP apps or appx packaged desktop apps.
|
/// A repository for storing packaged applications such as UWP apps or appx packaged desktop apps.
|
||||||
/// This repository will also monitor for changes to the PackageCatelog and update the repository accordingly
|
/// This repository will also monitor for changes to the PackageCatalog and update the repository accordingly
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class PackageRepository : ListRepository<UWPApplication>, IProgramRepository
|
internal class PackageRepository : ListRepository<UWPApplication>, IProgramRepository
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ namespace Microsoft.Plugin.Program.Storage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentially keeping the process alive>")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentionally keeping the process alive>")]
|
||||||
private void OnAppRenamed(object sender, RenamedEventArgs e)
|
private void OnAppRenamed(object sender, RenamedEventArgs e)
|
||||||
{
|
{
|
||||||
string oldPath = e.OldFullPath;
|
string oldPath = e.OldFullPath;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Microsoft.Plugin.Uri
|
|||||||
private readonly PluginJsonStorage<UriSettings> _storage;
|
private readonly PluginJsonStorage<UriSettings> _storage;
|
||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
private UriSettings _uriSettings;
|
private UriSettings _uriSettings;
|
||||||
private RegisteryWrapper _registeryWrapper;
|
private RegistryWrapper _registryWrapper;
|
||||||
|
|
||||||
public Main()
|
public Main()
|
||||||
{
|
{
|
||||||
@@ -34,7 +34,7 @@ namespace Microsoft.Plugin.Uri
|
|||||||
_uriSettings = _storage.Load();
|
_uriSettings = _storage.Load();
|
||||||
_uriParser = new ExtendedUriParser();
|
_uriParser = new ExtendedUriParser();
|
||||||
_uriResolver = new UriResolver();
|
_uriResolver = new UriResolver();
|
||||||
_registeryWrapper = new RegisteryWrapper();
|
_registryWrapper = new RegistryWrapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string BrowserIconPath { get; set; }
|
public string BrowserIconPath { get; set; }
|
||||||
@@ -113,14 +113,14 @@ namespace Microsoft.Plugin.Uri
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var progId = _registeryWrapper.GetRegistryValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice", "ProgId");
|
var progId = _registryWrapper.GetRegistryValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice", "ProgId");
|
||||||
var programLocation =
|
var programLocation =
|
||||||
|
|
||||||
// Resolve App Icon (UWP)
|
// Resolve App Icon (UWP)
|
||||||
_registeryWrapper.GetRegistryValue("HKEY_CLASSES_ROOT\\" + progId + "\\Application", "ApplicationIcon")
|
_registryWrapper.GetRegistryValue("HKEY_CLASSES_ROOT\\" + progId + "\\Application", "ApplicationIcon")
|
||||||
|
|
||||||
// Resolves default file association icon (UWP + Normal)
|
// Resolves default file association icon (UWP + Normal)
|
||||||
?? _registeryWrapper.GetRegistryValue("HKEY_CLASSES_ROOT\\" + progId + "\\DefaultIcon", null);
|
?? _registryWrapper.GetRegistryValue("HKEY_CLASSES_ROOT\\" + progId + "\\DefaultIcon", null);
|
||||||
|
|
||||||
// "Handles 'Indirect Strings' (UWP programs)"
|
// "Handles 'Indirect Strings' (UWP programs)"
|
||||||
// Using Ordinal since this is internal and used with a symbol
|
// Using Ordinal since this is internal and used with a symbol
|
||||||
@@ -152,7 +152,7 @@ namespace Microsoft.Plugin.Uri
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
BrowserIconPath = DefaultIconPath;
|
BrowserIconPath = DefaultIconPath;
|
||||||
Log.Exception("Exception when retreiving icon", e, GetType());
|
Log.Exception("Exception when retrieving icon", e, GetType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using Microsoft.Win32;
|
|||||||
|
|
||||||
namespace Microsoft.Plugin.Uri
|
namespace Microsoft.Plugin.Uri
|
||||||
{
|
{
|
||||||
public class RegisteryWrapper : IRegistryWrapper
|
public class RegistryWrapper : IRegistryWrapper
|
||||||
{
|
{
|
||||||
public string GetRegistryValue(string registryLocation, string valueName)
|
public string GetRegistryValue(string registryLocation, string valueName)
|
||||||
{
|
{
|
||||||
@@ -167,7 +167,7 @@ namespace Wox.Infrastructure
|
|||||||
return new MatchResult(false, UserSettingSearchPrecision);
|
return new MatchResult(false, UserSettingSearchPrecision);
|
||||||
}
|
}
|
||||||
|
|
||||||
// To get the index of the closest space which preceeds the first matching index
|
// To get the index of the closest space which precedes the first matching index
|
||||||
private static int CalculateClosestSpaceIndex(List<int> spaceIndices, int firstMatchIndex)
|
private static int CalculateClosestSpaceIndex(List<int> spaceIndices, int firstMatchIndex)
|
||||||
{
|
{
|
||||||
if (spaceIndices.Count == 0)
|
if (spaceIndices.Count == 0)
|
||||||
|
|||||||
@@ -127,6 +127,6 @@
|
|||||||
</data>
|
</data>
|
||||||
<data name="filesfolder_verifybothfolderfilesequal_failed" xml:space="preserve">
|
<data name="filesfolder_verifybothfolderfilesequal_failed" xml:space="preserve">
|
||||||
<value>Unable to verify folders and files between {0} and {1}</value>
|
<value>Unable to verify folders and files between {0} and {1}</value>
|
||||||
<comment>paramaters: fromPath, toPath</comment>
|
<comment>parameters: fromPath, toPath</comment>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -178,7 +178,7 @@ namespace Wox.Test
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void QueryBuilderShouldSetTermsCorrentlyWhenCalled()
|
public void QueryBuilderShouldSetTermsCorrectlyWhenCalled()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
string searchQuery = "abcd efgh";
|
string searchQuery = "abcd efgh";
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ namespace Microsoft.PowerToys.ThumbnailHandler.Svg
|
|||||||
public IStream Stream { get; private set; }
|
public IStream Stream { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maxium dimension (width or height) thumbnail we will generate.
|
/// The maximum dimension (width or height) thumbnail we will generate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const uint MaxThumbnailSize = 10000;
|
private const uint MaxThumbnailSize = 10000;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Captures an image representation of browser contents.
|
/// Captures an image representation of browser contents.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="browser">The WebBrowser instance rendring the SVG.</param>
|
/// <param name="browser">The WebBrowser instance rendering the SVG.</param>
|
||||||
/// <param name="rectangle">The client rectangle to capture from.</param>
|
/// <param name="rectangle">The client rectangle to capture from.</param>
|
||||||
/// <param name="backgroundColor">The default background color to apply.</param>
|
/// <param name="backgroundColor">The default background color to apply.</param>
|
||||||
/// <returns>A Bitmap representing the browser contents.</returns>
|
/// <returns>A Bitmap representing the browser contents.</returns>
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ void run_settings_window()
|
|||||||
settings_isUserAnAdmin = L"false";
|
settings_isUserAnAdmin = L"false";
|
||||||
}
|
}
|
||||||
|
|
||||||
// create general settings file to initialze the settings file with installation configurations like :
|
// create general settings file to initialize the settings file with installation configurations like :
|
||||||
// 1. Run on start up.
|
// 1. Run on start up.
|
||||||
PTSettingsHelper::save_general_settings(save_settings.to_json());
|
PTSettingsHelper::save_general_settings(save_settings.to_json());
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ int GetHighlightedZoneIdx(const std::vector<RECT>& zones, const POINT& cursorPos
|
|||||||
|
|
||||||
void ShowZoneWindow()
|
void ShowZoneWindow()
|
||||||
{
|
{
|
||||||
// InvalidateRect will esentially send WM_PAINT to main window.
|
// InvalidateRect will essentially send WM_PAINT to main window.
|
||||||
UINT flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE;
|
UINT flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE;
|
||||||
SetWindowPos(mainWindow, nullptr, 0, 0, 0, 0, flags);
|
SetWindowPos(mainWindow, nullptr, 0, 0, 0, 0, flags);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user