diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index f3cc098738..c6c654db51 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -399,6 +399,7 @@ ddd ddee ddf Deact +DECLAR declspec decltype Dedup @@ -663,6 +664,7 @@ Functiondiscoverykeys fwlink fwrite fxcop +FZE gabime GAC gacutil @@ -1299,6 +1301,7 @@ MSDN msedge mshtmdid msi +MSIFASTINSTALL MSIHANDLE MSIINSTALLER MSIL @@ -1434,6 +1437,7 @@ ntdll NTFS NTSTATUS nuget +null nullopt nullptr NUMLOCK @@ -2092,6 +2096,7 @@ todo toggleswitch toolbar Toolchain +toolkitconverters toolset toolstrip tooltip @@ -2311,6 +2316,7 @@ WINDOWPOSCHANGED WINDOWPOSCHANGING Windowsapp WINDOWSBUILDNUMBER +Windowscodecs windowsdesktop windowssearch windowsx diff --git a/installer/PowerToysSetup/Product.wxs b/installer/PowerToysSetup/Product.wxs index 3f8a9dedef..5d1b3b7fda 100644 --- a/installer/PowerToysSetup/Product.wxs +++ b/installer/PowerToysSetup/Product.wxs @@ -197,7 +197,8 @@ /> - + + @@ -791,7 +792,7 @@ - + diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp index bb52d9c707..061b4fef61 100644 --- a/installer/PowerToysSetupCustomActions/CustomAction.cpp +++ b/installer/PowerToysSetupCustomActions/CustomAction.cpp @@ -774,10 +774,14 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall) } processes.resize(bytes / sizeof(processes[0])); - std::array processesToTerminate = { + std::array processesToTerminate = { L"PowerLauncher.exe", L"PowerToys.Settings.exe", + L"PowerToys.Awake.exe", + L"PowerToys.FancyZones.exe", L"Microsoft.PowerToys.Settings.UI.exe", + L"FancyZonesEditor.exe", + L"ColorPickerUI.exe", L"PowerToys.exe" }; diff --git a/src/common/interop/PowerToysInterop.vcxproj b/src/common/interop/PowerToysInterop.vcxproj index fb2d207fb9..a73ba06b16 100644 --- a/src/common/interop/PowerToysInterop.vcxproj +++ b/src/common/interop/PowerToysInterop.vcxproj @@ -55,7 +55,7 @@ stdcpp17 - Mf.lib;WindowsApp.lib;%(AdditionalDependencies) + WindowsApp.lib;%(AdditionalDependencies) diff --git a/src/common/interop/interop.cpp b/src/common/interop/interop.cpp index 6dd4dc151b..6a6169d8d2 100644 --- a/src/common/interop/interop.cpp +++ b/src/common/interop/interop.cpp @@ -179,6 +179,10 @@ public return gcnew String(CommonSharedConstants::RUN_EXIT_EVENT); } + static String ^ FZEExitEvent() { + return gcnew String(CommonSharedConstants::FZE_EXIT_EVENT); + } + static String ^ ColorPickerSendSettingsTelemetryEvent() { return gcnew String(CommonSharedConstants::COLOR_PICKER_SEND_SETTINGS_TELEMETRY_EVENT); } diff --git a/src/common/interop/shared_constants.h b/src/common/interop/shared_constants.h index 9c882e8675..8547703c92 100644 --- a/src/common/interop/shared_constants.h +++ b/src/common/interop/shared_constants.h @@ -18,6 +18,8 @@ namespace CommonSharedConstants const wchar_t RUN_SEND_SETTINGS_TELEMETRY_EVENT[] = L"Local\\PowerToysRunInvokeEvent-638ec522-0018-4b96-837d-6bd88e06f0d6"; const wchar_t RUN_EXIT_EVENT[] = L"Local\\PowerToysRunExitEvent-3e38e49d-a762-4ef1-88f2-fd4bc7481516"; + + const wchar_t FZE_EXIT_EVENT[] = L"Local\\PowerToys-FZE-ExitEvent-ca8c73de-a52c-4274-b691-46e9592d3b43"; const wchar_t COLOR_PICKER_SEND_SETTINGS_TELEMETRY_EVENT[] = L"Local\\ColorPickerSettingsTelemetryEvent-6c7071d8-4014-46ec-b687-913bd8a422f1"; diff --git a/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml b/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml index e733178df1..6d93a42951 100644 --- a/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml +++ b/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml @@ -297,6 +297,7 @@ + { + var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, interop.Constants.FZEExitEvent()); + if (eventHandle.WaitOne()) + { + Environment.Exit(0); + } + }).Start(); } private void OnStartup(object sender, StartupEventArgs e) diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditor.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditor.xaml index a1e82be18e..cd666caaa1 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditor.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditor.xaml @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:FancyZonesEditor" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml index f483b4374f..a25fe4dc4b 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/CanvasEditorWindow.xaml @@ -34,8 +34,7 @@ - diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/ClickAutomationEventButton.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/ClickAutomationEventButton.xaml.cs new file mode 100644 index 0000000000..607f85a215 --- /dev/null +++ b/src/modules/fancyzones/editor/FancyZonesEditor/ClickAutomationEventButton.xaml.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation +// 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.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Peers; +using System.Windows.Automation.Provider; +using System.Windows.Controls; + +namespace FancyZonesEditor +{ + public partial class ClickAutomationEventButton : Button + { + public ClickAutomationEventButton() + : base() + { + InitializeComponent(); + Click += OnClick; + } + + public string OnClickAutomationValue + { + get { return (string)GetValue(OnClickAutomationValueProperty); } + set { SetValue(OnClickAutomationValueProperty, value); } + } + + public static readonly DependencyProperty OnClickAutomationValueProperty = + DependencyProperty.Register( + "Value", typeof(string), typeof(ClickAutomationEventButton)); + + private void OnClick(object sender, RoutedEventArgs e) + { + if (AutomationPeer.ListenerExists(AutomationEvents.PropertyChanged)) + { + ClickAutomationEventButtonAutomationPeer peer = + UIElementAutomationPeer.FromElement(this) as ClickAutomationEventButtonAutomationPeer; + + if (peer != null) + { + peer.RaisePropertyChangedEvent( + ValuePatternIdentifiers.ValueProperty, + null, + OnClickAutomationValue); + } + } + } + + protected override AutomationPeer OnCreateAutomationPeer() + { + return new ClickAutomationEventButtonAutomationPeer(this); + } + + public class ClickAutomationEventButtonAutomationPeer : FrameworkElementAutomationPeer, IValueProvider + { + public ClickAutomationEventButtonAutomationPeer(ClickAutomationEventButton control) + : base(control) + { + } + + protected override string GetClassNameCore() + { + return nameof(ClickAutomationEventButton); + } + + protected override AutomationControlType GetAutomationControlTypeCore() + { + return AutomationControlType.Button; + } + + public override object GetPattern(PatternInterface patternInterface) + { + if (patternInterface == PatternInterface.Value) + { + return this; + } + + return base.GetPattern(patternInterface); + } + + public void SetValue(string value) + { + MyOwner.OnClickAutomationValue = value; + } + + private ClickAutomationEventButton MyOwner + { + get + { + return (ClickAutomationEventButton)Owner; + } + } + + public string Value + { + get { return MyOwner.OnClickAutomationValue; } + } + + public bool IsReadOnly + { + get { return !IsEnabled(); } + } + } + } +} diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/FancyZonesEditor.csproj b/src/modules/fancyzones/editor/FancyZonesEditor/FancyZonesEditor.csproj index beb730d203..0133bb2e46 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/FancyZonesEditor.csproj +++ b/src/modules/fancyzones/editor/FancyZonesEditor/FancyZonesEditor.csproj @@ -81,6 +81,7 @@ + diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs index 2458fb0d33..ab12da6d47 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs @@ -528,6 +528,15 @@ namespace FancyZonesEditor.Properties { } } + /// + /// Looks up a localized string similar to New zone added. + /// + public static string New_zone_added { + get { + return ResourceManager.GetString("New_zone_added", resourceCulture); + } + } + /// /// Looks up a localized string similar to Create or duplicate a layout to get started. /// diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx index 2970e15364..bd32b10891 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx @@ -120,6 +120,9 @@ Add new zone + + New zone added + Apply diff --git a/src/modules/videoconference/VideoConferenceModule/Video Conference.vcxproj b/src/modules/videoconference/VideoConferenceModule/Video Conference.vcxproj index 425313bce1..a162209fd4 100644 --- a/src/modules/videoconference/VideoConferenceModule/Video Conference.vcxproj +++ b/src/modules/videoconference/VideoConferenceModule/Video Conference.vcxproj @@ -78,7 +78,7 @@ true true $(OutDir)$(TargetName)$(TargetExt) - mfplat.lib;mf.lib;mfreadwrite.lib;mfuuid.lib;shlwapi.lib;gdiplus.lib;dwmapi.lib;uxtheme.lib;shcore.lib;Wtsapi32.lib;%(AdditionalDependencies) + shlwapi.lib;gdiplus.lib;dwmapi.lib;uxtheme.lib;shcore.lib;Wtsapi32.lib;%(AdditionalDependencies) xcopy /y /I "$(ProjectDir)Icons\*" "$(OutDir)Icons" @@ -101,7 +101,7 @@ xcopy /y /I "$(ProjectDir)black.bmp*" "$(OutDir)" Windows true $(OutDir)$(TargetName)$(TargetExt) - mfplat.lib;mf.lib;mfreadwrite.lib;mfuuid.lib;shlwapi.lib;gdiplus.lib;dwmapi.lib;uxtheme.lib;shcore.lib;Wtsapi32.lib;dxguid.lib;%(AdditionalDependencies) + shlwapi.lib;gdiplus.lib;dwmapi.lib;uxtheme.lib;shcore.lib;Wtsapi32.lib;dxguid.lib;%(AdditionalDependencies) xcopy /y /I "$(ProjectDir)Icons\*" "$(OutDir)Icons" diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/ImageLoading.cpp b/src/modules/videoconference/VideoConferenceProxyFilter/ImageLoading.cpp index 656fd5ea7f..9bc9e8e456 100644 --- a/src/modules/videoconference/VideoConferenceProxyFilter/ImageLoading.cpp +++ b/src/modules/videoconference/VideoConferenceProxyFilter/ImageLoading.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/VideoConferenceProxyFilter.vcxproj b/src/modules/videoconference/VideoConferenceProxyFilter/VideoConferenceProxyFilter.vcxproj index 4bbb2c2282..57966d6d31 100644 --- a/src/modules/videoconference/VideoConferenceProxyFilter/VideoConferenceProxyFilter.vcxproj +++ b/src/modules/videoconference/VideoConferenceProxyFilter/VideoConferenceProxyFilter.vcxproj @@ -62,7 +62,7 @@ call "$(ProjectDir)build_vcm_x86.cmd" - + $(SolutionDir)$(Platform)\$(Configuration)\modules\VideoConference\ @@ -87,7 +87,7 @@ MultiThreadedDebug - $(OutDir)VideoConferenceShared.lib;mfplat.lib;Mfsensorgroup.lib;OneCoreUAP.lib;Mf.lib;Shlwapi.lib;Strmiids.lib;%(AdditionalDependencies); + $(OutDir)VideoConferenceShared.lib;Windowscodecs.lib;Wtsapi32.lib;mfplat.lib;WindowsApp.lib;Mfsensorgroup.lib;Mf.lib;Shlwapi.lib;Strmiids.lib;%(AdditionalDependencies); module.def diff --git a/src/modules/videoconference/VideoConferenceShared/DLLProviderHelpers.h b/src/modules/videoconference/VideoConferenceShared/DLLProviderHelpers.h new file mode 100644 index 0000000000..c1c6efaef3 --- /dev/null +++ b/src/modules/videoconference/VideoConferenceShared/DLLProviderHelpers.h @@ -0,0 +1,33 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN +#include + +#include +#include +#include + +#define DECLARE_DLL_FUNCTION(NAME) \ + std::function NAME = (std::add_pointer_t)GetProcAddress(_library_handle, #NAME); + +#define DECLARE_DLL_PROVIDER_BEGIN(DLL_NAME) \ + class DLL_NAME##APIProvider final \ + { \ + HMODULE _library_handle; \ + DLL_NAME##APIProvider(HMODULE h) : _library_handle{ h } {} \ + \ + public: \ + ~DLL_NAME##APIProvider() { FreeLibrary(_library_handle); } \ + static std::optional create() \ + { \ + HMODULE h = LoadLibraryA(#DLL_NAME ".dll"); \ + std::optional result; \ + if (!h) \ + return result; \ + result.emplace(DLL_NAME##APIProvider{ h }); \ + return result; \ + } + +#define DECLAR_DLL_PROVIDER_END \ + } \ + ; diff --git a/src/modules/videoconference/VideoConferenceShared/Logging.cpp b/src/modules/videoconference/VideoConferenceShared/Logging.cpp index 382233f974..45f643fa12 100644 --- a/src/modules/videoconference/VideoConferenceShared/Logging.cpp +++ b/src/modules/videoconference/VideoConferenceShared/Logging.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #pragma warning(disable : 4127) diff --git a/src/modules/videoconference/VideoConferenceShared/MediaFoundationAPIProvider.h b/src/modules/videoconference/VideoConferenceShared/MediaFoundationAPIProvider.h new file mode 100644 index 0000000000..470f8b1f0f --- /dev/null +++ b/src/modules/videoconference/VideoConferenceShared/MediaFoundationAPIProvider.h @@ -0,0 +1,14 @@ +#pragma once + +#include +#include + +#include "DLLProviderHelpers.h" + +DECLARE_DLL_PROVIDER_BEGIN(mfplat) +DECLARE_DLL_FUNCTION(MFCreateAttributes) +DECLAR_DLL_PROVIDER_END + +DECLARE_DLL_PROVIDER_BEGIN(mf) +DECLARE_DLL_FUNCTION(MFEnumDeviceSources) +DECLAR_DLL_PROVIDER_END diff --git a/src/modules/videoconference/VideoConferenceShared/VideoCaptureDeviceList.cpp b/src/modules/videoconference/VideoConferenceShared/VideoCaptureDeviceList.cpp index 3245524aad..3ec325dbdd 100644 --- a/src/modules/videoconference/VideoConferenceShared/VideoCaptureDeviceList.cpp +++ b/src/modules/videoconference/VideoConferenceShared/VideoCaptureDeviceList.cpp @@ -1,5 +1,6 @@ #include "VideoCaptureDeviceList.h" #include "Logging.h" +#include "MediaFoundationAPIProvider.h" #include #include @@ -32,11 +33,17 @@ HRESULT VideoCaptureDeviceList::EnumerateDevices() HRESULT hr = S_OK; wil::com_ptr pAttributes; Clear(); + auto mfplatAPI = mfplatAPIProvider::create(); + auto mfAPI = mfAPIProvider::create(); + if (!mfplatAPI || !mfAPI) + { + return ERROR_FILE_NOT_FOUND; + } // Initialize an attribute store. We will use this to // specify the enumeration parameters. - hr = MFCreateAttributes(&pAttributes, 1); + hr = mfplatAPI->MFCreateAttributes(&pAttributes, 1); // Ask for source type = video capture devices if (SUCCEEDED(hr)) @@ -52,14 +59,13 @@ HRESULT VideoCaptureDeviceList::EnumerateDevices() // Enumerate devices. if (SUCCEEDED(hr)) { - hr = MFEnumDeviceSources(pAttributes.get(), &m_ppDevices, &m_numberDevices); + hr = mfAPI->MFEnumDeviceSources(pAttributes.get(), &m_ppDevices, &m_numberDevices); } else { LOG("VideoCaptureDeviceList::EnumerateDevices(): Couldn't SetGUID"); } - if (FAILED(hr)) { LOG("VideoCaptureDeviceList::EnumerateDevices(): MFEnumDeviceSources failed"); diff --git a/src/modules/videoconference/VideoConferenceShared/VideoConferenceShared.vcxproj b/src/modules/videoconference/VideoConferenceShared/VideoConferenceShared.vcxproj index 1b628c7e89..872edeadde 100644 --- a/src/modules/videoconference/VideoConferenceShared/VideoConferenceShared.vcxproj +++ b/src/modules/videoconference/VideoConferenceShared/VideoConferenceShared.vcxproj @@ -21,7 +21,7 @@ - mfplat.lib;Mfsensorgroup.lib;OneCoreUAP.lib;Mf.lib;Shlwapi.lib;Strmiids.lib;%(AdditionalDependencies); + mfplat.lib;Mfsensorgroup.lib;Mf.lib;Shlwapi.lib;Strmiids.lib;%(AdditionalDependencies); @@ -116,7 +116,9 @@ + + diff --git a/src/runner/main.cpp b/src/runner/main.cpp index a1e9a4c5fd..564b489751 100644 --- a/src/runner/main.cpp +++ b/src/runner/main.cpp @@ -141,10 +141,16 @@ int runner(bool isProcessElevated, bool openSettings, bool openOobe) L"modules/PowerRename/PowerRenameExt.dll", L"modules/ShortcutGuide/ShortcutGuideModuleInterface/ShortcutGuideModuleInterface.dll", L"modules/ColorPicker/ColorPicker.dll", - L"modules/Awake/AwakeModuleInterface.dll", - // TODO(yuyoyuppe): uncomment when VCM should be enabled - //L"modules/VideoConference/VideoConferenceModule.dll" + L"modules/Awake/AwakeModuleInterface.dll" + }; + // TODO(yuyoyuppe): uncomment when VCM should be enabled + //const auto VCM_PATH = L"modules/VideoConference/VideoConferenceModule.dll"; + //if (const auto mf = LoadLibraryA("mf.dll")) + //{ + // FreeLibrary(mf); + // knownModules.emplace_back(VCM_PATH); + //} for (const auto& moduleSubdir : knownModules) { diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/Microsoft.PowerToys.Settings.UI.Library.csproj b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/Microsoft.PowerToys.Settings.UI.Library.csproj index 2b4e5447b9..dd61ee54fc 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/Microsoft.PowerToys.Settings.UI.Library.csproj +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/Microsoft.PowerToys.Settings.UI.Library.csproj @@ -59,10 +59,4 @@ - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Windows.Forms.dll - - - diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/VideoConferenceViewModel.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/VideoConferenceViewModel.cs index 03494cc2f8..115d6e40b9 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/VideoConferenceViewModel.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/VideoConferenceViewModel.cs @@ -8,7 +8,7 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Windows.Forms; +using System.Threading.Tasks; using Microsoft.PowerToys.Settings.UI.Library; using Microsoft.PowerToys.Settings.UI.Library.Helpers; using Microsoft.PowerToys.Settings.UI.Library.Interfaces; @@ -28,10 +28,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels private Func SendConfigMSG { get; } + private Func> PickFileDialog { get; } + private string _settingsConfigFileFolder = string.Empty; - public VideoConferenceViewModel(ISettingsUtils settingsUtils, ISettingsRepository settingsRepository, Func ipcMSGCallBackFunc, string configFileSubfolder = "") + public VideoConferenceViewModel(ISettingsUtils settingsUtils, ISettingsRepository settingsRepository, Func ipcMSGCallBackFunc, Func> pickFileDialog, string configFileSubfolder = "") { + PickFileDialog = pickFileDialog; + if (settingsRepository == null) { throw new ArgumentNullException(nameof(settingsRepository)); @@ -161,21 +165,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels RaisePropertyChanged(nameof(CameraImageOverlayPath)); } - private void SelectOverlayImageAction() + private async void SelectOverlayImageAction() { try { - string pickedImage = null; - using (OpenFileDialog openFileDialog = new OpenFileDialog()) - { - openFileDialog.Filter = "Image Files (*.jpeg;*.jpg;*.png)|*.jpeg;*.jpg;*.png"; - openFileDialog.RestoreDirectory = true; - if (openFileDialog.ShowDialog() == DialogResult.OK) - { - pickedImage = openFileDialog.FileName; - } - } - + string pickedImage = await PickFileDialog().ConfigureAwait(true); if (pickedImage != null) { CameraImageOverlayPath = pickedImage; @@ -417,8 +411,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels OnPropertyChanged(propertyName); SndVideoConferenceSettings outsettings = new SndVideoConferenceSettings(Settings); SndModuleSettings ipcMessage = new SndModuleSettings(outsettings); - SendConfigMSG(ipcMessage.ToJsonString()); + _settingsUtils.SaveSettings(Settings.ToJsonString(), GetSettingsSubPath()); } } diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.UnitTests/Mocks/IIOProviderMocks.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.UnitTests/Mocks/IIOProviderMocks.cs index e3aabfba86..647e3670f3 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.UnitTests/Mocks/IIOProviderMocks.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI.UnitTests/Mocks/IIOProviderMocks.cs @@ -13,7 +13,7 @@ namespace Microsoft.PowerToys.Settings.UI.UnitTests.Mocks internal static class IIOProviderMocks { /// - /// This method mocks an IO provider to validate tests wich required saving to a file, and then reading the contents of that file, or verifying it exists + /// This method mocks an IO provider to validate tests which required saving to a file, and then reading the contents of that file, or verifying it exists /// /// Mocked IO Provider internal static Mock GetMockIOProviderForSaveLoadExists() diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Converters/ImageResizerFitToStringConverter.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Converters/ImageResizerFitToStringConverter.cs new file mode 100644 index 0000000000..736ac8aa6d --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Converters/ImageResizerFitToStringConverter.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation +// 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.Globalization; +using System.Text; +using Windows.ApplicationModel.Resources; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Media; + +namespace Microsoft.PowerToys.Settings.UI.Converters +{ + public sealed class ImageResizerFitToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + var toLower = false; + if ((string)parameter == "ToLower") + { + toLower = true; + } + + string targetValue = string.Empty; + switch (value) + { + case 0: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Fit_Fill_ThirdPersonSingular"); break; + case 1: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Fit_Fit_ThirdPersonSingular"); break; + case 2: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Fit_Stretch_ThirdPersonSingular"); break; + } + + if (toLower) + { + targetValue = targetValue.ToLower(CultureInfo.CurrentCulture); + } + + return targetValue; + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + return value; + } + } +} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Converters/ImageResizerUnitToStringConverter.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Converters/ImageResizerUnitToStringConverter.cs new file mode 100644 index 0000000000..b0b60715d0 --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Converters/ImageResizerUnitToStringConverter.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation +// 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.Globalization; +using Windows.ApplicationModel.Resources; +using Windows.UI.Xaml.Data; + +namespace Microsoft.PowerToys.Settings.UI.Converters +{ + public sealed class ImageResizerUnitToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + var toLower = false; + if ((string)parameter == "ToLower") + { + toLower = true; + } + + string targetValue = string.Empty; + switch (value) + { + case 0: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Unit_Centimeter"); break; + case 1: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Unit_Inch"); break; + case 2: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Unit_Percent"); break; + case 3: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Unit_Pixel"); break; + } + + if (toLower) + { + targetValue = targetValue.ToLower(CultureInfo.CurrentCulture); + } + + return targetValue; + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + return value; + } + } +} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj index 2b79768f79..a27e22a074 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj @@ -110,6 +110,8 @@ + + diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw index dc756268ca..241ca1c2ea 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw @@ -1,1356 +1,1386 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Video Conference Mute - Navigation view item name for Video Conference - - - Enable Video Conference - - - Video Conference Mute is a quick and easy way to do an global "mute" of both your microphone and webcam. -Disabling this module or closing PowerToys will unmute the microphone and camera. - - - Mute camera and microphone - - - Mute microphone - - - Mute camera - - - Selected camera - - - Selected microphone - - - Camera overlay image - - - Toolbar position - - - Top center - - - Top left corner - - - Top right corner - - - Bottom left corner - - - Bottom center - - - Bottom right corner - - - Show toolbar on - - - Main monitor - - - Monitor under cursor - - - Active window monitor - - - All monitors - - - Hide toolbar when both camera and microphone are unmuted - - - Video Conference - do not loc the product name - - - Camera - - - Microphone - - - Toolbar - - - Shortcuts - - - Camera overlay image preview - - - Browse - - - Clear - - - General - Navigation view item name for General - - - Awake - Product name: Navigation view item name for Awake - - - PowerToys Run - Product name: Navigation view item name for PowerToys Run - - - PowerRename - Product name: Navigation view item name for PowerRename - - - Shortcut Guide - Product name: Navigation view item name for Shortcut Guide - - - File Explorer add-ons - Product name: Navigation view item name for File Explorer. Please use File Explorer as in the context of File Explorer in Windows - - - FancyZones - Product name: Navigation view item name for FancyZones - - - Image Resizer - Product name: Navigation view item name for Image Resizer - - - Color Picker - Product name: Navigation view item name for Color Picker - - - Keyboard Manager - Product name: Navigation view item name for Keyboard Manager - - - Current configuration - Keyboard Manager current configuration header - - - Reconfigure your keyboard by remapping keys and shortcuts. - Keyboard Manager page description - - - Enable Keyboard Manager - - Keyboard Manager enable toggle header - do not loc the Product name. Do you want this feature on / off - - - - Select the profile to display the active key remap and shortcuts - Keyboard Manager configuration dropdown description - - - Remap a key - Keyboard Manager remap keyboard button content - - - Remap keys - Keyboard Manager remap keyboard header - - - Remap a shortcut - Keyboard Manager remap shortcuts button - - - Remap shortcuts - Keyboard Manager remap shortcuts header - - - Current Key Remappings - - - Current Shortcut Remappings - - - Key Remapping - key as in keyboard key - - - Shortcut Remapping - - - Remapped to - - - Remapped to - - - For Target Application - What computer application would this be for - - - Keyboard Manager - do not loc, product name - - - Quick and simple system-wide color picker. - - - Enable Color Picker - do not loc the Product name. Do you want this feature on / off - - - Change cursor when picking a color - - - Activate Color Picker - do not loc product name - - - A quick launcher that has additional capabilities without sacrificing performance. - - - Enable PowerToys Run - do not loc the Product name. Do you want this feature on / off - - - Search & results - - - Search result preference - - - Most recently used - - - Alphabetical order - - - Running processes/open applications - - - Search type preference - - - Application name - - - A string that is contained in the application - - - Executable name - - - Maximum number of results - - - Shortcuts - - - Open PowerToys Run - - - Open file location - - - Copy path location - - - Open console - console refers to Windows command prompt - - - Override Win+R shortcut - - - Override Win+S shortcut - - - Ignore shortcuts in fullscreen mode - - - Clear the previous query on launch - - - To: - Keyboard Manager mapping keys view right header - - - Appearance - - - FancyZones windows - do not loc the Product name - - - Create window layouts to help make multi-tasking easy. - windows refers to application windows - - - Keep windows in their zones when the screen resolution changes - windows refers to application windows - - - Enable FancyZones - do not loc the Product name. Do you want this feature on / off - - - Excluded apps - - - To exclude an application from snapping to zones add its name here (one per line). These apps will react only to Windows Snap. - - - Zone opacity - - - Open layout editor - Shortcut to launch the FancyZones layout editor application - - - Shortcut setting - - - Information Symbol - - - Launch layout editor - launches the FancyZones layout editor application - - - Make dragged window transparent - - - Use a non-primary mouse button to toggle zone activation - - - Move windows between zones across all monitors - - - Override Windows Snap shortcut (Win + Arrow) to move windows between zones - - - Hold Shift key to activate zones while dragging - - - Show zones on all monitors while dragging a window - - - Move newly created windows to their last known zone - windows refers to application windows - - - Move newly created windows to the current active monitor (EXPERIMENTAL) - - - Follow mouse cursor instead of focus when launching editor in a multi screen environment - - - Zone behavior - - - Zone highlight color - - - During zone layout changes, windows assigned to a zone will match new size/positions - - - Give feedback - - - Learn more - This label is there to point people to additional overview for how to use the product - - - Attribution - giving credit to the projects this utility was based on - - - PowerToys - - - Check for updates - - - Update now - - - Privacy statement - - - Report a bug - Report an issue inside powertoys - - - Request a feature - Tell our team what we should build - - - Restart as administrator - running PowerToys as a higher level user, account is typically referred to as an admin / administrator - - - Run at startup - - - A Windows Shell extension for more advanced bulk renaming using search and replace or regular expressions. - - - Shell integration - This refers to directly integrating in with Windows - - - Enable PowerRename - do not loc the Product name. Do you want this feature on / off - - - Settings theme - - - Show icon on context menu - - - Appear only in extended context menu (Shift + Right-click) - - - Maximum number of items - - - Show values from last use - - - Enable Markdown (.md) preview - Do not loc "Markdown". Do you want this feature on / off - - - Enable SVG (.svg) preview - Do you want this feature on / off - - - Enable SVG (.svg) thumbnails - Do you want this feature on / off - - - These settings allow you to manage your Windows File Explorer custom preview handlers. - - - Autocomplete - - - Open-source notice - - - Enable autocomplete for the search and replace fields - - - Zone border color - - - Zone inactive color - - - Shows a help overlay with Windows shortcuts when the Windows key is pressed. - - - Press duration before showing (ms) - pressing a key in milliseconds - - - Appearance & behavior - - - Enable Shortcut Guide - do not loc the Product name. Do you want this feature on / off - - - Opacity of background - - - Disable for apps - - - Turn off Shortcut Guide when these applications have focus. Add one application name per line. - - - Example: outlook.exe - Don't translate outlook.exe - - - Image sizes - - - Lets you resize images by right-clicking. - - - Enable Image Resizer - do not loc the Product name. Do you want this feature on / off - - - Image Size - - - Configurations - - - Configuration Name - - - Fit Property - - - Width Property - - - Height Property - - - Size Property - - - Times Symbol - - - Remove - Removes a user defined setting group for Image Resizer - - - Remove - Removes a user defined setting group for Image Resizer - - - Image Resizer - - - Add size - - - Save sizes - - - JPEG quality level - - - PNG interlacing - - - TIFF compression - - - File - as in a computer file - - - Default - - - CCITT3 - do not loc - - - CCITT4 - do not loc - - - Default - - - LZW - do not loc - - - None - - - RLE - do not loc - - - Zip - do not loc - - - BMP encoder - - - GIF encoder - - - JPEG encoder - - - PNG encoder - - - TIFF encoder - - - WMPhoto encoder - - - Fill - Refers to filling an image into a certain size. It could overflow - - - Fit - Refers to fitting an image into a certain size. It won't overflow - - - Stretch - Refers to stretching an image into a certain size. Won't overflow but could distort. - - - Centimeters - - - Inches - - - Percent - - - Pixels - - - Off - - - On - - - Learn more about administrator mode - - - Download updates automatically (Except on metered connections) - - - Currently running as administrator - - - Always run as administrator - - - Running as user - - - Running as administrator - - - FancyZones - do not loc the product name - - - File Explorer - do not loc the product name - - - File Explorer - Use same translation as Windows does for File Explorer - - - Image Resizer - do not loc the product name - - - Keyboard Manager - do not loc the product name - - - Color Picker - do not loc the product name - - - PowerToys Run - do not loc the product name - - - PowerToys Run - - - PowerRename - do not loc the product name - - - PowerRename - do not loc - - - Shortcut Guide - do not loc the product name - - - Shortcut Guide - - - GitHub repository - - - Updates - - - Installed version: - - - Last checked: - - - Version - - - Administrator mode - - - * You need to run as administrator to use this setting. - - - Only shortcuts with the following hotkeys are valid: - keyboard shortcuts and - - - Restore the original size of windows when unsnapping - - - Fallback encoder - - - The following parameters can be used: - - - Filename format - - - Use original date modified - - - Encoding - - - Remap keys to other keys or shortcuts. - - - Remap shortcuts to other shortcuts or keys. Additionally, mappings can be targeted to specific applications as well. - - - Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity. - -Made with 💗 by Microsoft and the PowerToys community. - Windows refers to the OS - - - Allow zones to span across monitors (all monitors must have the same DPI scaling) - - - Actual height - - - Actual width - - - Original filename - - - Selected height - - - Selected width - - - Size name - - - Move windows based on their position - Windows refers to application windows - - - New update available - - - PowerToys is up to date. - - - Icon Preview - - - Preview Pane - - - * You need to run as administrator to modify these settings. - - - The settings on this page affect all users on the system - - - A reboot may be required for changes to these settings to take effect - - - Example: outlook.exe - Don't translate outlook.exe - - - Example: %1 (%2) - - - Choose a mode - - - Dark - Dark refers to color, not weight - - - Light - Light refers to color, not weight - - - Windows default - Windows refers to the Operating system - - - Windows color settings - Windows refers to the Operating system - - - Color format for clipboard - - - Color Picker with editor mode enabled - do not loc the product name - - - Pick a color from the screen, copy formatted value to clipboard, then to the editor - do not loc the product name - - - Editor - - - Activation behavior - - - Picker behavior - - - Learn more about remapping limitations - This is a link that will discuss what is and is not possible for Keyboard manager to remap - - - Editor - refers to the FancyZone editor - - - Window behavior - - - Behavior - - - Use Boost library (provides extended features but may use different regex syntax) - Boost is a product name, should not be translated - - - Made with 💗 by Microsoft and the PowerToys community. - - - Color Picker only - do not loc the product name - - - Pick a color from the screen and copy formatted value to clipboard - - - Open directly into the editor mode - - - Editor color formats - - - Show color name - - - Large - The size of the image - - - Medium - The size of the image - - - Phone - The size of the image referring to a Mobile Phone typical image size - - - Small - The size of the image - - - Win + Up/Down/Left/Right to move windows based on relative position - - - Win + Left/Right to move windows based on zone index - - - Editor - - - Activate the zone whose center is closest to the cursor - - - Activate the largest zone by area - - - Split the overlapped area into multiple activation targets - - - Activate the smallest zone by area - - - When multiple zones overlap: - - - Plugins - - - Direct activation phrase - - - Authored by - example: Authored by Microsoft - - - Include in global result - - - Enable plugin - - - Additional options - - - * Please define an activation phrase or allow this plugin for the global results to use it. - - - * PowerToys Run can't provide any results without plugins. Please enable at least one plugin. - - - * This activation phrase overrides the behavior of other plugins. Please change it to something else. - - - You can include or remove each plugin from the global results, change the direct activation phrase and configure additional options. - - - Position & appearance - - - Show PowerToys Run on - as in Show PowerToys Run on primary monitor - - - Monitor with mouse cursor - - - Monitor with focused window - - - Primary monitor - - - Plugins are loading... - - - Move the color down - - - Move the color up - - - Flash zones when switching layout - - - Enable quick layout switch - - - Quick layout switch - - - Open Shortcut Guide - - - Let's get started! - - - Welcome to PowerToys! These overviews will help you quickly learn the basics of all our utilities. - - - Getting started - - - Launch - - - Learn more about - - - Color Picker is a system-wide color selection tool for Windows 10 that enables you to pick colors from any currently running application and automatically copies it in a configurable format to your clipboard. - - - FancyZones is a window manager that makes it easy to create complex window layouts and quickly position windows into those layouts. - - - PowerToys introduces add-ons to the Window’s File Explorer that will currently enable Markdown files (.md) and SVG icons (.svg) to be viewed in the preview pane. - - - Image Resizer is a Windows shell extension for simple bulk image-resizing. - - - Keyboard Manager allows you to customize the keyboard to be more productive by remapping keys and creating your own keyboard shortcuts. - - - PowerRename enables you to perform simple bulk renaming, searching and replacing file names. - - - PowerToys Run is a quick launcher for power users that contains some additional features without sacrificing performance. - - - Shortcut Guide presents the user with a listing of available shortcuts for the current state of the desktop. - - - Video Conference Mute allows users to quickly mute the microphone and turn off the camera while on a conference call with a single keystroke, regardless of what application has focus on your computer. - - - For returning users, check out what is new in our - - - Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows 10 experience for greater productivity. -Take a moment to preview the various utilities listed or view our comprehensive documentation on - - - Microsoft Docs - - - release notes - - - {Win} + {Shift} + {C} to open Color Picker. - - - To select a color with more precision, {scroll the mouse wheel} to zoom in. - - - {Shift} + {dragging the window} to snap a window to a zone, and release the window in the desired zone. {Win} + {Shift} + {`} to open the FancyZones editor. - - - Snap a window to multiple zones by holding the {Ctrl} key (while also holding {Shift}) when dragging a window. - - - Open File Explorer, {select the View tab} in the File Explorer ribbon, then {select Preview Pane}. -From there, simply click on a Markdown file or SVG icon in the File Explorer and observe the content on the preview pane! - - - How to create mappings - - - How to enable - - - How to launch - - - How to use - - - In File Explorer, {right-clicking one or more image files} and {clicking on Resize pictures} from the context menu. - - - Want a custom size? You can add them in the PowerToys Settings! - - - Launch {PowerToys settings}, navigate to the Keyboard Manager menu, and select either {Remap a key} or {Remap a shortcut}. - - - Want to only have a shortcut work for a single application? Use the Target App field when creating the shortcut remapping. - - - In File Explorer, {right-clicking one or more selected files} and {clicking on PowerRename} from the context menu. - - - PowerRename supports searching for files using regular expressions to enable more advanced renaming functionalities. - - - {Alt} + {Space} to open Run and just start typing. - - - PowerToys Run supports various action keys to funnel search queries for a specific subset of results. Typing {<} searches for running processes only, {?} will search only for file, or {.} for installed applications! See PowerToys documentation for the complete set of 'Action Keys' available. - - - {Win} + {?} to open Shortcut Guide, press it again to close or press {Esc}. You can also launch it by holding the {Win} key for one second! - - - Tips & tricks - - - {Win} + {N} to toggle both your microphone and video -{Win} + {Shift} + {A} to toggle your microphone -{Win} + {Shift} + {O} to toggle your video - - - Color Picker - Do not localize this string - - - FancyZones - Do not localize this string - - - File Explorer add-ons - Do not localize this string - - - Image Resizer - Do not localize this string - - - Keyboard Manager - Do not localize this string - - - Overview - - - PowerRename - Do not localize this string - - - PowerToys Run - Do not localize this string - - - Shortcut Guide - Do not localize this string - - - Video Conference - Do not localize this string - - - Welcome - - - Settings - - - Welcome to PowerToys - - - Welcome to PowerToys - - - PowerToys Settings - - - Awake - do not loc the product name - - - A convenient way to keep your PC awake on-demand. - - - Enable Awake - - - Off (Passive) - - - Keep awake indefinitely - - - Keep awake temporarily - - - Your PC operates according to its current power plan - - - Keeps your PC awake until the setting is disabled - - - Keeps your PC awake until the set time elapses - - - Keep screen on - - - Mode - - - Behavior - - - Hours - - - Minutes - - - Awake - Module name, do not loc - - - Awake is a Windows tool designed to keep your PC awake on-demand without having to manage its power settings. This behavior can be helpful when running time-consuming tasks while ensuring that your PC does not go to sleep or turn off its screens. - - - Open {PowerToys Settings} and enable Awake - - - You can always change modes quickly by {right-clicking the Awake icon} in the system tray. - - - * An error occurred trying to update to - - - Install now - - - Read more - - - A new version is available: - - - Downloading... - - - Try again to download and install - - - Checking for updates... - - - A new version is ready to install: - - - PowerToys is up to date - - - Download and install - - - Learn more - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Video Conference Mute + Navigation view item name for Video Conference + + + Enable Video Conference + + + Video Conference Mute is a quick and easy way to do an global "mute" of both your microphone and webcam. +Disabling this module or closing PowerToys will unmute the microphone and camera. + + + Mute camera and microphone + + + Mute microphone + + + Mute camera + + + Selected camera + + + Selected microphone + + + Camera overlay image + + + Toolbar position + + + Top center + + + Top left corner + + + Top right corner + + + Bottom left corner + + + Bottom center + + + Bottom right corner + + + Show toolbar on + + + Main monitor + + + Monitor under cursor + + + Active window monitor + + + All monitors + + + Hide toolbar when both camera and microphone are unmuted + + + About Video Conference + + + Camera + + + Microphone + + + Toolbar + + + Shortcuts + + + Camera overlay image preview + + + Browse + + + Clear + + + General + Navigation view item name for General + + + Awake + Product name: Navigation view item name for Awake + + + PowerToys Run + Product name: Navigation view item name for PowerToys Run + + + PowerRename + Product name: Navigation view item name for PowerRename + + + Shortcut Guide + Product name: Navigation view item name for Shortcut Guide + + + File Explorer add-ons + Product name: Navigation view item name for File Explorer. Please use File Explorer as in the context of File Explorer in Windows + + + FancyZones + Product name: Navigation view item name for FancyZones + + + Image Resizer + Product name: Navigation view item name for Image Resizer + + + Color Picker + Product name: Navigation view item name for Color Picker + + + Keyboard Manager + Product name: Navigation view item name for Keyboard Manager + + + Current configuration + Keyboard Manager current configuration header + + + Reconfigure your keyboard by remapping keys and shortcuts. + Keyboard Manager page description + + + Enable Keyboard Manager + + Keyboard Manager enable toggle header + do not loc the Product name. Do you want this feature on / off + + + + Select the profile to display the active key remap and shortcuts + Keyboard Manager configuration dropdown description + + + Remap a key + Keyboard Manager remap keyboard button content + + + Remap keys + Keyboard Manager remap keyboard header + + + Remap a shortcut + Keyboard Manager remap shortcuts button + + + Remap shortcuts + Keyboard Manager remap shortcuts header + + + Current Key Remappings + + + Current Shortcut Remappings + + + Key Remapping + key as in keyboard key + + + Shortcut Remapping + + + Remapped to + + + Remapped to + + + For Target Application + What computer application would this be for + + + Keyboard Manager + do not loc, product name + + + Quick and simple system-wide color picker. + + + Enable Color Picker + do not loc the Product name. Do you want this feature on / off + + + Change cursor when picking a color + + + Activate Color Picker + do not loc product name + + + A quick launcher that has additional capabilities without sacrificing performance. + + + Enable PowerToys Run + do not loc the Product name. Do you want this feature on / off + + + Search & results + + + Search result preference + + + Most recently used + + + Alphabetical order + + + Running processes/open applications + + + Search type preference + + + Application name + + + A string that is contained in the application + + + Executable name + + + Maximum number of results + + + Shortcuts + + + Open PowerToys Run + + + Open file location + + + Copy path location + + + Open console + console refers to Windows command prompt + + + Override Win+R shortcut + + + Override Win+S shortcut + + + Ignore shortcuts in fullscreen mode + + + Clear the previous query on launch + + + To: + Keyboard Manager mapping keys view right header + + + Appearance + + + FancyZones windows + do not loc the Product name + + + Create window layouts to help make multi-tasking easy. + windows refers to application windows + + + Keep windows in their zones when the screen resolution changes + windows refers to application windows + + + Enable FancyZones + do not loc the Product name. Do you want this feature on / off + + + Excluded apps + + + To exclude an application from snapping to zones add its name here (one per line). These apps will react only to Windows Snap. + + + Zone opacity + + + Open layout editor + Shortcut to launch the FancyZones layout editor application + + + Shortcut setting + + + Information Symbol + + + Launch layout editor + launches the FancyZones layout editor application + + + Make dragged window transparent + + + Use a non-primary mouse button to toggle zone activation + + + Move windows between zones across all monitors + + + Override Windows Snap shortcut (Win + Arrow) to move windows between zones + + + Hold Shift key to activate zones while dragging + + + Show zones on all monitors while dragging a window + + + Move newly created windows to their last known zone + windows refers to application windows + + + Move newly created windows to the current active monitor (EXPERIMENTAL) + + + Follow mouse cursor instead of focus when launching editor in a multi screen environment + + + Zone behavior + + + Zone highlight color + + + During zone layout changes, windows assigned to a zone will match new size/positions + + + Give feedback + + + Learn more + This label is there to point people to additional overview for how to use the product + + + Attribution + giving credit to the projects this utility was based on + + + About PowerToys + + + Check for updates + + + Update now + + + Privacy statement + + + Report a bug + Report an issue inside powertoys + + + Request a feature + Tell our team what we should build + + + Restart as administrator + running PowerToys as a higher level user, account is typically referred to as an admin / administrator + + + Run at startup + + + A Windows Shell extension for more advanced bulk renaming using search and replace or regular expressions. + + + Shell integration + This refers to directly integrating in with Windows + + + Enable PowerRename + do not loc the Product name. Do you want this feature on / off + + + Settings theme + + + Show icon on context menu + + + Appear only in extended context menu (Shift + Right-click) + + + Maximum number of items + + + Show values from last use + + + Enable Markdown (.md) preview + Do not loc "Markdown". Do you want this feature on / off + + + Enable SVG (.svg) preview + Do you want this feature on / off + + + Enable SVG (.svg) thumbnails + Do you want this feature on / off + + + These settings allow you to manage your Windows File Explorer custom preview handlers. + + + Autocomplete + + + Open-source notice + + + Enable autocomplete for the search and replace fields + + + Zone border color + + + Zone inactive color + + + Shows a help overlay with Windows shortcuts when the Windows key is pressed. + + + Press duration before showing (ms) + pressing a key in milliseconds + + + Appearance & behavior + + + Enable Shortcut Guide + do not loc the Product name. Do you want this feature on / off + + + Opacity of background + + + Disable for apps + + + Turn off Shortcut Guide when these applications have focus. Add one application name per line. + + + Example: outlook.exe + Don't translate outlook.exe + + + Image sizes + + + Lets you resize images by right-clicking. + + + Enable Image Resizer + do not loc the Product name. Do you want this feature on / off + + + Image Size + + + Configurations + + + Name + + + Fit + + + Width + + + Height + + + Unit + + + Remove + Removes a user defined setting group for Image Resizer + + + Remove + Removes a user defined setting group for Image Resizer + + + Image Resizer + + + Add size + + + Save sizes + + + JPEG quality level + + + PNG interlacing + + + TIFF compression + + + File + as in a computer file + + + Default + + + CCITT3 + do not loc + + + CCITT4 + do not loc + + + Default + + + LZW + do not loc + + + None + + + RLE + do not loc + + + Zip + do not loc + + + BMP encoder + + + GIF encoder + + + JPEG encoder + + + PNG encoder + + + TIFF encoder + + + WMPhoto encoder + + + Fill + Refers to filling an image into a certain size. It could overflow + + + Fill + Refers to filling an image into a certain size. It could overflow + + + Fit + Refers to fitting an image into a certain size. It won't overflow + + + Stretch + Refers to stretching an image into a certain size. Won't overflow but could distort. + + + Centimeters + + + Inches + + + Percent + + + Pixels + + + Off + + + On + + + Learn more about administrator mode + + + Download updates automatically (Except on metered connections) + + + Currently running as administrator + + + Always run as administrator + + + Running as user + + + Running as administrator + + + About FancyZones + + + About File Explorer + + + File Explorer + Use same translation as Windows does for File Explorer + + + About Image Resizer + + + About Keyboard Manager + + + About Color Picker + + + About PowerToys Run + + + PowerToys Run + + + About PowerRename + do not loc the product name + + + PowerRename + do not loc + + + About Shortcut Guide + + + Shortcut Guide + + + GitHub repository + + + Updates + + + Installed version: + + + Last checked: + + + Version + + + Administrator mode + + + * You need to run as administrator to use this setting. + + + Only shortcuts with the following hotkeys are valid: + keyboard shortcuts and + + + Restore the original size of windows when unsnapping + + + Fallback encoder + + + The following parameters can be used: + + + Filename format + + + Use original date modified + + + Encoding + + + Remap keys to other keys or shortcuts. + + + Remap shortcuts to other shortcuts or keys. Additionally, mappings can be targeted to specific applications as well. + + + Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity. + +Made with 💗 by Microsoft and the PowerToys community. + Windows refers to the OS + + + Allow zones to span across monitors (all monitors must have the same DPI scaling) + + + Actual height + + + Actual width + + + Original filename + + + Selected height + + + Selected width + + + Size name + + + Move windows based on their position + Windows refers to application windows + + + New update available + + + PowerToys is up to date. + + + Icon Preview + + + Preview Pane + + + * You need to run as administrator to modify these settings. + + + The settings on this page affect all users on the system + + + A reboot may be required for changes to these settings to take effect + + + Example: outlook.exe + Don't translate outlook.exe + + + Example: %1 (%2) + + + Choose a mode + + + Dark + Dark refers to color, not weight + + + Light + Light refers to color, not weight + + + Windows default + Windows refers to the Operating system + + + Windows color settings + Windows refers to the Operating system + + + Color format for clipboard + + + Color Picker with editor mode enabled + do not loc the product name + + + Pick a color from the screen, copy formatted value to clipboard, then to the editor + do not loc the product name + + + Editor + + + Activation behavior + + + Picker behavior + + + Learn more about remapping limitations + This is a link that will discuss what is and is not possible for Keyboard manager to remap + + + Editor + refers to the FancyZone editor + + + Window behavior + + + Behavior + + + Use Boost library (provides extended features but may use different regex syntax) + Boost is a product name, should not be translated + + + Made with 💗 by Microsoft and the PowerToys community. + + + Color Picker only + do not loc the product name + + + Pick a color from the screen and copy formatted value to clipboard + + + Open directly into the editor mode + + + Editor color formats + + + Show color name + + + Large + The size of the image + + + Medium + The size of the image + + + Phone + The size of the image referring to a Mobile Phone typical image size + + + Small + The size of the image + + + Win + Up/Down/Left/Right to move windows based on relative position + + + Win + Left/Right to move windows based on zone index + + + Editor + + + Activate the zone whose center is closest to the cursor + + + Activate the largest zone by area + + + Split the overlapped area into multiple activation targets + + + Activate the smallest zone by area + + + When multiple zones overlap: + + + Plugins + + + Direct activation phrase + + + Authored by + example: Authored by Microsoft + + + Include in global result + + + Enable plugin + + + Additional options + + + * Please define an activation phrase or allow this plugin for the global results to use it. + + + * PowerToys Run can't provide any results without plugins. Please enable at least one plugin. + + + * This activation phrase overrides the behavior of other plugins. Please change it to something else. + + + You can include or remove each plugin from the global results, change the direct activation phrase and configure additional options. + + + Position & appearance + + + Show PowerToys Run on + as in Show PowerToys Run on primary monitor + + + Monitor with mouse cursor + + + Monitor with focused window + + + Primary monitor + + + Plugins are loading... + + + Move the color down + + + Move the color up + + + Flash zones when switching layout + + + Enable quick layout switch + + + Quick layout switch + + + Open Shortcut Guide + + + Let's get started! + + + Welcome to PowerToys! These overviews will help you quickly learn the basics of all our utilities. + + + Getting started + + + Launch + + + Learn more about + + + Color Picker is a system-wide color selection tool for Windows 10 that enables you to pick colors from any currently running application and automatically copies it in a configurable format to your clipboard. + + + FancyZones is a window manager that makes it easy to create complex window layouts and quickly position windows into those layouts. + + + PowerToys introduces add-ons to the Window’s File Explorer that will currently enable Markdown files (.md) and SVG icons (.svg) to be viewed in the preview pane. + + + Image Resizer is a Windows shell extension for simple bulk image-resizing. + + + Keyboard Manager allows you to customize the keyboard to be more productive by remapping keys and creating your own keyboard shortcuts. + + + PowerRename enables you to perform simple bulk renaming, searching and replacing file names. + + + PowerToys Run is a quick launcher for power users that contains some additional features without sacrificing performance. + + + Shortcut Guide presents the user with a listing of available shortcuts for the current state of the desktop. + + + Video Conference Mute allows users to quickly mute the microphone and turn off the camera while on a conference call with a single keystroke, regardless of what application has focus on your computer. + + + For returning users, check out what is new in our + + + Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows 10 experience for greater productivity. +Take a moment to preview the various utilities listed or view our comprehensive documentation on + + + Microsoft Docs + + + release notes + + + {Win} + {Shift} + {C} to open Color Picker. + + + To select a color with more precision, {scroll the mouse wheel} to zoom in. + + + {Shift} + {dragging the window} to snap a window to a zone, and release the window in the desired zone. {Win} + {Shift} + {`} to open the FancyZones editor. + + + Snap a window to multiple zones by holding the {Ctrl} key (while also holding {Shift}) when dragging a window. + + + Open File Explorer, {select the View tab} in the File Explorer ribbon, then {select Preview Pane}. +From there, simply click on a Markdown file or SVG icon in the File Explorer and observe the content on the preview pane! + + + How to create mappings + + + How to enable + + + How to launch + + + How to use + + + In File Explorer, {right-clicking one or more image files} and {clicking on Resize pictures} from the context menu. + + + Want a custom size? You can add them in the PowerToys Settings! + + + Launch {PowerToys settings}, navigate to the Keyboard Manager menu, and select either {Remap a key} or {Remap a shortcut}. + + + Want to only have a shortcut work for a single application? Use the Target App field when creating the shortcut remapping. + + + In File Explorer, {right-clicking one or more selected files} and {clicking on PowerRename} from the context menu. + + + PowerRename supports searching for files using regular expressions to enable more advanced renaming functionalities. + + + {Alt} + {Space} to open Run and just start typing. + + + PowerToys Run supports various action keys to funnel search queries for a specific subset of results. Typing {<} searches for running processes only, {?} will search only for file, or {.} for installed applications! See PowerToys documentation for the complete set of 'Action Keys' available. + + + {Win} + {?} to open Shortcut Guide, press it again to close or press {Esc}. You can also launch it by holding the {Win} key for one second! + + + Tips & tricks + + + {Win} + {N} to toggle both your microphone and video +{Win} + {Shift} + {A} to toggle your microphone +{Win} + {Shift} + {O} to toggle your video + + + Color Picker + Do not localize this string + + + FancyZones + Do not localize this string + + + File Explorer add-ons + Do not localize this string + + + Image Resizer + Do not localize this string + + + Keyboard Manager + Do not localize this string + + + Overview + + + PowerRename + Do not localize this string + + + PowerToys Run + Do not localize this string + + + Shortcut Guide + Do not localize this string + + + Video Conference + Do not localize this string + + + Welcome + + + Settings + + + Welcome to PowerToys + + + Welcome to PowerToys + + + PowerToys Settings + + + About Awake + + + A convenient way to keep your PC awake on-demand. + + + Enable Awake + + + Off (Passive) + + + Keep awake indefinitely + + + Keep awake temporarily + + + Your PC operates according to its current power plan + + + Keeps your PC awake until the setting is disabled + + + Keeps your PC awake until the set time elapses + + + Keep screen on + + + Mode + + + Behavior + + + Hours + + + Minutes + + + Awake + Module name, do not loc + + + Awake is a Windows tool designed to keep your PC awake on-demand without having to manage its power settings. This behavior can be helpful when running time-consuming tasks while ensuring that your PC does not go to sleep or turn off its screens. + + + Open {PowerToys Settings} and enable Awake + + + You can always change modes quickly by {right-clicking the Awake icon} in the system tray. + + + * An error occurred trying to update to + + + Install now + + + Read more + + + A new version is available: + + + Downloading... + + + Try again to download and install + + + Checking for updates... + + + A new version is ready to install: + + + PowerToys is up to date + + + Download and install + + + Fills + + + Fits within + + + Stretches to + + + Centimeters + + + Inches + + + Percent + + + Pixels + + + Edit + + + Edit + + + No + Label of a cancel button + + + Are you sure you want to delete this item? + + + Yes + Label of a confirmation button + + + Learn more + \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/ViewModels/ShellViewModel.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/ViewModels/ShellViewModel.cs index 9ded11ab04..61e675d1f1 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/ViewModels/ShellViewModel.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/ViewModels/ShellViewModel.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Input; using Microsoft.PowerToys.Settings.UI.Helpers; @@ -37,11 +38,24 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels set { Set(ref isBackEnabled, value); } } + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] + private static extern IntPtr LoadLibrary(string dllToLoad); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] + private static extern bool FreeLibrary(IntPtr hModule); + public bool IsVideoConferenceBuild { get { - return this != null && File.Exists("modules/VideoConference/VideoConferenceModule.dll"); + var mfHandle = LoadLibrary("mf.dll"); + bool mfAvailable = mfHandle != null; + if (mfAvailable) + { + FreeLibrary(mfHandle); + } + + return this != null && File.Exists("modules/VideoConference/VideoConferenceModule.dll") && mfAvailable; } } diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml index 9e44204b0e..af47e4b4a0 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml @@ -6,11 +6,18 @@ xmlns:models="using:Microsoft.PowerToys.Settings.UI.Library" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters" + xmlns:toolkitconverters="using:Microsoft.Toolkit.Uwp.UI.Converters" mc:Ignorable="d" AutomationProperties.LandmarkType="Main"> - + + + + + @@ -26,7 +33,7 @@ - - - - - - - + + + + + + + - - - - - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + @@ -259,7 +228,7 @@ x:Uid="ImageResizer_FilenameFormatHeader" Margin="0,0,0,0" Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/> - diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml.cs index f482f4d2cf..0b542c0198 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml.cs @@ -9,6 +9,8 @@ using System.Linq; using Microsoft.PowerToys.Settings.UI.Library; using Microsoft.PowerToys.Settings.UI.Library.Utilities; using Microsoft.PowerToys.Settings.UI.Library.ViewModels; +using Windows.ApplicationModel.Resources; +using Windows.UI.Popups; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; @@ -32,19 +34,36 @@ namespace Microsoft.PowerToys.Settings.UI.Views DataContext = ViewModel; } - public void DeleteCustomSize(object sender, RoutedEventArgs e) + public async void DeleteCustomSize(object sender, RoutedEventArgs e) { Button deleteRowButton = (Button)sender; - // Using InvariantCulture since this is internal and expected to be numerical - bool success = int.TryParse(deleteRowButton?.CommandParameter?.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out int rowNum); - if (success) + if (deleteRowButton != null) { - ViewModel.DeleteImageSize(rowNum); - } - else - { - Logger.LogError("Failed to delete custom image size."); + ImageSize x = (ImageSize)deleteRowButton.DataContext; + ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView(); + + ContentDialog dialog = new ContentDialog(); + dialog.XamlRoot = RootPage.XamlRoot; + dialog.Title = x.Name; + dialog.PrimaryButtonText = resourceLoader.GetString("Yes"); + dialog.CloseButtonText = resourceLoader.GetString("No"); + dialog.DefaultButton = ContentDialogButton.Primary; + dialog.Content = new TextBlock() { Text = resourceLoader.GetString("Delete_Dialog_Description") }; + dialog.PrimaryButtonClick += (s, args) => + { + // Using InvariantCulture since this is internal and expected to be numerical + bool success = int.TryParse(deleteRowButton?.CommandParameter?.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out int rowNum); + if (success) + { + ViewModel.DeleteImageSize(rowNum); + } + else + { + Logger.LogError("Failed to delete custom image size."); + } + }; + var result = await dialog.ShowAsync(); } } diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml index e25456e9fa..7b0072fce3 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml @@ -255,7 +255,8 @@ diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/VideoConference.xaml.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/VideoConference.xaml.cs index c78f3a305e..c5ea2df908 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/VideoConference.xaml.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/VideoConference.xaml.cs @@ -2,9 +2,12 @@ // 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.Threading.Tasks; using Microsoft.PowerToys.Settings.UI.Library; -using Microsoft.PowerToys.Settings.UI.Library.Utilities; using Microsoft.PowerToys.Settings.UI.ViewModels; +using Windows.Storage; +using Windows.Storage.Pickers; using Windows.UI.Xaml.Controls; namespace Microsoft.PowerToys.Settings.UI.Views @@ -13,10 +16,24 @@ namespace Microsoft.PowerToys.Settings.UI.Views { private VideoConferenceViewModel ViewModel { get; set; } + private static async Task PickFileDialog() + { + FileOpenPicker openPicker = new FileOpenPicker(); + openPicker.ViewMode = PickerViewMode.Thumbnail; + openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; + openPicker.FileTypeFilter.Add(".jpg"); + openPicker.FileTypeFilter.Add(".jpeg"); + openPicker.FileTypeFilter.Add(".png"); + ((IInitializeWithWindow)(object)openPicker).Initialize(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle); + + StorageFile file = await openPicker.PickSingleFileAsync(); + return file?.Path; + } + public VideoConferencePage() { var settingsUtils = new SettingsUtils(); - ViewModel = new VideoConferenceViewModel(settingsUtils, SettingsRepository.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage); + ViewModel = new VideoConferenceViewModel(settingsUtils, SettingsRepository.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage, PickFileDialog); DataContext = ViewModel; InitializeComponent(); } diff --git a/tools/BugReportTool/BugReportTool/EventViewer.cpp b/tools/BugReportTool/BugReportTool/EventViewer.cpp index cfbd972161..2e9e69f22a 100644 --- a/tools/BugReportTool/BugReportTool/EventViewer.cpp +++ b/tools/BugReportTool/BugReportTool/EventViewer.cpp @@ -15,6 +15,7 @@ namespace std::vector processes = { L"PowerToys.exe", + L"PowerToys.Settings.exe", L"ColorPickerUI.exe", L"PowerToys.Awake.exe", L"FancyZonesEditor.exe",