From 0040dbd8292f995b5911889a0dd1ecb92b103fb6 Mon Sep 17 00:00:00 2001 From: Aaron Junker Date: Wed, 6 Sep 2023 18:14:28 +0200 Subject: [PATCH 01/18] Update SECURITY.md from 0.0.2 to 0.0.9 (#28289) --- SECURITY.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index e6a6651e20..b3c89efc85 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,18 +1,18 @@ - + ## Security -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [many more](https://opensource.microsoft.com/). +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [definition](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). @@ -28,7 +28,7 @@ Please include the requested information listed below (as much as you can provid This information will help us triage your report more quickly. -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. ## Preferred Languages @@ -36,6 +36,6 @@ We prefer all communications to be in English. ## Policy -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). From 937e7b0c007be7c6e85ade10641cd4d6a8e308e7 Mon Sep 17 00:00:00 2001 From: Dongle <29563098+dongle-the-gadget@users.noreply.github.com> Date: Thu, 7 Sep 2023 15:36:47 +0700 Subject: [PATCH 02/18] [Deps]Upgrade to WinAppSDK 1.4 (#28310) * Update to WASDK 1.4 * Remove redundant title bar styles. * Update notice * Update C++ projects as well * Upgrade CppWinRT too * Add exception to WASDK file version set to 1.0.0.0 --------- Co-authored-by: Jaime Bernardo --- .pipelines/versionAndSignCheck.ps1 | 1 + Directory.Packages.props | 2 +- NOTICE.md | 2 +- .../PowerToysSetupCustomActions.vcxproj | 8 ++++---- .../packages.config | 2 +- src/ActionRunner/actionRunner.vcxproj | 8 ++++---- src/ActionRunner/packages.config | 2 +- src/Update/PowerToys.Update.vcxproj | 8 ++++---- src/Update/packages.config | 2 +- src/common/GPOWrapper/GPOWrapper.vcxproj | 8 ++++---- src/common/GPOWrapper/packages.config | 2 +- src/common/SettingsAPI/SettingsAPI.vcxproj | 8 ++++---- src/common/SettingsAPI/packages.config | 2 +- src/common/Themes/Themes.vcxproj | 8 ++++---- src/common/Themes/packages.config | 2 +- .../UnitTests-CommonLib.vcxproj | 8 ++++---- .../UnitTests-CommonLib/packages.config | 2 +- src/common/logger/logger.vcxproj | 8 ++++---- src/common/logger/packages.config | 2 +- .../BackgroundActivator.vcxproj | 8 ++++---- .../BackgroundActivator/packages.config | 2 +- .../BackgroundActivatorDLL.vcxproj | 8 ++++---- .../BackgroundActivatorDLL/packages.config | 2 +- .../notifications/notifications.vcxproj | 8 ++++---- src/common/notifications/packages.config | 2 +- src/common/updating/packages.config | 2 +- src/common/updating/updating.vcxproj | 8 ++++---- .../CropAndLock/CropAndLock.vcxproj | 8 ++++---- .../CropAndLock/CropAndLock/packages.config | 2 +- .../CropAndLockModuleInterface.vcxproj | 8 ++++---- .../packages.config | 2 +- .../FileLocksmithExt/FileLocksmithExt.vcxproj | 8 ++++---- .../FileLocksmithExt/packages.config | 2 +- .../FileLocksmithXAML/App.xaml | 3 --- .../HostsModuleInterface.vcxproj | 8 ++++---- .../HostsModuleInterface/packages.config | 2 +- .../PowerToys.MeasureToolCore.vcxproj | 16 +++++++-------- .../MeasureToolCore/packages.config | 4 ++-- .../MeasureToolModuleInterface.vcxproj | 8 ++++---- .../packages.config | 2 +- .../FindMyMouse/FindMyMouse.vcxproj | 8 ++++---- .../MouseUtils/FindMyMouse/packages.config | 2 +- .../MouseHighlighter/MouseHighlighter.vcxproj | 8 ++++---- .../MouseHighlighter/packages.config | 2 +- .../MouseUtils/MouseJump/MouseJump.vcxproj | 8 ++++---- .../MouseUtils/MouseJump/packages.config | 2 +- .../MousePointerCrosshairs.vcxproj | 8 ++++---- .../MousePointerCrosshairs/packages.config | 2 +- ...MouseWithoutBordersModuleInterface.vcxproj | 2 +- .../PowerOCRModuleInterface.vcxproj | 8 ++++---- .../PowerOCRModuleInterface/packages.config | 2 +- .../ShortcutGuide/ShortcutGuide.vcxproj | 8 ++++---- .../ShortcutGuide/packages.config | 2 +- .../ShortcutGuideModuleInterface.vcxproj | 8 ++++---- .../packages.config | 2 +- .../AlwaysOnTop/AlwaysOnTop.vcxproj | 8 ++++---- .../alwaysontop/AlwaysOnTop/packages.config | 2 +- .../AlwaysOnTopModuleInterface.vcxproj | 8 ++++---- .../packages.config | 2 +- .../AwakeModuleInterface.vcxproj | 8 ++++---- .../AwakeModuleInterface/packages.config | 2 +- .../ColorPicker/ColorPicker.vcxproj | 8 ++++---- .../colorPicker/ColorPicker/packages.config | 2 +- .../fancyzones/FancyZones/FancyZones.vcxproj | 8 ++++---- .../fancyzones/FancyZones/packages.config | 2 +- .../FancyZonesLib/FancyZonesLib.vcxproj | 8 ++++---- .../fancyzones/FancyZonesLib/packages.config | 2 +- .../FancyZonesModuleInterface.vcxproj | 8 ++++---- .../FancyZonesModuleInterface/packages.config | 2 +- .../UnitTests/UnitTests.vcxproj | 8 ++++---- .../FancyZonesTests/UnitTests/packages.config | 2 +- .../ImageResizerContextMenu.vcxproj | 8 ++++---- .../ImageResizerContextMenu/packages.config | 2 +- .../imageresizer/dll/ImageResizerExt.vcxproj | 8 ++++---- src/modules/imageresizer/dll/packages.config | 2 +- .../KeyboardManagerEditor.vcxproj | 8 ++++---- .../KeyboardManagerEditor/packages.config | 2 +- .../KeyboardManagerEditorLibrary.vcxproj | 8 ++++---- .../packages.config | 2 +- .../KeyboardManagerEditorTest.vcxproj | 8 ++++---- .../KeyboardManagerEditorTest/packages.config | 2 +- .../KeyboardManagerEngine.vcxproj | 8 ++++---- .../KeyboardManagerEngine/packages.config | 2 +- .../KeyboardManagerEngineLibrary.vcxproj | 8 ++++---- .../packages.config | 2 +- .../KeyboardManagerEngineTest.vcxproj | 8 ++++---- .../KeyboardManagerEngineTest/packages.config | 2 +- .../common/KeyboardManagerCommon.vcxproj | 8 ++++---- .../keyboardmanager/common/packages.config | 2 +- .../dll/KeyboardManager.vcxproj | 8 ++++---- .../keyboardmanager/dll/packages.config | 2 +- .../Microsoft.Launcher.vcxproj | 8 ++++---- .../Microsoft.Launcher/packages.config | 2 +- .../PastePlainModuleInterface.vcxproj | 8 ++++---- .../PastePlainModuleInterface/packages.config | 2 +- src/modules/peek/peek/peek.vcxproj | 8 ++++---- .../PowerAccentKeyboardService.vcxproj | 8 ++++---- .../packages.config | 2 +- .../PowerAccentModuleInterface.vcxproj | 8 ++++---- .../packages.config | 2 +- .../PowerRenameContextMenu.vcxproj | 8 ++++---- .../PowerRenameContextMenu/packages.config | 2 +- .../PowerRenameUILib/PowerRenameUI.vcxproj | 20 +++++++++---------- .../PowerRenameUI.vcxproj.filters | 13 ++++++------ .../PowerRenameUILib/packages.config | 4 ++-- .../powerrename/dll/PowerRenameExt.vcxproj | 8 ++++---- src/modules/powerrename/dll/packages.config | 2 +- .../powerrename/lib/PowerRenameLib.vcxproj | 8 ++++---- src/modules/powerrename/lib/packages.config | 2 +- .../testapp/PowerRenameTest.vcxproj | 8 ++++---- .../powerrename/testapp/packages.config | 2 +- .../unittests/PowerRenameLibUnitTests.vcxproj | 8 ++++---- .../powerrename/unittests/packages.config | 2 +- .../GcodePreviewHandlerCpp.vcxproj | 8 ++++---- .../GcodePreviewHandlerCpp/packages.config | 2 +- .../GcodeThumbnailProviderCpp.vcxproj | 8 ++++---- .../GcodeThumbnailProviderCpp/packages.config | 2 +- .../MarkdownPreviewHandlerCpp.vcxproj | 8 ++++---- .../MarkdownPreviewHandlerCpp/packages.config | 2 +- .../MonacoPreviewHandlerCpp.vcxproj | 8 ++++---- .../MonacoPreviewHandlerCpp/packages.config | 2 +- .../PdfPreviewHandlerCpp.vcxproj | 8 ++++---- .../PdfPreviewHandlerCpp/packages.config | 2 +- .../PdfThumbnailProviderCpp.vcxproj | 8 ++++---- .../PdfThumbnailProviderCpp/packages.config | 2 +- .../StlThumbnailProviderCpp.vcxproj | 8 ++++---- .../StlThumbnailProviderCpp/packages.config | 2 +- .../SvgPreviewHandlerCpp.vcxproj | 8 ++++---- .../SvgPreviewHandlerCpp/packages.config | 2 +- .../SvgThumbnailProviderCpp.vcxproj | 8 ++++---- .../SvgThumbnailProviderCpp/packages.config | 2 +- .../previewpane/powerpreview/packages.config | 2 +- .../powerpreview/powerpreview.vcxproj | 8 ++++---- .../RegistryPreviewExt.vcxproj | 8 ++++---- .../RegistryPreviewExt/packages.config | 2 +- .../RegistryPreviewXAML/App.xaml | 7 ++----- .../VideoConference.vcxproj | 8 ++++---- .../VideoConferenceModule/packages.config | 2 +- .../VideoConferenceShared.vcxproj | 8 ++++---- .../VideoConferenceShared/packages.config | 2 +- src/runner/packages.config | 2 +- src/runner/runner.vcxproj | 8 ++++---- .../Settings.UI/SettingsXAML/App.xaml | 5 +---- .../SettingsXAML/OobeWindow.xaml.cs | 13 ++++++++++++ .../BugReportTool/BugReportTool.vcxproj | 8 ++++---- .../BugReportTool/packages.config | 2 +- .../WebcamReportTool/WebcamReportTool.vcxproj | 8 ++++---- tools/WebcamReportTool/packages.config | 2 +- .../ModuleTemplateCompileTest.vcxproj | 8 ++++---- .../ModuleTemplate/packages.config | 2 +- 150 files changed, 393 insertions(+), 387 deletions(-) diff --git a/.pipelines/versionAndSignCheck.ps1 b/.pipelines/versionAndSignCheck.ps1 index 962b0942f1..8cc31f7567 100644 --- a/.pipelines/versionAndSignCheck.ps1 +++ b/.pipelines/versionAndSignCheck.ps1 @@ -14,6 +14,7 @@ $versionExceptions = @( "Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll", "Microsoft.Windows.AppLifecycle.Projection.dll", "Microsoft.Windows.System.Power.Projection.dll", + "Microsoft.Windows.Widgets.Providers.Projection.dll", "Microsoft.WindowsAppRuntime.Bootstrap.Net.dll", "Microsoft.Xaml.Interactions.dll", "Microsoft.Xaml.Interactivity.dll", diff --git a/Directory.Packages.props b/Directory.Packages.props index 53faceb474..e02ed27170 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,7 +35,7 @@ - + diff --git a/NOTICE.md b/NOTICE.md index 6e251a6157..92d55e955e 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -308,7 +308,7 @@ SOFTWARE. - Microsoft.Windows.CsWinRT 2.0.3 - Microsoft.Windows.SDK.BuildTools 10.0.22621.755 - Microsoft.Windows.SDK.Contracts 10.0.19041.1 -- Microsoft.WindowsAppSDK 1.3.230502000 +- Microsoft.WindowsAppSDK 1.4.230822000 - Microsoft.Xaml.Behaviors.WinUI.Managed 2.0.9 - Microsoft.Xaml.Behaviors.Wpf 1.1.39 - ModernWpfUI 0.9.4 diff --git a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj index 706b93e8ac..ab789ecf3a 100644 --- a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj +++ b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj @@ -1,6 +1,6 @@  - + {32f3882b-f2d6-4586-b5ed-11e39e522bd3} @@ -163,13 +163,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/installer/PowerToysSetupCustomActions/packages.config b/installer/PowerToysSetupCustomActions/packages.config index 48319b8c95..47bae1882f 100644 --- a/installer/PowerToysSetupCustomActions/packages.config +++ b/installer/PowerToysSetupCustomActions/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/ActionRunner/actionRunner.vcxproj b/src/ActionRunner/actionRunner.vcxproj index 6cc39fbcbe..ebe3fc8fc8 100644 --- a/src/ActionRunner/actionRunner.vcxproj +++ b/src/ActionRunner/actionRunner.vcxproj @@ -1,6 +1,6 @@ - + @@ -61,15 +61,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/ActionRunner/packages.config b/src/ActionRunner/packages.config index c92dd4bf0c..e11b462529 100644 --- a/src/ActionRunner/packages.config +++ b/src/ActionRunner/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/Update/PowerToys.Update.vcxproj b/src/Update/PowerToys.Update.vcxproj index 8a7e06678a..e040374754 100644 --- a/src/Update/PowerToys.Update.vcxproj +++ b/src/Update/PowerToys.Update.vcxproj @@ -1,6 +1,6 @@ - + @@ -67,15 +67,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/Update/packages.config b/src/Update/packages.config index c92dd4bf0c..e11b462529 100644 --- a/src/Update/packages.config +++ b/src/Update/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/common/GPOWrapper/GPOWrapper.vcxproj b/src/common/GPOWrapper/GPOWrapper.vcxproj index 1316b4fa41..86c34f7ec5 100644 --- a/src/common/GPOWrapper/GPOWrapper.vcxproj +++ b/src/common/GPOWrapper/GPOWrapper.vcxproj @@ -1,6 +1,6 @@ - + true true @@ -113,13 +113,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/GPOWrapper/packages.config b/src/common/GPOWrapper/packages.config index 48319b8c95..47bae1882f 100644 --- a/src/common/GPOWrapper/packages.config +++ b/src/common/GPOWrapper/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/SettingsAPI/SettingsAPI.vcxproj b/src/common/SettingsAPI/SettingsAPI.vcxproj index 7f8bc5dee5..834de6db20 100644 --- a/src/common/SettingsAPI/SettingsAPI.vcxproj +++ b/src/common/SettingsAPI/SettingsAPI.vcxproj @@ -1,6 +1,6 @@ - + 16.0 @@ -45,13 +45,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/SettingsAPI/packages.config b/src/common/SettingsAPI/packages.config index 48319b8c95..47bae1882f 100644 --- a/src/common/SettingsAPI/packages.config +++ b/src/common/SettingsAPI/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/Themes/Themes.vcxproj b/src/common/Themes/Themes.vcxproj index 510afa4eac..c60dde82a7 100644 --- a/src/common/Themes/Themes.vcxproj +++ b/src/common/Themes/Themes.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {98537082-0FDB-40DE-ABD8-0DC5A4269BAB} @@ -46,13 +46,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/Themes/packages.config b/src/common/Themes/packages.config index 48319b8c95..47bae1882f 100644 --- a/src/common/Themes/packages.config +++ b/src/common/Themes/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj b/src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj index 8ee768403b..a2e84a9cb0 100644 --- a/src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj +++ b/src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {1A066C63-64B3-45F8-92FE-664E1CCE8077} @@ -60,13 +60,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/UnitTests-CommonLib/packages.config b/src/common/UnitTests-CommonLib/packages.config index 48319b8c95..47bae1882f 100644 --- a/src/common/UnitTests-CommonLib/packages.config +++ b/src/common/UnitTests-CommonLib/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/logger/logger.vcxproj b/src/common/logger/logger.vcxproj index 5eae1656af..a371b25109 100644 --- a/src/common/logger/logger.vcxproj +++ b/src/common/logger/logger.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -80,13 +80,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/logger/packages.config b/src/common/logger/packages.config index 48319b8c95..47bae1882f 100644 --- a/src/common/logger/packages.config +++ b/src/common/logger/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/notifications/BackgroundActivator/BackgroundActivator.vcxproj b/src/common/notifications/BackgroundActivator/BackgroundActivator.vcxproj index 671f6e958f..9b4443c380 100644 --- a/src/common/notifications/BackgroundActivator/BackgroundActivator.vcxproj +++ b/src/common/notifications/BackgroundActivator/BackgroundActivator.vcxproj @@ -1,6 +1,6 @@ - + true true @@ -96,13 +96,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/notifications/BackgroundActivator/packages.config b/src/common/notifications/BackgroundActivator/packages.config index 48319b8c95..47bae1882f 100644 --- a/src/common/notifications/BackgroundActivator/packages.config +++ b/src/common/notifications/BackgroundActivator/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/notifications/BackgroundActivatorDLL/BackgroundActivatorDLL.vcxproj b/src/common/notifications/BackgroundActivatorDLL/BackgroundActivatorDLL.vcxproj index 9ac181cf45..68fca43ea5 100644 --- a/src/common/notifications/BackgroundActivatorDLL/BackgroundActivatorDLL.vcxproj +++ b/src/common/notifications/BackgroundActivatorDLL/BackgroundActivatorDLL.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {031AC72E-FA28-4AB7-B690-6F7B9C28AA73} @@ -64,7 +64,7 @@ - + @@ -78,7 +78,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/notifications/BackgroundActivatorDLL/packages.config b/src/common/notifications/BackgroundActivatorDLL/packages.config index 48319b8c95..47bae1882f 100644 --- a/src/common/notifications/BackgroundActivatorDLL/packages.config +++ b/src/common/notifications/BackgroundActivatorDLL/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/notifications/notifications.vcxproj b/src/common/notifications/notifications.vcxproj index 4225c80f5f..c667523188 100644 --- a/src/common/notifications/notifications.vcxproj +++ b/src/common/notifications/notifications.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {1D5BE09D-78C0-4FD7-AF00-AE7C1AF7C525} @@ -42,15 +42,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/notifications/packages.config b/src/common/notifications/packages.config index c92dd4bf0c..e11b462529 100644 --- a/src/common/notifications/packages.config +++ b/src/common/notifications/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/common/updating/packages.config b/src/common/updating/packages.config index c92dd4bf0c..e11b462529 100644 --- a/src/common/updating/packages.config +++ b/src/common/updating/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/common/updating/updating.vcxproj b/src/common/updating/updating.vcxproj index 04625c09cf..5dec7c902f 100644 --- a/src/common/updating/updating.vcxproj +++ b/src/common/updating/updating.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {17DA04DF-E393-4397-9CF0-84DABE11032E} @@ -60,15 +60,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj b/src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj index 3c3e2f26f1..04833d9567 100644 --- a/src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj +++ b/src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj @@ -1,6 +1,6 @@ - + true true @@ -154,7 +154,7 @@ - + @@ -162,8 +162,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/CropAndLock/CropAndLock/packages.config b/src/modules/CropAndLock/CropAndLock/packages.config index abf15d0beb..1a0b177ac1 100644 --- a/src/modules/CropAndLock/CropAndLock/packages.config +++ b/src/modules/CropAndLock/CropAndLock/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/modules/CropAndLock/CropAndLockModuleInterface/CropAndLockModuleInterface.vcxproj b/src/modules/CropAndLock/CropAndLockModuleInterface/CropAndLockModuleInterface.vcxproj index e32228c44d..7c26becd5e 100644 --- a/src/modules/CropAndLock/CropAndLockModuleInterface/CropAndLockModuleInterface.vcxproj +++ b/src/modules/CropAndLock/CropAndLockModuleInterface/CropAndLockModuleInterface.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -101,7 +101,7 @@ - + @@ -110,8 +110,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/CropAndLock/CropAndLockModuleInterface/packages.config b/src/modules/CropAndLock/CropAndLockModuleInterface/packages.config index c92dd4bf0c..e11b462529 100644 --- a/src/modules/CropAndLock/CropAndLockModuleInterface/packages.config +++ b/src/modules/CropAndLock/CropAndLockModuleInterface/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj b/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj index 53b0bd9dcf..cf3a472319 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj +++ b/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj @@ -1,6 +1,6 @@ - + @@ -267,13 +267,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithExt/packages.config b/src/modules/FileLocksmith/FileLocksmithExt/packages.config index 48319b8c95..47bae1882f 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/packages.config +++ b/src/modules/FileLocksmith/FileLocksmithExt/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/App.xaml b/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/App.xaml index 1eef3e8ec1..5e22eda94e 100644 --- a/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/App.xaml +++ b/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/App.xaml @@ -20,9 +20,6 @@ - Transparent - Transparent - + + + @@ -45,8 +66,115 @@ Color="Black" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/PowerOCR/PowerOCR/OCROverlay.xaml.cs b/src/modules/PowerOCR/PowerOCR/OCROverlay.xaml.cs index cb6f0b461a..e79d0d3ea4 100644 --- a/src/modules/PowerOCR/PowerOCR/OCROverlay.xaml.cs +++ b/src/modules/PowerOCR/PowerOCR/OCROverlay.xaml.cs @@ -7,8 +7,10 @@ using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Controls; +using System.Windows.Controls.Primitives; using System.Windows.Input; using System.Windows.Media; +using Common.UI; using ManagedCommon; using Microsoft.PowerToys.Telemetry; using PowerOCR.Helpers; @@ -27,37 +29,32 @@ public partial class OCROverlay : Window private bool isShiftDown; private Point clickedPoint; private Point shiftPoint; + private Border selectBorder = new(); + private Language? selectedLanguage; private bool IsSelecting { get; set; } - private Border selectBorder = new(); - - private DpiScale? dpiScale; - - private Point GetMousePos() => PointToScreen(Mouse.GetPosition(this)); - - private Language? selectedLanguage; - private MenuItem cancelMenuItem; - - private System.Windows.Forms.Screen? CurrentScreen - { - get; - set; - } - private double selectLeft; private double selectTop; private double xShiftDelta; private double yShiftDelta; - + private bool isComboBoxReady; private const double ActiveOpacity = 0.4; + private readonly UserSettings userSettings = new(new ThrottledActionInvoker()); - public OCROverlay() + public OCROverlay(System.Drawing.Rectangle screenRectangle) { + Left = screenRectangle.Left >= 0 ? screenRectangle.Left : screenRectangle.Left + (screenRectangle.Width / 2); + Top = screenRectangle.Top >= 0 ? screenRectangle.Top : screenRectangle.Top + (screenRectangle.Height / 2); + InitializeComponent(); - var userSettings = new UserSettings(new ThrottledActionInvoker()); + PopulateLanguageMenu(); + } + + private void PopulateLanguageMenu() + { string? selectedLanguageName = userSettings.PreferredLanguage.Value; // build context menu @@ -68,25 +65,26 @@ public partial class OCROverlay : Window } List possibleOcrLanguages = OcrEngine.AvailableRecognizerLanguages.ToList(); + + int count = 0; + foreach (Language language in possibleOcrLanguages) { MenuItem menuItem = new() { Header = language.NativeName, Tag = language, IsCheckable = true }; menuItem.IsChecked = language.DisplayName.Equals(selectedLanguageName, StringComparison.Ordinal); + LanguagesComboBox.Items.Add(language); if (language.DisplayName.Equals(selectedLanguageName, StringComparison.Ordinal)) { selectedLanguage = language; + LanguagesComboBox.SelectedIndex = count; } menuItem.Click += LanguageMenuItem_Click; CanvasContextMenu.Items.Add(menuItem); + count++; } - CanvasContextMenu.Items.Add(new Separator()); - - // ResourceLoader resourceLoader = ResourceLoader.GetForViewIndependentUse(); // resourceLoader.GetString("TextExtractor_Cancel") - cancelMenuItem = new MenuItem() { Header = "cancel" }; - cancelMenuItem.Click += CancelMenuItem_Click; - CanvasContextMenu.Items.Add(cancelMenuItem); + isComboBoxReady = true; } private void LanguageMenuItem_Click(object sender, RoutedEventArgs e) @@ -101,6 +99,7 @@ public partial class OCROverlay : Window } selectedLanguage = menuItem.Tag as Language; + LanguagesComboBox.SelectedItem = selectedLanguage; } private void Window_Loaded(object sender, RoutedEventArgs e) @@ -112,6 +111,12 @@ public partial class OCROverlay : Window BackgroundImage.Source = ImageMethods.GetWindowBoundsImage(this); BackgroundBrush.Opacity = ActiveOpacity; + + TopButtonsStackPanel.Visibility = Visibility.Visible; + +#if DEBUG + Topmost = false; +#endif } private void Window_Unloaded(object sender, RoutedEventArgs e) @@ -119,9 +124,6 @@ public partial class OCROverlay : Window BackgroundImage.Source = null; BackgroundImage.UpdateLayout(); - CurrentScreen = null; - dpiScale = null; - KeyDown -= MainWindow_KeyDown; KeyUp -= MainWindow_KeyUp; @@ -131,8 +133,6 @@ public partial class OCROverlay : Window RegionClickCanvas.MouseDown -= RegionClickCanvas_MouseDown; RegionClickCanvas.MouseUp -= RegionClickCanvas_MouseUp; RegionClickCanvas.MouseMove -= RegionClickCanvas_MouseMove; - - cancelMenuItem.Click -= CancelMenuItem_Click; } private void MainWindow_KeyUp(object sender, KeyEventArgs e) @@ -151,15 +151,7 @@ public partial class OCROverlay : Window private void MainWindow_KeyDown(object sender, KeyEventArgs e) { - switch (e.Key) - { - case Key.Escape: - WindowUtilities.CloseAllOCROverlays(); - PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCancelledEvent()); - break; - default: - break; - } + WindowUtilities.OcrOverlayKeyDown(e.Key); } private void RegionClickCanvas_MouseDown(object sender, MouseButtonEventArgs e) @@ -169,6 +161,7 @@ public partial class OCROverlay : Window return; } + TopButtonsStackPanel.Visibility = Visibility.Collapsed; RegionClickCanvas.CaptureMouse(); CursorClipper.ClipCursor(this); @@ -176,8 +169,6 @@ public partial class OCROverlay : Window selectBorder.Height = 1; selectBorder.Width = 1; - dpiScale = VisualTreeHelper.GetDpi(this); - try { RegionClickCanvas.Children.Remove(selectBorder); @@ -193,17 +184,6 @@ public partial class OCROverlay : Window Canvas.SetLeft(selectBorder, clickedPoint.X); Canvas.SetTop(selectBorder, clickedPoint.Y); - var screens = System.Windows.Forms.Screen.AllScreens; - System.Drawing.Point formsPoint = new((int)clickedPoint.X, (int)clickedPoint.Y); - foreach (var scr in screens) - { - if (scr.Bounds.Contains(formsPoint)) - { - CurrentScreen = scr; - break; - } - } - IsSelecting = true; } @@ -232,18 +212,6 @@ public partial class OCROverlay : Window double leftValue = selectLeft + xShiftDelta; double topValue = selectTop + yShiftDelta; - if (CurrentScreen is not null && dpiScale is not null) - { - double currentScreenLeft = CurrentScreen.Bounds.Left; // Should always be 0 - double currentScreenRight = CurrentScreen.Bounds.Right / dpiScale.Value.DpiScaleX; - double currentScreenTop = CurrentScreen.Bounds.Top; // Should always be 0 - double currentScreenBottom = CurrentScreen.Bounds.Bottom / dpiScale.Value.DpiScaleY; - - // this is giving issues on different monitors - // leftValue = Math.Clamp(leftValue, currentScreenLeft, currentScreenRight - selectBorder.Width); - // topValue = Math.Clamp(topValue, currentScreenTop, currentScreenBottom - selectBorder.Height); - } - clippingGeometry.Rect = new Rect( new Point(leftValue, topValue), new Size(selectBorder.Width, selectBorder.Height)); @@ -276,14 +244,13 @@ public partial class OCROverlay : Window return; } + TopButtonsStackPanel.Visibility = Visibility.Visible; IsSelecting = false; - CurrentScreen = null; CursorClipper.UnClipCursor(); RegionClickCanvas.ReleaseMouseCapture(); Matrix m = PresentationSource.FromVisual(this).CompositionTarget.TransformToDevice; - Point mPt = GetMousePos(); Point movingPoint = e.GetPosition(this); movingPoint.X *= m.M11; movingPoint.Y *= m.M22; @@ -313,27 +280,47 @@ public partial class OCROverlay : Window if (regionScaled.Width < 3 || regionScaled.Height < 3) { + BackgroundBrush.Opacity = 0; + Logger.LogInfo($"Getting clicked word, {selectedLanguage?.LanguageTag}"); grabbedText = await ImageMethods.GetClickedWord(this, new Point(xDimScaled, yDimScaled), selectedLanguage); } else { - grabbedText = await ImageMethods.GetRegionsText(this, regionScaled, selectedLanguage); + if (TableMenuItem.IsChecked) + { + Logger.LogInfo($"Getting region as table, {selectedLanguage?.LanguageTag}"); + grabbedText = await OcrExtensions.GetRegionsTextAsTableAsync(this, regionScaled, selectedLanguage); + } + else + { + Logger.LogInfo($"Standard region capture, {selectedLanguage?.LanguageTag}"); + grabbedText = await ImageMethods.GetRegionsText(this, regionScaled, selectedLanguage); + + if (SingleLineMenuItem.IsChecked) + { + Logger.LogInfo($"Making grabbed text single line"); + grabbedText = grabbedText.MakeStringSingleLine(); + } + } } - if (string.IsNullOrWhiteSpace(grabbedText) == false) + if (string.IsNullOrWhiteSpace(grabbedText)) { - try - { - Clipboard.SetText(grabbedText); - } - catch (Exception ex) - { - Logger.LogError($"Clipboard.SetText exception: {ex}"); - } - - WindowUtilities.CloseAllOCROverlays(); - PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCaptureEvent()); + BackgroundBrush.Opacity = ActiveOpacity; + return; } + + try + { + Clipboard.SetText(grabbedText); + } + catch (Exception ex) + { + Logger.LogError($"Clipboard.SetText exception: {ex}"); + } + + WindowUtilities.CloseAllOCROverlays(); + PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCaptureEvent()); } private void CancelMenuItem_Click(object sender, RoutedEventArgs e) @@ -341,4 +328,150 @@ public partial class OCROverlay : Window WindowUtilities.CloseAllOCROverlays(); PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCancelledEvent()); } + + private void LanguagesComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (sender is not ComboBox languageComboBox || !isComboBoxReady) + { + return; + } + + // TODO: Set the preferred language based upon what was chosen here + int selection = languageComboBox.SelectedIndex; + selectedLanguage = languageComboBox.SelectedItem as Language; + + Logger.LogError($"Changed language to {selectedLanguage?.LanguageTag}"); + + // Set the language in the context menu + foreach (var item in CanvasContextMenu.Items) + { + if (item is MenuItem menuItemLoop) + { + menuItemLoop.IsChecked = menuItemLoop.Tag as Language == selectedLanguage; + } + } + + switch (selection) + { + case 0: + WindowUtilities.OcrOverlayKeyDown(Key.D1); + break; + case 1: + WindowUtilities.OcrOverlayKeyDown(Key.D2); + break; + case 2: + WindowUtilities.OcrOverlayKeyDown(Key.D3); + break; + case 3: + WindowUtilities.OcrOverlayKeyDown(Key.D4); + break; + case 4: + WindowUtilities.OcrOverlayKeyDown(Key.D5); + break; + case 5: + WindowUtilities.OcrOverlayKeyDown(Key.D6); + break; + case 6: + WindowUtilities.OcrOverlayKeyDown(Key.D7); + break; + case 7: + WindowUtilities.OcrOverlayKeyDown(Key.D8); + break; + case 8: + WindowUtilities.OcrOverlayKeyDown(Key.D9); + break; + default: + break; + } + } + + private void SingleLineMenuItem_Click(object sender, RoutedEventArgs e) + { + bool isActive = CheckIfCheckingOrUnchecking(sender); + WindowUtilities.OcrOverlayKeyDown(Key.S, isActive); + } + + private void TableToggleButton_Click(object sender, RoutedEventArgs e) + { + bool isActive = CheckIfCheckingOrUnchecking(sender); + WindowUtilities.OcrOverlayKeyDown(Key.T, isActive); + } + + private void SettingsMenuItem_Click(object sender, RoutedEventArgs e) + { + WindowUtilities.CloseAllOCROverlays(); + SettingsDeepLink.OpenSettings(SettingsDeepLink.SettingsWindow.PowerOCR, false); + } + + private static bool CheckIfCheckingOrUnchecking(object? sender) + { + if (sender is ToggleButton tb && tb.IsChecked is not null) + { + return tb.IsChecked.Value; + } + + if (sender is MenuItem mi) + { + return mi.IsChecked; + } + + return false; + } + + internal void KeyPressed(Key key, bool? isActive) + { + switch (key) + { + // This case is handled in the WindowUtilities.OcrOverlayKeyDown + // case Key.Escape: + // WindowUtilities.CloseAllFullscreenGrabs(); + // break; + case Key.S: + if (isActive is null) + { + SingleLineMenuItem.IsChecked = !SingleLineMenuItem.IsChecked; + } + else + { + SingleLineMenuItem.IsChecked = isActive.Value; + } + + // Possibly save this in settings later and remember this preference + break; + case Key.T: + if (isActive is null) + { + TableToggleButton.IsChecked = !TableToggleButton.IsChecked; + } + else + { + TableToggleButton.IsChecked = isActive.Value; + } + + break; + case Key.D1: + case Key.D2: + case Key.D3: + case Key.D4: + case Key.D5: + case Key.D6: + case Key.D7: + case Key.D8: + case Key.D9: + int numberPressed = (int)key - 34; // D1 casts to 35, D2 to 36, etc. + int numberOfLanguages = LanguagesComboBox.Items.Count; + + if (numberPressed <= numberOfLanguages + && numberPressed - 1 >= 0 + && numberPressed - 1 != LanguagesComboBox.SelectedIndex + && isComboBoxReady) + { + LanguagesComboBox.SelectedIndex = numberPressed - 1; + } + + break; + default: + break; + } + } } diff --git a/src/modules/PowerOCR/PowerOCR/PowerOCR.csproj b/src/modules/PowerOCR/PowerOCR/PowerOCR.csproj index ddabc2409d..5b59ab9ef8 100644 --- a/src/modules/PowerOCR/PowerOCR/PowerOCR.csproj +++ b/src/modules/PowerOCR/PowerOCR/PowerOCR.csproj @@ -52,6 +52,7 @@ + diff --git a/src/modules/PowerOCR/PowerOCR/Settings/UserSettings.cs b/src/modules/PowerOCR/PowerOCR/Settings/UserSettings.cs index d36bf19faa..d08bc5b020 100644 --- a/src/modules/PowerOCR/PowerOCR/Settings/UserSettings.cs +++ b/src/modules/PowerOCR/PowerOCR/Settings/UserSettings.cs @@ -23,7 +23,7 @@ namespace PowerOCR.Settings private const int SettingsReadOnChangeDelayInMs = 300; private readonly IFileSystemWatcher _watcher; - private readonly object _loadingSettingsLock = new object(); + private readonly object _loadingSettingsLock = new(); [ImportingConstructor] public UserSettings(Helpers.IThrottledActionInvoker throttledActionInvoker) @@ -113,7 +113,7 @@ namespace PowerOCR.Settings // var telemetrySettings = new Telemetry.PowerOcrSettings(properties.VisibleColorFormats) // { // ActivationShortcut = properties.ActivationShortcut.ToString(), - // ActivationBehaviour = properties.ActivationAction.ToString(), + // ActivationBehavior = properties.ActivationAction.ToString(), // ColorFormatForClipboard = properties.CopiedColorRepresentation.ToString(), // ShowColorName = properties.ShowColorName, // }; diff --git a/src/modules/PowerOCR/PowerOCR/Styles/ButtonStyles.xaml b/src/modules/PowerOCR/PowerOCR/Styles/ButtonStyles.xaml new file mode 100644 index 0000000000..fab21fb3ee --- /dev/null +++ b/src/modules/PowerOCR/PowerOCR/Styles/ButtonStyles.xaml @@ -0,0 +1,695 @@ + + + + + + + + + + + + + + M 0,0 L 3.5,4 L 7,0 Z + M 0,4 L 3.5,0 L 7,4 Z + M 0,0 L 4,3.5 L 0,7 Z + F1 M 10.0,1.2 L 4.7,9.1 L 4.5,9.1 L 0,5.2 L 1.3,3.5 L 4.3,6.1L 8.3,0 L 10.0,1.2 Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/modules/PowerOCR/PowerOCR/Styles/Colors.xaml b/src/modules/PowerOCR/PowerOCR/Styles/Colors.xaml new file mode 100644 index 0000000000..97fa005753 --- /dev/null +++ b/src/modules/PowerOCR/PowerOCR/Styles/Colors.xaml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From e856e05fad210f3fb243b40ec7bbf5b746b487ea Mon Sep 17 00:00:00 2001 From: gokcekantarci <115616017+gokcekantarci@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:54:06 +0300 Subject: [PATCH 11/18] [PTRun][Shell]Select which shell is used (#28121) * [PTRun] LeaveShellOpen condition added to run command * [PTRun] Keep shell open added to shell plugin settings. * [PTRun] Unnecessary variable deleted. Formatting. * [PTRun] Variable name changed. * [PTRun] Shell selection * [PTRun] Bugfix * [PTRun] Review comments. * [PTRun] Revert commit * [PTRun] An enumaration is added to PluginAdditionalOption for selection types. --- .../Plugins/Microsoft.Plugin.Shell/Main.cs | 20 +++++++++ .../Properties/Resources.Designer.cs | 45 +++++++++++++++++++ .../Properties/Resources.resx | 15 +++++++ .../ShellPluginSettings.cs | 3 ++ .../PluginAdditionalOption.cs | 14 ++++++ .../SettingsXAML/Views/PowerLauncherPage.xaml | 20 ++++++--- .../PluginAdditionalOptionViewModel.cs | 24 +++++++++- 7 files changed, 134 insertions(+), 7 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Main.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Main.cs index 28441e0b73..d458b7996a 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Main.cs @@ -47,6 +47,21 @@ namespace Microsoft.Plugin.Shell DisplayLabel = Resources.wox_leave_shell_open, Value = _settings.LeaveShellOpen, }, + + new PluginAdditionalOption() + { + Key = "ShellCommandExecution", + DisplayLabel = Resources.wox_shell_command_execution, + SelectionTypeValue = (int)PluginAdditionalOption.SelectionType.Combobox, + ComboBoxOptions = new List + { + Resources.run_command_in_command_prompt, + Resources.run_command_in_powershell, + Resources.find_executable_file_and_run_it, + Resources.run_command_in_windows_terminal, + }, + Option = (int)_settings.Shell, + }, }; private PluginInitContext _context; @@ -418,12 +433,17 @@ namespace Microsoft.Plugin.Shell public void UpdateSettings(PowerLauncherPluginSettings settings) { var leaveShellOpen = false; + var shellOption = 2; if (settings != null && settings.AdditionalOptions != null) { var optionLeaveShellOpen = settings.AdditionalOptions.FirstOrDefault(x => x.Key == "LeaveShellOpen"); leaveShellOpen = optionLeaveShellOpen?.Value ?? leaveShellOpen; _settings.LeaveShellOpen = leaveShellOpen; + + var optionShell = settings.AdditionalOptions.FirstOrDefault(x => x.Key == "ShellCommandExecution"); + shellOption = optionShell?.Option ?? shellOption; + _settings.Shell = (ExecutionShell)shellOption; } Save(); diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Properties/Resources.Designer.cs index 0917fb2ed4..a120d9ec9b 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Properties/Resources.Designer.cs @@ -60,6 +60,42 @@ namespace Microsoft.Plugin.Shell.Properties { } } + /// + /// Looks up a localized string similar to Find executable file and run it. + /// + public static string find_executable_file_and_run_it { + get { + return ResourceManager.GetString("find_executable_file_and_run_it", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run command in Command Prompt (cmd.exe). + /// + public static string run_command_in_command_prompt { + get { + return ResourceManager.GetString("run_command_in_command_prompt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run command in PowerShell (PowerShell.exe). + /// + public static string run_command_in_powershell { + get { + return ResourceManager.GetString("run_command_in_powershell", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run command in Windows Terminal (wt.exe). + /// + public static string run_command_in_windows_terminal { + get { + return ResourceManager.GetString("run_command_in_windows_terminal", resourceCulture); + } + } + /// /// Looks up a localized string similar to Keep shell open. /// @@ -140,5 +176,14 @@ namespace Microsoft.Plugin.Shell.Properties { return ResourceManager.GetString("wox_plugin_cmd_run_as_user", resourceCulture); } } + + /// + /// Looks up a localized string similar to Shell command execution. + /// + public static string wox_shell_command_execution { + get { + return ResourceManager.GetString("wox_shell_command_execution", resourceCulture); + } + } } } diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Properties/Resources.resx index 78be672077..dbc2873046 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Properties/Resources.resx @@ -144,4 +144,19 @@ Keep shell open + + Shell command execution + + + Run command in Command Prompt (cmd.exe) + + + Run command in PowerShell (PowerShell.exe) + + + Find executable file and run it + + + Run command in Windows Terminal (wt.exe) + \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/ShellPluginSettings.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/ShellPluginSettings.cs index 494f652a37..7785d0c076 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/ShellPluginSettings.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/ShellPluginSettings.cs @@ -2,7 +2,10 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Collections.Generic; +using System.ComponentModel; +using System.Reflection; namespace Microsoft.Plugin.Shell { diff --git a/src/settings-ui/Settings.UI.Library/PluginAdditionalOption.cs b/src/settings-ui/Settings.UI.Library/PluginAdditionalOption.cs index e08e2d7eb6..362384c534 100644 --- a/src/settings-ui/Settings.UI.Library/PluginAdditionalOption.cs +++ b/src/settings-ui/Settings.UI.Library/PluginAdditionalOption.cs @@ -2,10 +2,18 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Collections.Generic; + namespace Microsoft.PowerToys.Settings.UI.Library { public class PluginAdditionalOption { + public enum SelectionType + { + Checkbox = 0, + Combobox = 1, + } + public string Key { get; set; } public string DisplayLabel { get; set; } @@ -16,5 +24,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library public string DisplayDescription { get; set; } public bool Value { get; set; } + + public List ComboBoxOptions { get; set; } + + public int Option { get; set; } + + public int SelectionTypeValue { get; set; } } } diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerLauncherPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerLauncherPage.xaml index 9eaa02f9c2..8df089122a 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerLauncherPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerLauncherPage.xaml @@ -444,11 +444,21 @@ BorderThickness="0,0,0,0" ContentAlignment="Left" CornerRadius="0"> - + + + + _additionalOption.DisplayLabel; } + public string DisplayLabel => _additionalOption.DisplayLabel; - public string DisplayDescription { get => _additionalOption.DisplayDescription; } + public string DisplayDescription => _additionalOption.DisplayDescription; public bool Value { @@ -34,6 +35,25 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels } } + public List ComboBoxOptions => _additionalOption.ComboBoxOptions; + + public int Option + { + get => _additionalOption.Option; + set + { + if (value != _additionalOption.Option) + { + _additionalOption.Option = value; + NotifyPropertyChanged(); + } + } + } + + public bool ShowComboBox => _additionalOption.SelectionTypeValue == (int)PluginAdditionalOption.SelectionType.Combobox && _additionalOption.ComboBoxOptions != null && _additionalOption.ComboBoxOptions.Count > 0; + + public bool ShowCheckBox => _additionalOption.SelectionTypeValue == (int)PluginAdditionalOption.SelectionType.Checkbox; + public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged([CallerMemberName] string propertyName = "") From 76de2de123f3b6755e7a342d22e0106e1a56ec28 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Mon, 11 Sep 2023 14:33:12 -0500 Subject: [PATCH 12/18] Switch away from the WinDev agent pools (#28503) Using our own pools like this gives us a lot of freedom in the tooling that's installed, the OS versions it targets, and when we take on Visual Studio updates. As part of this effort, I've also stood up a "small" agent pool. At the time of this PR, that pool is using D2ads-v5 SKU VMs (2 vcore 8 GiB) versus the "large" agent pool's D8as-v5 (8 vcore 32 GiB). Smaller build tasks can in the future be moved over to the small pool. Compilation's the hard part, so it gets to stay on the large pool. --- .pipelines/ci/templates/build-powertoys-ci.yml | 6 +++--- .pipelines/ci/templates/build-powertoys-installer.yml | 2 +- .pipelines/release.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pipelines/ci/templates/build-powertoys-ci.yml b/.pipelines/ci/templates/build-powertoys-ci.yml index b180fb50d0..c21ecd2712 100644 --- a/.pipelines/ci/templates/build-powertoys-ci.yml +++ b/.pipelines/ci/templates/build-powertoys-ci.yml @@ -12,11 +12,11 @@ jobs: NUGET_RESTORE_MSBUILD_ARGS: /p:Platform=${{ parameters.platform }} # Required for nuget to work due to self contained NODE_OPTIONS: --max_old_space_size=16384 pool: - demands: ImageOverride -equals WinDevVS17-latest + demands: ImageOverride -equals SHINE-VS17-Latest ${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}: - name: WinDevPoolOSS-L + name: SHINE-OSS-L ${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}: - name: WinDevPool-L + name: SHINE-INT-L timeoutInMinutes: 120 strategy: maxParallel: 10 diff --git a/.pipelines/ci/templates/build-powertoys-installer.yml b/.pipelines/ci/templates/build-powertoys-installer.yml index ab99af8e54..1756171cf2 100644 --- a/.pipelines/ci/templates/build-powertoys-installer.yml +++ b/.pipelines/ci/templates/build-powertoys-installer.yml @@ -10,7 +10,7 @@ jobs: BuildConfiguration: ${{ parameters.configuration }} BuildPlatform: ${{ parameters.platform }} pool: - name: WinDevPool-L + name: SHINE-INT-L timeoutInMinutes: 120 strategy: maxParallel: 10 diff --git a/.pipelines/release.yml b/.pipelines/release.yml index 7c889c2fe7..2d002a9cf9 100644 --- a/.pipelines/release.yml +++ b/.pipelines/release.yml @@ -3,8 +3,8 @@ trigger: none pr: none pool: - name: WinDevPool-L - demands: ImageOverride -equals WinDevVS17-latest + name: SHINE-INT-L + demands: ImageOverride -equals SHINE-VS17-Latest parameters: - name: buildConfigurations From 184c61839893acdd40b081bdcc2fb5157458a3b2 Mon Sep 17 00:00:00 2001 From: Davide Giacometti Date: Tue, 12 Sep 2023 11:28:25 +0200 Subject: [PATCH 13/18] [Hosts]Entries context menu refactoring (#28367) --- .../Hosts/Hosts/HostsXAML/Views/MainPage.xaml | 122 +++++++++--------- .../Hosts/HostsXAML/Views/MainPage.xaml.cs | 113 +++------------- 2 files changed, 82 insertions(+), 153 deletions(-) diff --git a/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml b/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml index 25a9f725ef..6c59b6f4e1 100644 --- a/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml +++ b/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml @@ -41,11 +41,11 @@ Margin="16" RowSpacing="8"> - - + + - +