From 48f2376aaabe836a832ba46f621073912415e282 Mon Sep 17 00:00:00 2001 From: Clint Rutkas Date: Wed, 12 May 2021 11:22:34 -0700 Subject: [PATCH] Revert "Espresso" (#11235) --- .github/actions/spell-check/expect.txt | 10 - PowerToys.sln | 17 - doc/images/icons/Espresso.png | Bin 14255 -> 0 bytes installer/PowerToysSetup/Product.wxs | 49 +-- src/common/SettingsAPI/settings_helpers.h | 1 - .../espresso/Espresso/Core/APIHelper.cs | 245 --------------- .../espresso/Espresso/Core/TrayHelper.cs | 226 -------------- src/modules/espresso/Espresso/Espresso.csproj | 87 ------ .../espresso/Espresso/Images/Espresso.ico | Bin 67646 -> 0 bytes src/modules/espresso/Espresso/NLog.config | 14 - src/modules/espresso/Espresso/Program.cs | 294 ------------------ .../EspressoConstants.h | 7 - .../EspressoModuleInterface.rc | 72 ----- .../EspressoModuleInterface.vcxproj | 92 ------ .../EspressoModuleInterface.vcxproj.filters | 50 --- .../EspressoModuleInterface/dllmain.cpp | 226 -------------- .../EspressoModuleInterface/packages.config | 4 - .../espresso/EspressoModuleInterface/pch.cpp | 1 - .../espresso/EspressoModuleInterface/pch.h | 7 - .../EspressoModuleInterface/resource.h | 16 - .../EspressoModuleInterface/trace.cpp | 19 -- .../espresso/EspressoModuleInterface/trace.h | 8 - src/runner/main.cpp | 3 +- .../EnabledModules.cs | 16 - .../EspressoProperties.cs | 37 --- .../EspressoSettings.cs | 35 --- .../ISettingsUtils.cs | 2 - ...osoft.PowerToys.Settings.UI.Library.csproj | 3 - .../SettingsUtils.cs | 6 - .../SndEspressoSettings.cs | 32 -- .../ViewModels/EspressoViewModel.cs | 148 --------- ...oft.PowerToys.Settings.UI.UnitTests.csproj | 5 +- .../FluentIcons/FluentIconsEspresso.png | Bin 3022 -> 0 bytes .../Converters/EspressoModeToBoolConverter.cs | 44 --- .../EspressoModeToReverseBoolConverter.cs | 44 --- .../Microsoft.PowerToys.Settings.UI.csproj | 19 +- .../OOBE/Enums/PowerToysModulesEnum.cs | 1 - .../OOBE/Views/OobeEspresso.xaml | 70 ----- .../OOBE/Views/OobeEspresso.xaml.cs | 48 --- .../OOBE/Views/OobeShellPage.xaml.cs | 13 - .../Strings/en-us/Resources.resw | 78 ++--- .../Views/EspressoPage.xaml | 188 ----------- .../Views/EspressoPage.xaml.cs | 23 -- .../Views/ShellPage.xaml | 8 +- .../PowerToys.Settings.csproj | 3 - 45 files changed, 29 insertions(+), 2242 deletions(-) delete mode 100644 doc/images/icons/Espresso.png delete mode 100644 src/modules/espresso/Espresso/Core/APIHelper.cs delete mode 100644 src/modules/espresso/Espresso/Core/TrayHelper.cs delete mode 100644 src/modules/espresso/Espresso/Espresso.csproj delete mode 100644 src/modules/espresso/Espresso/Images/Espresso.ico delete mode 100644 src/modules/espresso/Espresso/NLog.config delete mode 100644 src/modules/espresso/Espresso/Program.cs delete mode 100644 src/modules/espresso/EspressoModuleInterface/EspressoConstants.h delete mode 100644 src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.rc delete mode 100644 src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.vcxproj delete mode 100644 src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.vcxproj.filters delete mode 100644 src/modules/espresso/EspressoModuleInterface/dllmain.cpp delete mode 100644 src/modules/espresso/EspressoModuleInterface/packages.config delete mode 100644 src/modules/espresso/EspressoModuleInterface/pch.cpp delete mode 100644 src/modules/espresso/EspressoModuleInterface/pch.h delete mode 100644 src/modules/espresso/EspressoModuleInterface/resource.h delete mode 100644 src/modules/espresso/EspressoModuleInterface/trace.cpp delete mode 100644 src/modules/espresso/EspressoModuleInterface/trace.h delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EspressoProperties.cs delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EspressoSettings.cs delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/SndEspressoSettings.cs delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/EspressoViewModel.cs delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/Assets/FluentIcons/FluentIconsEspresso.png delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/Converters/EspressoModeToBoolConverter.cs delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/Converters/EspressoModeToReverseBoolConverter.cs delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeEspresso.xaml delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeEspresso.xaml.cs delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/EspressoPage.xaml delete mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/EspressoPage.xaml.cs diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 3710590283..80feb8280a 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -87,7 +87,6 @@ args argv Arial arik -arity arjunbalgovind ARPINSTALLLOCATION ARPPRODUCTICON @@ -124,7 +123,6 @@ Autorun AUTOSIZECOLUMNS autoupdate AValid -AWAYMODE azurecr azurewebsites backend @@ -1079,8 +1077,6 @@ localport localtime LOCATIONCHANGE Lockyour -logconsole -logfile LOGFONT LOGMSG logon @@ -1195,7 +1191,6 @@ mimetype Minimizeallwindows MINIMIZEBOX miniz -minlevel MINMAXINFO Miracast MJPG @@ -1415,7 +1410,6 @@ otating OUTOFCONTEXT OUTOFMEMORY Outptr -outputtype outro outsettings OVERLAPPEDWINDOW @@ -1988,7 +1982,6 @@ toggleswitch toolbar Toolchain toolset -toolstrip tooltip toolwindow TOPDOWNDIB @@ -2195,8 +2188,6 @@ windowsx windowwalker winerror WINEVENT -winexe -winforms winfx winget Winhook @@ -2284,7 +2275,6 @@ XOffset xpath XResource xsd -xsi XSmall XStr XToolset diff --git a/PowerToys.sln b/PowerToys.sln index b02f48fe97..a8eb6ef7ae 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -324,12 +324,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeyboardManagerEditorLibrar EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeyboardManagerEditorTest", "src\modules\keyboardmanager\KeyboardManagerEditorTest\KeyboardManagerEditorTest.vcxproj", "{62173D9A-6724-4C00-A1C8-FB646480A9EC}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "espresso", "espresso", "{127F38E0-40AA-4594-B955-5616BF206882}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EspressoModuleInterface", "src\modules\espresso\EspressoModuleInterface\EspressoModuleInterface.vcxproj", "{5E7360A8-D048-4ED3-8F09-0BFD64C5529A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Espresso", "src\modules\espresso\Espresso\Espresso.csproj", "{D940E07F-532C-4FF3-883F-790DA014F19A}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -666,14 +660,6 @@ Global {62173D9A-6724-4C00-A1C8-FB646480A9EC}.Debug|x64.Build.0 = Debug|x64 {62173D9A-6724-4C00-A1C8-FB646480A9EC}.Release|x64.ActiveCfg = Release|x64 {62173D9A-6724-4C00-A1C8-FB646480A9EC}.Release|x64.Build.0 = Release|x64 - {5E7360A8-D048-4ED3-8F09-0BFD64C5529A}.Debug|x64.ActiveCfg = Debug|x64 - {5E7360A8-D048-4ED3-8F09-0BFD64C5529A}.Debug|x64.Build.0 = Debug|x64 - {5E7360A8-D048-4ED3-8F09-0BFD64C5529A}.Release|x64.ActiveCfg = Release|x64 - {5E7360A8-D048-4ED3-8F09-0BFD64C5529A}.Release|x64.Build.0 = Release|x64 - {D940E07F-532C-4FF3-883F-790DA014F19A}.Debug|x64.ActiveCfg = Debug|x64 - {D940E07F-532C-4FF3-883F-790DA014F19A}.Debug|x64.Build.0 = Debug|x64 - {D940E07F-532C-4FF3-883F-790DA014F19A}.Release|x64.ActiveCfg = Release|x64 - {D940E07F-532C-4FF3-883F-790DA014F19A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -773,9 +759,6 @@ Global {8DF78B53-200E-451F-9328-01EB907193AE} = {38BDB927-829B-4C65-9CD9-93FB05D66D65} {23D2070D-E4AD-4ADD-85A7-083D9C76AD49} = {38BDB927-829B-4C65-9CD9-93FB05D66D65} {62173D9A-6724-4C00-A1C8-FB646480A9EC} = {38BDB927-829B-4C65-9CD9-93FB05D66D65} - {127F38E0-40AA-4594-B955-5616BF206882} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC} - {5E7360A8-D048-4ED3-8F09-0BFD64C5529A} = {127F38E0-40AA-4594-B955-5616BF206882} - {D940E07F-532C-4FF3-883F-790DA014F19A} = {127F38E0-40AA-4594-B955-5616BF206882} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0} diff --git a/doc/images/icons/Espresso.png b/doc/images/icons/Espresso.png deleted file mode 100644 index 2ff48cb39e49f2c4ca3485aad7b3bbb24ef8c715..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14255 zcmeHuWm6qbu=gGg?gV#tcL;WHLU7mML4pSN0|W~mJh($3cyLc}w;;jY-8sO+|9*kz z{jIxIyHi`gs-5ZX>7KTYR8x`1KqWy10085if{e!N*!ACyjQIN0Sh7cY9pGK1-f1Df zUVg}y5dc61ypxgC^7?S>kCJJmo&5asK!vKXHSuIj?u`s`D=!=k4aB<$Fzb7o?c3qnQMdG{IMSX8Z=eTPL_pC>+L8#k0?vvPQ*WFBoBe&y z5KqAQ?f<>~|2W}90{C>??v)U;lJ9Xl&GE1vuX|IlCM!m-NRCm!3T`KM?>vPtpZi}h z`@6AVzA#sxd&YQcyPjQ~TiH3n+xNH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G`?61D=(qavAMpb7WIp-Zz$ zaa31<@J}&QZ!&dOHFjX4OJQrbyTikiBFre9AJoNjOpN^;gP|vC-?fsLac+NlRB`Pm zDRyr}+Oic-J+^S3#Ibb}bu@80u5a(=+sNk1s8XNK>H1`o;0JG3N-YcCG917?dnMgX z(%$z!qV}AMERi32W(`%j+#hVle@=48K2D$r2IoMsI{w*}o^!CdU=483c%5i|f&mYotn#Q?UhLj}+bo-!K7s zY@OfLF<@8exfXAk6q>oB3YgPtuA4a7h1K6|?HnT{iyd^-`a2#5)eaJ)Iv`;^&&lf& z{2cMFd@W}2su-SEndXh5#cSGL@I_hTv`ncukj$Ea&?pO*)D=$yD=ngZL(iTrw$lPy zw9?fu(e|k;D3th)nBOyB!U(uDs4}jEkwP5FY=Z4mmgL);*1fjJKE9Sqz98ysZ-_Qj z8dyh}N{&J(=-Dnr?m^BEqpBgF*-%^G8)7L73|qALm(`2wp+{Big_a#jzPG(pcuusJ zLFFH+9UgLp-u#&o!`QNXw=W)&typ4fD2yGYt>o(~W)cwmyV>&vt zKaKF^JZ0((n>+gljt};Bw;MSoF{t;$hM0!hv-0KxDmti|^p@U&t~563KpykyE^%(R zwiqFRSrBMZF?3oGh2`TU*vJtD z=a@aP26~sd`N)Oze-Hig-YpJyZam>L0R^Fq z5PH6$xXzE9j&sHwzYYkwq7Y`?T^yH9Q%Bnhki~oBxMZz?NsxQlMZ+H|`pTNyRJnHMz6Zr~CD%EhaCx zrR}KXSFGm3QbzpTL#xK^rvFVW3Oc#y nReZ(t?pw - - @@ -214,26 +212,16 @@ - - - - - - - - - - @@ -278,10 +266,9 @@ + - - @@ -368,7 +355,6 @@ - @@ -386,8 +372,6 @@ - - @@ -493,7 +477,6 @@ - @@ -523,7 +506,6 @@ - - @@ -601,35 +582,30 @@ - - - - - @@ -638,7 +614,6 @@ - @@ -646,27 +621,6 @@ - - - - - - - - - - @@ -846,7 +800,6 @@ - diff --git a/src/common/SettingsAPI/settings_helpers.h b/src/common/SettingsAPI/settings_helpers.h index cd8f39432b..1174032fe2 100644 --- a/src/common/SettingsAPI/settings_helpers.h +++ b/src/common/SettingsAPI/settings_helpers.h @@ -8,7 +8,6 @@ namespace PTSettingsHelper { constexpr inline const wchar_t* log_settings_filename = L"log_settings.json"; - std::wstring get_module_save_file_location(std::wstring_view powertoy_key); std::wstring get_module_save_folder_location(std::wstring_view powertoy_name); std::wstring get_root_save_folder_location(); diff --git a/src/modules/espresso/Espresso/Core/APIHelper.cs b/src/modules/espresso/Espresso/Core/APIHelper.cs deleted file mode 100644 index 03902740c4..0000000000 --- a/src/modules/espresso/Espresso/Core/APIHelper.cs +++ /dev/null @@ -1,245 +0,0 @@ -// 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.IO; -using System.Runtime.InteropServices; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Win32; -using NLog; - -namespace Espresso.Shell.Core -{ - [Flags] - public enum EXECUTION_STATE : uint - { - ES_AWAYMODE_REQUIRED = 0x00000040, - ES_CONTINUOUS = 0x80000000, - ES_DISPLAY_REQUIRED = 0x00000002, - ES_SYSTEM_REQUIRED = 0x00000001, - } - - /// - /// Helper class that allows talking to Win32 APIs without having to rely on PInvoke in other parts - /// of the codebase. - /// - public class APIHelper - { - private const string BuildRegistryLocation = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion"; - public const int StdOutputHandle = -11; - public const int StdInputHandle = -10; - public const int StdErrorHandle = -12; - public const uint GenericWrite = 0x40000000; - public const uint GenericRead = 0x80000000; - - private static readonly Logger _log; - private static CancellationTokenSource _tokenSource; - private static CancellationToken _threadToken; - - [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] - private static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags); - - [DllImport("kernel32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool AllocConsole(); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool SetStdHandle(int nStdHandle, IntPtr hHandle); - - [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern IntPtr CreateFile( - [MarshalAs(UnmanagedType.LPTStr)] string filename, - [MarshalAs(UnmanagedType.U4)] uint access, - [MarshalAs(UnmanagedType.U4)] FileShare share, - IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, - [MarshalAs(UnmanagedType.U4)] FileAttributes flagsAndAttributes, - IntPtr templateFile); - - static APIHelper() - { - _log = LogManager.GetCurrentClassLogger(); - _tokenSource = new CancellationTokenSource(); - } - - public static void AllocateConsole() - { - AllocConsole(); - - var outputFilePointer = CreateFile("CONOUT$", GenericRead | GenericWrite, FileShare.Write, IntPtr.Zero, FileMode.OpenOrCreate, 0, IntPtr.Zero); - - SetStdHandle(StdOutputHandle, outputFilePointer); - Console.SetOut(new StreamWriter(Console.OpenStandardOutput(), Console.OutputEncoding) { AutoFlush = true }); - } - - /// - /// Sets the computer awake state using the native Win32 SetThreadExecutionState API. This - /// function is just a nice-to-have wrapper that helps avoid tracking the success or failure of - /// the call. - /// - /// Single or multiple EXECUTION_STATE entries. - /// true if successful, false if failed - private static bool SetAwakeState(EXECUTION_STATE state) - { - try - { - var stateResult = SetThreadExecutionState(state); - return stateResult != 0; - } - catch - { - return false; - } - } - - public static void SetIndefiniteKeepAwake(Action callback, Action failureCallback, bool keepDisplayOn = true) - { - _tokenSource = new CancellationTokenSource(); - _threadToken = _tokenSource.Token; - - Task.Run(() => RunIndefiniteLoop(keepDisplayOn), _threadToken) - .ContinueWith((result) => callback(result.Result), TaskContinuationOptions.OnlyOnRanToCompletion) - .ContinueWith((result) => failureCallback, TaskContinuationOptions.NotOnRanToCompletion); - } - - public static void SetTimedKeepAwake(uint seconds, Action callback, Action failureCallback, bool keepDisplayOn = true) - { - _tokenSource = new CancellationTokenSource(); - _threadToken = _tokenSource.Token; - - Task.Run(() => RunTimedLoop(seconds, keepDisplayOn), _threadToken) - .ContinueWith((result) => callback(result.Result), TaskContinuationOptions.OnlyOnRanToCompletion) - .ContinueWith((result) => failureCallback, TaskContinuationOptions.NotOnRanToCompletion); - } - - private static bool RunIndefiniteLoop(bool keepDisplayOn = true) - { - bool success; - if (keepDisplayOn) - { - success = SetAwakeState(EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_DISPLAY_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS); - } - else - { - success = SetAwakeState(EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS); - } - - try - { - if (success) - { - _log.Info("Initiated indefinite keep awake in background thread."); - while (true) - { - if (_threadToken.IsCancellationRequested) - { - _threadToken.ThrowIfCancellationRequested(); - } - } - } - else - { - _log.Info("Could not successfully set up indefinite keep awake."); - return success; - } - } - catch (OperationCanceledException ex) - { - // Task was clearly cancelled. - _log.Info($"Background thread termination. Message: {ex.Message}"); - return success; - } - } - - private static bool RunTimedLoop(uint seconds, bool keepDisplayOn = true) - { - bool success = false; - - // In case cancellation was already requested. - _threadToken.ThrowIfCancellationRequested(); - try - { - if (keepDisplayOn) - { - success = SetAwakeState(EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_DISPLAY_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS); - if (success) - { - _log.Info("Timed keep-awake with display on."); - var startTime = DateTime.UtcNow; - while (DateTime.UtcNow - startTime < TimeSpan.FromSeconds(Math.Abs(seconds))) - { - if (_threadToken.IsCancellationRequested) - { - _threadToken.ThrowIfCancellationRequested(); - } - } - - return success; - } - else - { - _log.Info("Could not set up timed keep-awake with display on."); - return success; - } - } - else - { - success = SetAwakeState(EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS); - if (success) - { - _log.Info("Timed keep-awake with display off."); - var startTime = DateTime.UtcNow; - while (DateTime.UtcNow - startTime < TimeSpan.FromSeconds(Math.Abs(seconds))) - { - if (_threadToken.IsCancellationRequested) - { - _threadToken.ThrowIfCancellationRequested(); - } - } - - return success; - } - else - { - _log.Info("Could not set up timed keep-awake with display off."); - return success; - } - } - } - catch (OperationCanceledException ex) - { - // Task was clearly cancelled. - _log.Info($"Background thread termination. Message: {ex.Message}"); - return success; - } - } - - public static string GetOperatingSystemBuild() - { - try - { -#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. - RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(BuildRegistryLocation); -#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. - - if (registryKey != null) - { - var versionString = $"{registryKey.GetValue("ProductName")} {registryKey.GetValue("DisplayVersion")} {registryKey.GetValue("BuildLabEx")}"; - return versionString; - } - else - { - _log.Debug("Registry key acquisition for OS failed."); - return string.Empty; - } - } - catch (Exception ex) - { - _log.Debug($"Could not get registry key for the build number. Error: {ex.Message}"); - return string.Empty; - } - } - } -} diff --git a/src/modules/espresso/Espresso/Core/TrayHelper.cs b/src/modules/espresso/Espresso/Core/TrayHelper.cs deleted file mode 100644 index 0e163cef57..0000000000 --- a/src/modules/espresso/Espresso/Core/TrayHelper.cs +++ /dev/null @@ -1,226 +0,0 @@ -// 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.Drawing; -using System.Text.Json; -using System.Windows.Forms; -using Microsoft.PowerToys.Settings.UI.Library; - -#pragma warning disable CS8602 // Dereference of a possibly null reference. -#pragma warning disable CS8603 // Possible null reference return. - -namespace Espresso.Shell.Core -{ - internal static class TrayHelper - { - private static NotifyIcon? trayIcon; - - private static NotifyIcon TrayIcon { get => trayIcon; set => trayIcon = value; } - - private static SettingsUtils? moduleSettings; - - private static SettingsUtils ModuleSettings { get => moduleSettings; set => moduleSettings = value; } - - static TrayHelper() - { - TrayIcon = new NotifyIcon(); - ModuleSettings = new SettingsUtils(); - } - - public static void InitializeTray(string text, Icon icon, ContextMenuStrip? contextMenu = null) - { - System.Threading.Tasks.Task.Factory.StartNew( - (tray) => - { - ((NotifyIcon?)tray).Text = text; - ((NotifyIcon?)tray).Icon = icon; - ((NotifyIcon?)tray).ContextMenuStrip = contextMenu; - ((NotifyIcon?)tray).Visible = true; - - Application.Run(); - }, TrayIcon); - } - - internal static void SetTray(string text, EspressoSettings settings) - { - SetTray( - text, - settings.Properties.KeepDisplayOn, - settings.Properties.Mode, - IndefiniteKeepAwakeCallback(text), - TimedKeepAwakeCallback(text), - KeepDisplayOnCallback(text), - ExitCallback()); - } - - private static Action ExitCallback() - { - return () => - { - Environment.Exit(0); - }; - } - - private static Action KeepDisplayOnCallback(string moduleName) - { - return () => - { - // Just changing the display mode. - var currentSettings = ModuleSettings.GetSettings(moduleName); - currentSettings.Properties.KeepDisplayOn = !currentSettings.Properties.KeepDisplayOn; - - ModuleSettings.SaveSettings(JsonSerializer.Serialize(currentSettings), moduleName); - }; - } - - private static Action TimedKeepAwakeCallback(string moduleName) - { - return (hours, minutes) => - { - // Set timed keep awake. - var currentSettings = ModuleSettings.GetSettings(moduleName); - currentSettings.Properties.Mode = EspressoMode.TIMED; - currentSettings.Properties.Hours = hours; - currentSettings.Properties.Minutes = minutes; - - ModuleSettings.SaveSettings(JsonSerializer.Serialize(currentSettings), moduleName); - }; - } - - private static Action IndefiniteKeepAwakeCallback(string moduleName) - { - return () => - { - // Set indefinite keep awake. - var currentSettings = ModuleSettings.GetSettings(moduleName); - currentSettings.Properties.Mode = EspressoMode.INDEFINITE; - - ModuleSettings.SaveSettings(JsonSerializer.Serialize(currentSettings), moduleName); - }; - } - - public static void SetTray(string text, bool keepDisplayOn, EspressoMode mode, Action indefiniteKeepAwakeCallback, Action timedKeepAwakeCallback, Action keepDisplayOnCallback, Action exitCallback) - { - var contextMenuStrip = new ContextMenuStrip(); - - // Main toolstrip. - var operationContextMenu = new ToolStripMenuItem - { - Text = "Mode", - }; - - // Indefinite keep-awake menu item. - var indefiniteMenuItem = new ToolStripMenuItem - { - Text = "Keep awake indefinitely", - }; - - if (mode == EspressoMode.INDEFINITE) - { - indefiniteMenuItem.Checked = true; - } - else - { - indefiniteMenuItem.Checked = false; - } - - indefiniteMenuItem.Click += (e, s) => - { - // User opted to set the mode to indefinite, so we need to write new settings. - indefiniteKeepAwakeCallback(); - }; - - var displayOnMenuItem = new ToolStripMenuItem - { - Text = "Keep display on", - }; - if (keepDisplayOn) - { - displayOnMenuItem.Checked = true; - } - else - { - displayOnMenuItem.Checked = false; - } - - displayOnMenuItem.Click += (e, s) => - { - // User opted to set the display mode directly. - keepDisplayOnCallback(); - }; - - // Timed keep-awake menu item - var timedMenuItem = new ToolStripMenuItem - { - Text = "Keep awake temporarily", - }; - if (mode == EspressoMode.TIMED) - { - timedMenuItem.Checked = true; - } - else - { - timedMenuItem.Checked = false; - } - - var halfHourMenuItem = new ToolStripMenuItem - { - Text = "30 minutes", - }; - halfHourMenuItem.Click += (e, s) => - { - // User is setting the keep-awake to 30 minutes. - timedKeepAwakeCallback(0, 30); - }; - - var oneHourMenuItem = new ToolStripMenuItem - { - Text = "1 hour", - }; - oneHourMenuItem.Click += (e, s) => - { - // User is setting the keep-awake to 1 hour. - timedKeepAwakeCallback(1, 0); - }; - - var twoHoursMenuItem = new ToolStripMenuItem - { - Text = "2 hours", - }; - twoHoursMenuItem.Click += (e, s) => - { - // User is setting the keep-awake to 2 hours. - timedKeepAwakeCallback(2, 0); - }; - - // Exit menu item. - var exitContextMenu = new ToolStripMenuItem - { - Text = "Exit", - }; - exitContextMenu.Click += (e, s) => - { - // User is setting the keep-awake to 2 hours. - exitCallback(); - }; - - timedMenuItem.DropDownItems.Add(halfHourMenuItem); - timedMenuItem.DropDownItems.Add(oneHourMenuItem); - timedMenuItem.DropDownItems.Add(twoHoursMenuItem); - - operationContextMenu.DropDownItems.Add(indefiniteMenuItem); - operationContextMenu.DropDownItems.Add(timedMenuItem); - operationContextMenu.DropDownItems.Add(new ToolStripSeparator()); - operationContextMenu.DropDownItems.Add(displayOnMenuItem); - - contextMenuStrip.Items.Add(operationContextMenu); - contextMenuStrip.Items.Add(new ToolStripSeparator()); - contextMenuStrip.Items.Add(exitContextMenu); - - TrayIcon.Text = text; - TrayIcon.ContextMenuStrip = contextMenuStrip; - } - } -} diff --git a/src/modules/espresso/Espresso/Espresso.csproj b/src/modules/espresso/Espresso/Espresso.csproj deleted file mode 100644 index 7a23756ddf..0000000000 --- a/src/modules/espresso/Espresso/Espresso.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - WinExe - netcoreapp3.1 - $(SolutionDir)$(Platform)\$(Configuration)\modules\Espresso - enable - x64 - false - false - true - - true - PowerToys.Espresso - $(Version).0 - Images\Espresso.ico - - - - DEBUG;TRACE - full - x64 - prompt - MinimumRecommendedRules.ruleset - 4 - false - true - - - - TRACE;RELEASE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - 4 - true - - - - - - - - - - - - - - - - - - - - - - Never - - - - - - PreserveNewest - - - - - GlobalSuppressions.cs - - - StyleCop.json - - - - - 1.1.118 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - diff --git a/src/modules/espresso/Espresso/Images/Espresso.ico b/src/modules/espresso/Espresso/Images/Espresso.ico deleted file mode 100644 index 875ec0a63be4a5518ea19675963d83d0820c265a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67646 zcmeHw2Y6n^we7e|`m1C}C;!1X5OE;lK*WKF0}%%z4n!P?I1q6l;y}cKhyxJ^A`V0xh&T{&;2)R+%Zrn$ zt~hb#@?pu++F_}Ti)ENE8|p_5<`P91ZB${bDoi3cntA1rWTtXR%0@D?bTA`jBblif zltOScv1DK}vjp?S7(+22nOPK!{>jWjiG&#+OlHa-OxVD@UounHFJU8@DecQhnDK!` zW&!34INF$xasK^&%)@-%eSXZveD1xBxE&Lj+4sb4aE`b;o|z?)z=*gjo|%bpCdL_e z#pceuGv}Q7x8$gKx1PLc?>%0`AJ~trElz2PVHgp>-^9?A2JVQY8H-Z7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vmwzq)i@|ID6F=Y=>@WV4 zK5!QtalJBlJwEIDx~%ISA-v@~n&AKW@%)(vuCH5(pK0*=aMtyI;2R2l{V(C`9v|Zy z41B%CwFc - - - - - - - - - - - - \ No newline at end of file diff --git a/src/modules/espresso/Espresso/Program.cs b/src/modules/espresso/Espresso/Program.cs deleted file mode 100644 index 31b45eebfa..0000000000 --- a/src/modules/espresso/Espresso/Program.cs +++ /dev/null @@ -1,294 +0,0 @@ -// 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.CommandLine; -using System.CommandLine.Invocation; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reflection; -using System.Threading; -using System.Windows; -using Espresso.Shell.Core; -using ManagedCommon; -using Microsoft.PowerToys.Settings.UI.Library; -using NLog; - -#pragma warning disable CS8602 // Dereference of a possibly null reference. -#pragma warning disable CS8603 // Possible null reference return. - -namespace Espresso.Shell -{ - internal class Program - { - private static Mutex? _mutex = null; - private const string AppName = "Espresso"; - private static FileSystemWatcher? _watcher = null; - private static SettingsUtils? _settingsUtils = null; - - public static Mutex LockMutex { get => _mutex; set => _mutex = value; } - - private static Logger? _log; - - private static int Main(string[] args) - { - bool instantiated; - LockMutex = new Mutex(true, AppName, out instantiated); - - if (!instantiated) - { - ForceExit(AppName + " is already running! Exiting the application.", 1); - } - - _log = LogManager.GetCurrentClassLogger(); - _settingsUtils = new SettingsUtils(); - - _log.Info("Launching Espresso..."); - _log.Info(FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion); - _log.Debug($"OS: {Environment.OSVersion}"); - _log.Debug($"OS Build: {APIHelper.GetOperatingSystemBuild()}"); - - var configOption = new Option( - aliases: new[] { "--use-pt-config", "-c" }, - getDefaultValue: () => false, - description: "Specifies whether Espresso will be using the PowerToys configuration file for managing the state.") - { - Argument = new Argument(() => false) - { - Arity = ArgumentArity.ZeroOrOne, - }, - }; - - configOption.Required = false; - - var displayOption = new Option( - aliases: new[] { "--display-on", "-d" }, - getDefaultValue: () => true, - description: "Determines whether the display should be kept awake.") - { - Argument = new Argument(() => false) - { - Arity = ArgumentArity.ZeroOrOne, - }, - }; - - displayOption.Required = false; - - var timeOption = new Option( - aliases: new[] { "--time-limit", "-t" }, - getDefaultValue: () => 0, - description: "Determines the interval, in seconds, during which the computer is kept awake.") - { - Argument = new Argument(() => 0) - { - Arity = ArgumentArity.ExactlyOne, - }, - }; - - timeOption.Required = false; - - var pidOption = new Option( - aliases: new[] { "--pid", "-p" }, - getDefaultValue: () => 0, - description: "Bind the execution of Espresso to another process.") - { - Argument = new Argument(() => 0) - { - Arity = ArgumentArity.ZeroOrOne, - }, - }; - - pidOption.Required = false; - - var rootCommand = new RootCommand - { - configOption, - displayOption, - timeOption, - pidOption, - }; - - rootCommand.Description = AppName; - - rootCommand.Handler = CommandHandler.Create(HandleCommandLineArguments); - - return rootCommand.InvokeAsync(args).Result; - } - - private static void ForceExit(string message, int exitCode) - { - _log.Debug(message); - _log.Info(message); - Console.ReadKey(); - Environment.Exit(exitCode); - } - - private static void HandleCommandLineArguments(bool usePtConfig, bool displayOn, uint timeLimit, int pid) - { - if (pid == 0) - { - APIHelper.AllocateConsole(); - } - - _log.Info($"The value for --use-pt-config is: {usePtConfig}"); - _log.Info($"The value for --display-on is: {displayOn}"); - _log.Info($"The value for --time-limit is: {timeLimit}"); - _log.Info($"The value for --pid is: {pid}"); - - if (usePtConfig) - { -#pragma warning disable CS8604 // Possible null reference argument. - TrayHelper.InitializeTray(AppName, new Icon(Application.GetResourceStream(new Uri("/Images/Espresso.ico", UriKind.Relative)).Stream)); -#pragma warning restore CS8604 // Possible null reference argument. - - // Configuration file is used, therefore we disregard any other command-line parameter - // and instead watch for changes in the file. - try - { - var settingsPath = _settingsUtils.GetSettingsFilePath(AppName); - _log.Info($"Reading configuration file: {settingsPath}"); - - _watcher = new FileSystemWatcher - { - Path = Path.GetDirectoryName(settingsPath), - EnableRaisingEvents = true, - NotifyFilter = NotifyFilters.LastWrite, - Filter = Path.GetFileName(settingsPath), - }; - - Observable.FromEventPattern( - h => _watcher.Changed += h, - h => _watcher.Changed -= h) - .SubscribeOn(TaskPoolScheduler.Default) - .Select(e => e.EventArgs) - .Throttle(TimeSpan.FromMilliseconds(25)) - .Subscribe(HandleEspressoConfigChange); - - // Initially the file might not be updated, so we need to start processing - // settings right away. - ProcessSettings(); - } - catch (Exception ex) - { - var errorString = $"There was a problem with the configuration file. Make sure it exists.\n{ex.Message}"; - _log.Info(errorString); - _log.Debug(errorString); - } - } - else - { - var mode = timeLimit <= 0 ? EspressoMode.INDEFINITE : EspressoMode.TIMED; - - if (mode == EspressoMode.INDEFINITE) - { - SetupIndefiniteKeepAwake(displayOn); - } - else - { - SetupTimedKeepAwake(timeLimit, displayOn); - } - } - - var exitSignal = new ManualResetEvent(false); - if (pid != 0) - { - RunnerHelper.WaitForPowerToysRunner(pid, () => - { - exitSignal.Set(); - Environment.Exit(0); - }); - } - - exitSignal.WaitOne(); - } - - private static void SetupIndefiniteKeepAwake(bool displayOn) - { - // Indefinite keep awake. - APIHelper.SetIndefiniteKeepAwake(LogCompletedKeepAwakeThread, LogUnexpectedOrCancelledKeepAwakeThreadCompletion, displayOn); - } - - private static void HandleEspressoConfigChange(FileSystemEventArgs fileEvent) - { - _log.Info("Detected a settings file change. Updating configuration..."); - _log.Info("Resetting keep-awake to normal state due to settings change."); - ProcessSettings(); - } - - private static void ProcessSettings() - { - try - { - EspressoSettings settings = _settingsUtils.GetSettings(AppName); - - if (settings != null) - { - switch (settings.Properties.Mode) - { - case EspressoMode.INDEFINITE: - { - // Indefinite keep awake. - SetupIndefiniteKeepAwake(settings.Properties.KeepDisplayOn); - break; - } - - case EspressoMode.TIMED: - { - // Timed keep-awake. - uint computedTime = (settings.Properties.Hours * 60 * 60) + (settings.Properties.Minutes * 60); - SetupTimedKeepAwake(computedTime, settings.Properties.KeepDisplayOn); - - break; - } - - default: - { - var errorMessage = "Unknown mode of operation. Check config file."; - _log.Info(errorMessage); - _log.Debug(errorMessage); - break; - } - } - - TrayHelper.SetTray(AppName, settings); - } - else - { - var errorMessage = "Settings are null."; - _log.Info(errorMessage); - _log.Debug(errorMessage); - } - } - catch (Exception ex) - { - var errorMessage = $"There was a problem reading the configuration file. Error: {ex.Message}"; - _log.Info(errorMessage); - _log.Debug(errorMessage); - } - } - - private static void SetupTimedKeepAwake(uint time, bool displayOn) - { - _log.Info($"Timed keep-awake. Expected runtime: {time} seconds with display on setting set to {displayOn}."); - - APIHelper.SetTimedKeepAwake(time, LogCompletedKeepAwakeThread, LogUnexpectedOrCancelledKeepAwakeThreadCompletion, displayOn); - } - - private static void LogUnexpectedOrCancelledKeepAwakeThreadCompletion() - { - var errorMessage = "The keep-awake thread was terminated early."; - _log.Info(errorMessage); - _log.Debug(errorMessage); - } - - private static void LogCompletedKeepAwakeThread(bool result) - { - _log.Info($"Exited keep-awake thread successfully: {result}"); - } - } -} diff --git a/src/modules/espresso/EspressoModuleInterface/EspressoConstants.h b/src/modules/espresso/EspressoModuleInterface/EspressoConstants.h deleted file mode 100644 index 6b97fe7021..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/EspressoConstants.h +++ /dev/null @@ -1,7 +0,0 @@ -#include - -namespace EspressoConstants -{ - // Name of the powertoy module. - inline const std::wstring ModuleKey = L"Espresso"; -} \ No newline at end of file diff --git a/src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.rc b/src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.rc deleted file mode 100644 index 91d08ea09e..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.rc +++ /dev/null @@ -1,72 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_ESPRESSO_NAME "Espresso" -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.vcxproj b/src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.vcxproj deleted file mode 100644 index 5f880d835a..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.vcxproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {5e7360a8-d048-4ed3-8f09-0bfd64c5529a} - Win32Proj - Espresso - EspressoModuleInterface - 10.0.17134.0 - - - - DynamicLibrary - - - - - - - - - - - - - - - $(SolutionDir)$(Platform)\$(Configuration)\modules\Espresso\ - - - - EXAMPLEPOWERTOY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - ..\..\..\common\inc;..\..\..\common\Telemetry;..\..\;..\..\..\;%(AdditionalIncludeDirectories) - - - $(OutDir)$(TargetName)$(TargetExt) - - - - - - - - - - - - Create - Create - pch.h - pch.h - - - - - - {d9b8fc84-322a-4f9f-bbb9-20915c47ddfd} - - - {6955446d-23f7-4023-9bb3-8657f904af99} - - - - - - - - - - - - - - - - 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/espresso/EspressoModuleInterface/EspressoModuleInterface.vcxproj.filters b/src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.vcxproj.filters deleted file mode 100644 index 2dd5624a53..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/EspressoModuleInterface.vcxproj.filters +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Generated Files - - - - - {e8ef1c4e-cc50-4ce5-b00d-4e3ac5c1a7db} - - - {fbd9cdd2-e7d5-4417-9b52-25e345ae9562} - - - {c2a23a2b-5846-440f-b29e-eea748dba12d} - - - {77f1702b-da7f-4ff6-90a3-19db515cf963} - - - - - - - - Resource Files - - - \ No newline at end of file diff --git a/src/modules/espresso/EspressoModuleInterface/dllmain.cpp b/src/modules/espresso/EspressoModuleInterface/dllmain.cpp deleted file mode 100644 index 1dc07afd44..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/dllmain.cpp +++ /dev/null @@ -1,226 +0,0 @@ -#include "pch.h" -#include -#include -#include -#include "trace.h" -#include "resource.h" -#include "EspressoConstants.h" -#include -#include - -#include -#include -#include -#include -#include - -#include - - -BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - Trace::RegisterProvider(); - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - break; - case DLL_PROCESS_DETACH: - Trace::UnregisterProvider(); - break; - } - return TRUE; -} - - - -// The PowerToy name that will be shown in the settings. -const static wchar_t* MODULE_NAME = L"Espresso"; -// Add a description that will we shown in the module settings page. -const static wchar_t* MODULE_DESC = L""; - -// These are the properties shown in the Settings page. -struct ModuleSettings -{ - -} g_settings; - -// Implement the PowerToy Module Interface and all the required methods. -class Espresso : public PowertoyModuleIface -{ - std::wstring app_name; - //contains the non localized key of the powertoy - std::wstring app_key; - -private: - // The PowerToy state. - bool m_enabled = false; - - HANDLE m_hProcess; - - HANDLE send_telemetry_event; - - // Handle to event used to invoke Espresso - HANDLE m_hInvokeEvent; - - // Load initial settings from the persisted values. - void init_settings(); - - bool is_process_running() - { - return WaitForSingleObject(m_hProcess, 0) == WAIT_TIMEOUT; - } - - void launch_process() - { - Logger::trace(L"Launching Espresso process"); - unsigned long powertoys_pid = GetCurrentProcessId(); - - std::wstring executable_args = L"--use-pt-config --pid " + std::to_wstring(powertoys_pid); - Logger::trace(L"Espresso launching with parameters: " + executable_args); - - SHELLEXECUTEINFOW sei{ sizeof(sei) }; - sei.fMask = { SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI }; - sei.lpFile = L"modules\\Espresso\\PowerToys.Espresso.exe"; - sei.nShow = SW_SHOWNORMAL; - sei.lpParameters = executable_args.data(); - if (!ShellExecuteExW(&sei)) - { - DWORD error = GetLastError(); - std::wstring message = L"Espresso failed to start with error = "; - message += std::to_wstring(error); - Logger::error(message); - } - - m_hProcess = sei.hProcess; - } - -public: - // Constructor - Espresso() - { - app_name = GET_RESOURCE_STRING(IDS_ESPRESSO_NAME); - app_key = EspressoConstants::ModuleKey; - - std::filesystem::path logFilePath(PTSettingsHelper::get_module_save_folder_location(this->app_key)); - Logger::init(LogSettings::launcherLoggerName, logFilePath.wstring(), PTSettingsHelper::get_log_settings_file_location()); - Logger::info("Launcher object is constructing"); - init_settings(); - }; - - // Destroy the powertoy and free memory - virtual void destroy() override - { - delete this; - } - - // Return the display name of the powertoy, this will be cached by the runner - virtual const wchar_t* get_name() override - { - return MODULE_NAME; - } - - // Return JSON with the configuration options. - virtual bool get_config(wchar_t* buffer, int* buffer_size) override - { - HINSTANCE hinstance = reinterpret_cast(&__ImageBase); - - // Create a Settings object. - PowerToysSettings::Settings settings(hinstance, get_name()); - settings.set_description(MODULE_DESC); - - return settings.serialize_to_buffer(buffer, buffer_size); - } - - // Return the non localized key of the powertoy, this will be cached by the runner - virtual const wchar_t* get_key() override - { - return app_key.c_str(); - } - - // Signal from the Settings editor to call a custom action. - // This can be used to spawn more complex editors. - virtual void call_custom_action(const wchar_t* action) override - { - static UINT custom_action_num_calls = 0; - try - { - // Parse the action values, including name. - PowerToysSettings::CustomActionObject action_object = - PowerToysSettings::CustomActionObject::from_json_string(action); - } - catch (std::exception&) - { - // Improper JSON. - } - } - - // Called by the runner to pass the updated settings values as a serialized JSON. - virtual void set_config(const wchar_t* config) override - { - try - { - // Parse the input JSON string. - PowerToysSettings::PowerToyValues values = - PowerToysSettings::PowerToyValues::from_json_string(config, get_key()); - - // If you don't need to do any custom processing of the settings, proceed - // to persists the values calling: - values.save_to_settings_file(); - } - catch (std::exception&) - { - // Improper JSON. - } - } - - virtual void enable() - { - ResetEvent(send_telemetry_event); - ResetEvent(m_hInvokeEvent); - launch_process(); - m_enabled = true; - }; - - virtual void disable() - { - if (m_enabled) - { - ResetEvent(send_telemetry_event); - ResetEvent(m_hInvokeEvent); - TerminateProcess(m_hProcess, 1); - } - - m_enabled = false; - } - - // Returns if the powertoys is enabled - virtual bool is_enabled() override - { - return m_enabled; - } -}; - -// Load the settings file. -void Espresso::init_settings() -{ - try - { - // Load and parse the settings file for this PowerToy. - PowerToysSettings::PowerToyValues settings = - PowerToysSettings::PowerToyValues::load_from_settings_file(get_key()); - } - catch (std::exception ex) - { - Logger::warn(L"An exception occurred while loading the settings file"); - // Error while loading from the settings file. Let default values stay as they are. - } -} - - -extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create() -{ - return new Espresso(); -} \ No newline at end of file diff --git a/src/modules/espresso/EspressoModuleInterface/packages.config b/src/modules/espresso/EspressoModuleInterface/packages.config deleted file mode 100644 index 6a0a5a1e09..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/modules/espresso/EspressoModuleInterface/pch.cpp b/src/modules/espresso/EspressoModuleInterface/pch.cpp deleted file mode 100644 index 17305716aa..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/pch.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pch.h" \ No newline at end of file diff --git a/src/modules/espresso/EspressoModuleInterface/pch.h b/src/modules/espresso/EspressoModuleInterface/pch.h deleted file mode 100644 index eddac0fdc1..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/pch.h +++ /dev/null @@ -1,7 +0,0 @@ -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include -#include -#include \ No newline at end of file diff --git a/src/modules/espresso/EspressoModuleInterface/resource.h b/src/modules/espresso/EspressoModuleInterface/resource.h deleted file mode 100644 index 53fc0ecf48..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Espresso.rc -// -#define IDS_ESPRESSO_NAME 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/src/modules/espresso/EspressoModuleInterface/trace.cpp b/src/modules/espresso/EspressoModuleInterface/trace.cpp deleted file mode 100644 index e2508396ca..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/trace.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "pch.h" -#include "trace.h" - -TRACELOGGING_DEFINE_PROVIDER( - g_hProvider, - "Microsoft.PowerToys", - // {38e8889b-9731-53f5-e901-e8a7c1753074} - (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), - TraceLoggingOptionProjectTelemetry()); - -void Trace::RegisterProvider() -{ - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() -{ - TraceLoggingUnregister(g_hProvider); -} diff --git a/src/modules/espresso/EspressoModuleInterface/trace.h b/src/modules/espresso/EspressoModuleInterface/trace.h deleted file mode 100644 index e5c7680cf0..0000000000 --- a/src/modules/espresso/EspressoModuleInterface/trace.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -class Trace -{ -public: - static void RegisterProvider(); - static void UnregisterProvider(); -}; diff --git a/src/runner/main.cpp b/src/runner/main.cpp index deceb91edc..89843c420b 100644 --- a/src/runner/main.cpp +++ b/src/runner/main.cpp @@ -148,7 +148,7 @@ int runner(bool isProcessElevated, bool openSettings, bool openOobe) chdir_current_executable(); // Load Powertoys DLLs - const std::array knownModules = { + const std::array knownModules = { L"modules/FancyZones/fancyzones.dll", L"modules/FileExplorerPreview/powerpreview.dll", L"modules/ImageResizer/ImageResizerExt.dll", @@ -157,7 +157,6 @@ int runner(bool isProcessElevated, bool openSettings, bool openOobe) L"modules/PowerRename/PowerRenameExt.dll", L"modules/ShortcutGuide/ShortcutGuide.dll", L"modules/ColorPicker/ColorPicker.dll", - L"modules/Espresso/EspressoModuleInterface.dll", }; for (const auto& moduleSubdir : knownModules) diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EnabledModules.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EnabledModules.cs index 2167d610bc..1fadcb961b 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EnabledModules.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EnabledModules.cs @@ -143,22 +143,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library } } - private bool espresso = true; - - [JsonPropertyName("Espresso")] - public bool Espresso - { - get => espresso; - set - { - if (espresso != value) - { - LogTelemetryEvent(value); - espresso = value; - } - } - } - public string ToJsonString() { return JsonSerializer.Serialize(this); diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EspressoProperties.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EspressoProperties.cs deleted file mode 100644 index f52be93315..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EspressoProperties.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.Text.Json.Serialization; - -namespace Microsoft.PowerToys.Settings.UI.Library -{ - public class EspressoProperties - { - public EspressoProperties() - { - KeepDisplayOn = false; - Mode = EspressoMode.INDEFINITE; - Hours = 0; - Minutes = 0; - } - - [JsonPropertyName("espresso_keep_display_on")] - public bool KeepDisplayOn { get; set; } - - [JsonPropertyName("espresso_mode")] - public EspressoMode Mode { get; set; } - - [JsonPropertyName("espresso_hours")] - public uint Hours { get; set; } - - [JsonPropertyName("espresso_minutes")] - public uint Minutes { get; set; } - } - - public enum EspressoMode - { - INDEFINITE = 0, - TIMED = 1, - } -} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EspressoSettings.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EspressoSettings.cs deleted file mode 100644 index 63e84e9196..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/EspressoSettings.cs +++ /dev/null @@ -1,35 +0,0 @@ -// 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.Text.Json.Serialization; -using Microsoft.PowerToys.Settings.UI.Library.Interfaces; - -namespace Microsoft.PowerToys.Settings.UI.Library -{ - public class EspressoSettings : BasePTModuleSettings, ISettingsConfig - { - public const string ModuleName = "Espresso"; - public const string ModuleVersion = "1.0.0"; - - public EspressoSettings() - { - Name = ModuleName; - Version = ModuleVersion; - Properties = new EspressoProperties(); - } - - [JsonPropertyName("properties")] - public EspressoProperties Properties { get; set; } - - public string GetModuleName() - { - return Name; - } - - public bool UpgradeSettingsConfiguration() - { - return false; - } - } -} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ISettingsUtils.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ISettingsUtils.cs index 7cfa33be62..ea7b615fcf 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ISettingsUtils.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ISettingsUtils.cs @@ -19,7 +19,5 @@ namespace Microsoft.PowerToys.Settings.UI.Library bool SettingsExists(string powertoy = "", string fileName = "settings.json"); void DeleteSettings(string powertoy = ""); - - string GetSettingsFilePath(string powertoy = "", string fileName = "settings.json"); } } 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 e039aa704e..683e7f0d7e 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 @@ -20,9 +20,6 @@ x64 - DEBUG;TRACE - full - true diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/SettingsUtils.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/SettingsUtils.cs index 926674ab03..eb40f04cf6 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/SettingsUtils.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/SettingsUtils.cs @@ -135,11 +135,5 @@ namespace Microsoft.PowerToys.Settings.UI.Library #endif } } - - // Returns the file path to the settings file, that is exposed from the local ISettingsPath instance. - public string GetSettingsFilePath(string powertoy = "", string fileName = "settings.json") - { - return _settingsPath.GetSettingsPath(powertoy, fileName); - } } } diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/SndEspressoSettings.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/SndEspressoSettings.cs deleted file mode 100644 index e9ccea662c..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/SndEspressoSettings.cs +++ /dev/null @@ -1,32 +0,0 @@ -// 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.Collections.Generic; -using System.Text; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Microsoft.PowerToys.Settings.UI.Library -{ - public class SndEspressoSettings - { - [JsonPropertyName("Espresso")] - public EspressoSettings Settings { get; set; } - - public SndEspressoSettings() - { - } - - public SndEspressoSettings(EspressoSettings settings) - { - Settings = settings; - } - - public string ToJsonString() - { - return JsonSerializer.Serialize(this); - } - } -} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/EspressoViewModel.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/EspressoViewModel.cs deleted file mode 100644 index 3483a35e82..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/EspressoViewModel.cs +++ /dev/null @@ -1,148 +0,0 @@ -// 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.Runtime.CompilerServices; -using Microsoft.PowerToys.Settings.UI.Library.Helpers; -using Microsoft.PowerToys.Settings.UI.Library.Interfaces; - -namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels -{ - public class EspressoViewModel : Observable - { - private GeneralSettings GeneralSettingsConfig { get; set; } - - private EspressoSettings Settings { get; set; } - - private Func SendConfigMSG { get; } - - public EspressoViewModel(ISettingsRepository settingsRepository, ISettingsRepository moduleSettingsRepository, Func ipcMSGCallBackFunc) - { - // To obtain the general settings configurations of PowerToys Settings. - if (settingsRepository == null) - { - throw new ArgumentNullException(nameof(settingsRepository)); - } - - GeneralSettingsConfig = settingsRepository.SettingsConfig; - - // To obtain the settings configurations of Fancy zones. - if (moduleSettingsRepository == null) - { - throw new ArgumentNullException(nameof(moduleSettingsRepository)); - } - - Settings = moduleSettingsRepository.SettingsConfig; - - _isEnabled = GeneralSettingsConfig.Enabled.Espresso; - _keepDisplayOn = Settings.Properties.KeepDisplayOn; - _mode = Settings.Properties.Mode; - _hours = Settings.Properties.Hours; - _minutes = Settings.Properties.Minutes; - - // set the callback functions value to hangle outgoing IPC message. - SendConfigMSG = ipcMSGCallBackFunc; - } - - public bool IsEnabled - { - get => _isEnabled; - set - { - if (_isEnabled != value) - { - _isEnabled = value; - - GeneralSettingsConfig.Enabled.Espresso = value; - - var outgoing = new OutGoingGeneralSettings(GeneralSettingsConfig); - SendConfigMSG(outgoing.ToString()); - NotifyPropertyChanged(); - } - } - } - - public EspressoMode Mode - { - get => _mode; - set - { - if (_mode != value) - { - _mode = value; - OnPropertyChanged(nameof(Mode)); - - Settings.Properties.Mode = value; - NotifyPropertyChanged(); - } - } - } - - public bool KeepDisplayOn - { - get => _keepDisplayOn; - set - { - if (_keepDisplayOn != value) - { - _keepDisplayOn = value; - OnPropertyChanged(nameof(KeepDisplayOn)); - - Settings.Properties.KeepDisplayOn = value; - } - } - } - - public uint Hours - { - get => _hours; - set - { - if (_hours != value) - { - _hours = value; - OnPropertyChanged(nameof(Hours)); - - Settings.Properties.Hours = value; - NotifyPropertyChanged(); - } - } - } - - public uint Minutes - { - get => _minutes; - set - { - if (_minutes != value) - { - _minutes = value; - OnPropertyChanged(nameof(Minutes)); - - Settings.Properties.Minutes = value; - NotifyPropertyChanged(); - } - } - } - - public void NotifyPropertyChanged([CallerMemberName] string propertyName = null) - { - OnPropertyChanged(propertyName); - if (SendConfigMSG != null) - { - SndEspressoSettings outsettings = new SndEspressoSettings(Settings); - SndModuleSettings ipcMessage = new SndModuleSettings(outsettings); - - var targetMessage = ipcMessage.ToJsonString(); - SendConfigMSG(targetMessage); - } - } - - private bool _isEnabled; - private uint _hours; - private uint _minutes; - private bool _keepDisplayOn; - private EspressoMode _mode; - } -} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.UnitTests/Microsoft.PowerToys.Settings.UI.UnitTests.csproj b/src/settings-ui/Microsoft.PowerToys.Settings.UI.UnitTests/Microsoft.PowerToys.Settings.UI.UnitTests.csproj index 6e895111b5..51e345c4d7 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.UnitTests/Microsoft.PowerToys.Settings.UI.UnitTests.csproj +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI.UnitTests/Microsoft.PowerToys.Settings.UI.UnitTests.csproj @@ -1,4 +1,4 @@ - + netcoreapp3.1 @@ -9,9 +9,6 @@ ..\..\..\x64\Debug\SettingsTests\ - full - true - DEBUG;TRACE diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Assets/FluentIcons/FluentIconsEspresso.png b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Assets/FluentIcons/FluentIconsEspresso.png deleted file mode 100644 index 22790a3de26e3934bdb88c0a966fc285ce24ad78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3022 zcmbVO3p7;g9-l&G%1tUa3S$z^VrKR{nPJGAGECCpsAQYHhiM*rnmvr62NBh&E*(9T zVhPi&Q%Xm5N~t(ql61QAsN^bzFp|nW749Cd+qtXrSa+|r_x|?x{l4G-_kVo8 zLKHB8MFvO$0ALZE*kme;;l!jn5@-O8N&#pTDw9N|a+ov@l}?zrh?q46B;p!4ys&r;v;phXfQ@0!v|;62-98 zDXcseQ6gw8@*C7s%fB*!g_g&gvhhVNQt6ZlROu6sxiJxtFQU;=1q>iC(5Cvu!Q%C=NKETV1uRw$%3ATWS_<0fne7smxHj71~k*Q;Hc|1;l3{`?M0UY4X zC1SxLi$oBI1yPv-A;Xyju$+V>8k4~$IkO-J<~9|CV7kDG3a}^ldn1B4T?y#+kDmqz z5nvqumFFx38T4otl@v`EvPe!a10qEOFdd_$L(U)!3Y{6WNw#2x2s@CVa76bqw3)YqWSS4}%MJSeI^~6D14R4wlNkoLP z;^BY--J#$T1-fd0A>zce=nL`qQCi2oN*7<;-*vFc^|dh*_;{Z?P1)TvdE{vgf9tP0`0Hb>i^*U z6_>)0)?42VL7jeKHMA{mhx2~wd1PbQ!AQ;F-97F%y}@;fH#fcyKXNkrI5T)J64j%L z8PdB$8&v>XMRiZVDsDM?1!zb<<79CU#pQ;6j4<^Trvu%OWv)90wp8`y%rW?6Sm_TF z*DOR=s)zTb6Bs|^AS3(7PJWfA^uw30DR}k1rV|gm%Z$HUW`5sEKW~2g?Q>xoob|N> z1*t@(YmwDF=Gr}-X4_58QzV}N$NGeicX-;!>j9A+$g-C1uJ-m{jO%kg zWu>h@m91SopFUlG6F=mxS7#Mon?9?0`d!I4!#2xjRnvgQCG#`q)G7|PZKGJDuEhr5 zrM3)SYe@Vd@O^#YCZ@d`+rZz%)(;M7DS6%XF=BVnZo?AW4|U~X`@;UN4gOxO2syCx z8rOebjRU&sWL3zHClzE5+byVXb@{$)8jill<=gEdB2(Lx3cg`*j<(?H@}uVYcb5Lh4p|sp@s?;^fBx%L;(QR&?^u3vbM~`a-_3vIP*ulcHe~lKP2atL{zttgK`r~D@JCB|2lf(PDaoL<>+w7F#)u) zHuFWCp`!hT<));g8~ZAHBe&+VvnR&?ols!Y=Gj9M8n2+bbiE1!PrdEK%p z(iJJLD6<-^(PX{cJX|_&``T)rfp V$UG ShortcutVisualControl.xaml - - Code @@ -123,9 +121,6 @@ - - OobeEspresso.xaml - OobeColorPicker.xaml @@ -163,9 +158,6 @@ - - EspressoPage.xaml - ColorPickerPage.xaml @@ -205,7 +197,6 @@ - @@ -284,7 +275,7 @@ - + @@ -303,10 +294,6 @@ Designer MSBuild:Compile - - MSBuild:Compile - Designer - Designer MSBuild:Compile @@ -379,10 +366,6 @@ MSBuild:Compile Designer - - MSBuild:Compile - Designer - Designer MSBuild:Compile diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Enums/PowerToysModulesEnum.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Enums/PowerToysModulesEnum.cs index 3a5c7aa1b5..83ca42c99f 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Enums/PowerToysModulesEnum.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Enums/PowerToysModulesEnum.cs @@ -8,7 +8,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Enums { Overview = 0, ColorPicker, - Espresso, FancyZones, FileExplorer, ImageResizer, diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeEspresso.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeEspresso.xaml deleted file mode 100644 index c6581b629b..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeEspresso.xaml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeEspresso.xaml.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeEspresso.xaml.cs deleted file mode 100644 index 6bfe060378..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeEspresso.xaml.cs +++ /dev/null @@ -1,48 +0,0 @@ -// 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.Threading; -using Microsoft.PowerToys.Settings.UI.OOBE.Enums; -using Microsoft.PowerToys.Settings.UI.OOBE.ViewModel; -using Microsoft.PowerToys.Settings.UI.Views; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Navigation; - -namespace Microsoft.PowerToys.Settings.UI.OOBE.Views -{ - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// - public sealed partial class OobeEspresso : Page - { - public OobePowerToysModule ViewModel { get; set; } - - public OobeEspresso() - { - this.InitializeComponent(); - ViewModel = new OobePowerToysModule(OobeShellPage.OobeShellHandler.Modules[(int)PowerToysModulesEnum.Espresso]); - DataContext = ViewModel; - } - - private void SettingsLaunchButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) - { - if (OobeShellPage.OpenMainWindowCallback != null) - { - OobeShellPage.OpenMainWindowCallback(typeof(EspressoPage)); - } - - ViewModel.LogOpeningSettingsEvent(); - } - - protected override void OnNavigatedTo(NavigationEventArgs e) - { - ViewModel.LogOpeningModuleEvent(); - } - - protected override void OnNavigatedFrom(NavigationEventArgs e) - { - ViewModel.LogClosingModuleEvent(); - } - } -} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeShellPage.xaml.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeShellPage.xaml.cs index afe9f34c48..f9eb0df929 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeShellPage.xaml.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/OOBE/Views/OobeShellPage.xaml.cs @@ -88,18 +88,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views Description = loader.GetString("Oobe_ColorPicker_Description"), Link = "https://aka.ms/PowerToysOverview_ColorPicker", }); - Modules.Insert((int)PowerToysModulesEnum.Espresso, new OobePowerToysModule() - { - ModuleName = loader.GetString("Oobe_Espresso"), - Tag = "Espresso", - IsNew = false, - Icon = "\uEC32", - Image = "ms-appx:///Assets/Modules/Espresso.png", - FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsEspresso.png", - PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/FancyZones.gif", - Description = loader.GetString("Oobe_Espresso_Description"), - Link = "https://aka.ms/PowerToysOverview_Espresso", - }); Modules.Insert((int)PowerToysModulesEnum.FancyZones, new OobePowerToysModule() { ModuleName = loader.GetString("Oobe_FancyZones"), @@ -223,7 +211,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views { case "Overview": NavigationFrame.Navigate(typeof(OobeOverview)); break; case "ColorPicker": NavigationFrame.Navigate(typeof(OobeColorPicker)); break; - case "Espresso": NavigationFrame.Navigate(typeof(OobeEspresso)); break; case "FancyZones": NavigationFrame.Navigate(typeof(OobeFancyZones)); break; case "Run": NavigationFrame.Navigate(typeof(OobeRun)); break; case "ImageResizer": NavigationFrame.Navigate(typeof(OobeImageResizer)); break; 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 50e75b2be8..7482ca83ec 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 @@ -121,10 +121,6 @@ General Navigation view item name for General - - Espresso - Product name: Navigation view item name for Espresso - PowerToys Run Product name: Navigation view item name for PowerToys Run @@ -909,10 +905,6 @@ https://aka.ms/PowerToysOverview_ColorPicker URL. Do not loc - - https://aka.ms/PowerToysOverview_Espresso - URL. Do not loc - https://aka.ms/PowerToysOverview_FancyZones URL. Do not loc @@ -1169,60 +1161,38 @@ From there, simply click on a Markdown file or SVG icon in the File Explorer and PowerToys Settings - - About Espresso + + Position & appearance - - A convenient way to keep your computer awake on-demand. + + Show PowerToys Run on + as in Show PowerToys Run on primary monitor - - Enable Espresso + + Monitor with mouse cursor - - Keep awake indefinitely + + Monitor with focused window - - Keep awake temporarily + + Primary monitor - - Keeps the computer awake until the setting is disabled. + + Plugins are loading... - - Keeps the computer awake until the set time elapses. + + Move the color down - - Keep screen on + + Move the color up - - Mode + + Flash zones when switching layout - - Behavior + + Enable quick layout switch - - Hours + + Quick layout switch - - Minutes - - - Den Delimarsky's Espresso - - - https://espresso.den.dev - URL. Do not loc - - - Espresso - Module name, do not loc - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. - - - Open PowerToys Settings and {turn on Espresso} - - - You can always change modes quickly by clicking the {Espresso icon in the system tray} - - \ No newline at end of file + diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/EspressoPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/EspressoPage.xaml deleted file mode 100644 index a0e52bf57a..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/EspressoPage.xaml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/EspressoPage.xaml.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/EspressoPage.xaml.cs deleted file mode 100644 index 5a47c6165b..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/EspressoPage.xaml.cs +++ /dev/null @@ -1,23 +0,0 @@ -// 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 Microsoft.PowerToys.Settings.UI.Library; -using Microsoft.PowerToys.Settings.UI.Library.ViewModels; -using Windows.UI.Xaml.Controls; - -namespace Microsoft.PowerToys.Settings.UI.Views -{ - public sealed partial class EspressoPage : Page - { - private EspressoViewModel ViewModel { get; set; } - - public EspressoPage() - { - var settingsUtils = new SettingsUtils(); - ViewModel = new EspressoViewModel(SettingsRepository.GetInstance(settingsUtils), SettingsRepository.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage); - DataContext = ViewModel; - InitializeComponent(); - } - } -} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ShellPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ShellPage.xaml index 46cd11f4db..96a250ed32 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ShellPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ShellPage.xaml @@ -41,13 +41,7 @@ - - - - - - - + diff --git a/src/settings-ui/PowerToys.Settings/PowerToys.Settings.csproj b/src/settings-ui/PowerToys.Settings/PowerToys.Settings.csproj index 1e2cec7e34..92daaa3d46 100644 --- a/src/settings-ui/PowerToys.Settings/PowerToys.Settings.csproj +++ b/src/settings-ui/PowerToys.Settings/PowerToys.Settings.csproj @@ -34,9 +34,6 @@ ..\..\..\$(Platform)\$(Configuration)\Settings false - full - true - DEBUG;TRACE