From 4a03756b5b96e5f5de9db8171d47dd792894da24 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 26 May 2020 11:02:36 -0400 Subject: [PATCH] Spelling: ... (#3398) --- doc/devdocs/modules/interface.md | 2 +- doc/devdocs/readme.md | 2 +- doc/devdocs/run-as-admin-detection.md | 2 +- doc/devdocs/runner.md | 2 +- doc/devdocs/settings-reference.md | 4 ++-- ...ide_settings.png => shortcut_guide_settings.png} | Bin src/README.md | 2 +- src/common/animation.h | 4 ++-- src/common/common.cpp | 4 ++-- src/common/common.h | 8 ++++---- src/common/d2d_window.cpp | 2 +- src/common/settings_objects.h | 2 +- .../Strings/en-us/Resources.resw | 2 +- .../ViewModels/KeyboardManagerViewModel.cs | 6 +++--- .../Views/ShellPage.xaml.cs | 2 +- .../ModelsTests/BasePTModuleSettingsTest.cs | 2 +- .../ViewModelTests/ShortcutGuide.cs | 8 ++++---- src/runner/main.cpp | 2 +- tools/FancyZones_zonable_tester/main.cpp | 2 +- tools/project_template/ModuleTemplate/dllmain.cpp | 4 ++-- tools/project_template/README.md | 6 +++--- 21 files changed, 34 insertions(+), 34 deletions(-) rename doc/images/settings/{shorcut_guide_settings.png => shortcut_guide_settings.png} (100%) diff --git a/doc/devdocs/modules/interface.md b/doc/devdocs/modules/interface.md index dc43a91a41..80ff1e4469 100644 --- a/doc/devdocs/modules/interface.md +++ b/doc/devdocs/modules/interface.md @@ -155,7 +155,7 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain. // More settings ... - // Add a custom action property. When using this settings type, the "call_custom_action()" method should be overriden as well. + // Add a custom action property. When using this settings type, the "call_custom_action()" method should be overridden as well. settings.add_custom_action( L"test_custom_action", // action name. L"This is what a CustomAction property looks like", // label above the field. diff --git a/doc/devdocs/readme.md b/doc/devdocs/readme.md index 934700b398..f7f33cf5ea 100644 --- a/doc/devdocs/readme.md +++ b/doc/devdocs/readme.md @@ -6,7 +6,7 @@ - [Coding style](style.md). - Try to package new ideas/components into libraries that have nicely defined interfaces. - Package new ideas into classes or refactor existing ideas into a class as you extend. -- When adding new classes/methos/changing existing code: add new unit tests or update the existing tests. +- When adding new classes/methods/changing existing code: add new unit tests or update the existing tests. ## Github Workflow diff --git a/doc/devdocs/run-as-admin-detection.md b/doc/devdocs/run-as-admin-detection.md index 9a8f2f66db..bc63f4d905 100644 --- a/doc/devdocs/run-as-admin-detection.md +++ b/doc/devdocs/run-as-admin-detection.md @@ -8,7 +8,7 @@ If you're running any application as an administrator (aka elevated) and PowerTo We understand users will run applications elevated. We do as well. We have two options for you when this scenario happens: -1. **Recommended:** PowerToys will prompt when we detect a process that is elevated. Go to PowerToys settings inside the General Tab and click "Relaunch as adminstrator". +1. **Recommended:** PowerToys will prompt when we detect a process that is elevated. Go to PowerToys settings inside the General Tab and click "Relaunch as administrator". 2. Enable "Always run as administrator" in the PowerToys settings. ## What is "Run as Administrator" / Elevated processes diff --git a/doc/devdocs/runner.md b/doc/devdocs/runner.md index 9fff233c12..9094082319 100644 --- a/doc/devdocs/runner.md +++ b/doc/devdocs/runner.md @@ -1,5 +1,5 @@ #### [`main.cpp`](/src/runner/main.cpp) -Contains the executable starting point, initialization code and the list of known PowerToys. All singletones are also initialized here at the start. Loads all the powertoys by scanning the `./modules` folder and `enable()`s those makred as enabled in `%LOCALAPPDATA%\Microsoft\PowerToys\settings.json` config. Then it runs [a message loop](https://docs.microsoft.com/en-us/windows/win32/winmsg/using-messages-and-message-queues) for the tray UI. Note that this message loop also [handles lowlevel_keyboard_hook events](https://github.com/microsoft/PowerToys/blob/1760af50c8803588cb575167baae0439af38a9c1/src/runner/lowlevel_keyboard_event.cpp#L24). +Contains the executable starting point, initialization code and the list of known PowerToys. All singletones are also initialized here at the start. Loads all the powertoys by scanning the `./modules` folder and `enable()`s those marked as enabled in `%LOCALAPPDATA%\Microsoft\PowerToys\settings.json` config. Then it runs [a message loop](https://docs.microsoft.com/en-us/windows/win32/winmsg/using-messages-and-message-queues) for the tray UI. Note that this message loop also [handles lowlevel_keyboard_hook events](https://github.com/microsoft/PowerToys/blob/1760af50c8803588cb575167baae0439af38a9c1/src/runner/lowlevel_keyboard_event.cpp#L24). #### [`general_settings.cpp`](./general_settings.cpp) #### [`powertoy_module.h`](/src/runner/powertoy_module.h) and [`powertoy_module.cpp`](/src/runner/powertoy_module.cpp) diff --git a/doc/devdocs/settings-reference.md b/doc/devdocs/settings-reference.md index fedd64272a..ea352e9846 100644 --- a/doc/devdocs/settings-reference.md +++ b/doc/devdocs/settings-reference.md @@ -80,7 +80,7 @@ Example module JSON (taken from Shortcut Guide): ``` produces this settings screen: -![Shortcut Guide settings](../images/settings/shorcut_guide_settings.png) +![Shortcut Guide settings](../images/settings/shortcut_guide_settings.png) ### Helper methods @@ -191,7 +191,7 @@ settings.set_icon_key(L"pt-example"); settings.add_string(L"string_val", L"Example string label", L"example value"); settings.add_int_spinner(L"int_val", L"Example int label", 0, 0, 100, 10); ``` -You can then use `std::wstring serialize()` or `bool serialize_to_buffer(wchar_t* buffer, int* uffer_size)` methods to generate output JSON string. +You can then use `std::wstring serialize()` or `bool serialize_to_buffer(wchar_t* buffer, int* buffer_size)` methods to generate output JSON string. ### Saving settings Use diff --git a/doc/images/settings/shorcut_guide_settings.png b/doc/images/settings/shortcut_guide_settings.png similarity index 100% rename from doc/images/settings/shorcut_guide_settings.png rename to doc/images/settings/shortcut_guide_settings.png diff --git a/src/README.md b/src/README.md index a9c4b00d48..25fc36bd0f 100644 --- a/src/README.md +++ b/src/README.md @@ -5,4 +5,4 @@ The PowerToys are split into DLLs for each PowerToy module ([`modules`](/src/mod The settings window is a separate executable, contained in [`settings`](/src/settings) folder. It utilizes a WebView to display an HTML-based settings window (contained in [`settings-web`](/src/settings-web) folder). -The [`common`](/src/common) contains code for a static libary with helper functions, used by both the runner and the PowerToys modules. +The [`common`](/src/common) contains code for a static library with helper functions, used by both the runner and the PowerToys modules. diff --git a/src/common/animation.h b/src/common/animation.h index 8054169e20..0d75c56895 100644 --- a/src/common/animation.h +++ b/src/common/animation.h @@ -3,12 +3,12 @@ /* Usage: - When creating animation contstructor takes one parameter - how long + When creating animation constructor takes one parameter - how long should the animation take in seconds. Call reset() when starting animation. - When redering, call value() to get value from 0 to 1 - depending on animation + When rendering, call value() to get value from 0 to 1 - depending on animation progress. */ class Animation diff --git a/src/common/common.cpp b/src/common/common.cpp index e822e3bd68..2ebc17d7c8 100644 --- a/src/common/common.cpp +++ b/src/common/common.cpp @@ -191,7 +191,7 @@ ShortcutGuideFilter get_shortcutguide_filtered_window() // WinKey + Up just won't maximize the window. Similary, without // WS_MINIMIZEBOX the window will not get minimized. A "Save As..." dialog // is a example of such window - it can be snapped to both sides and to - // all screen conrers, but will not get maximized nor minimized. + // all screen corners, but will not get maximized nor minimized. // For now, since ShortcutGuide can only disable entire "Windows Controls" // group, we require that the window supports all the options. result.snappable = ((style & WS_MAXIMIZEBOX) == WS_MAXIMIZEBOX) && @@ -577,7 +577,7 @@ std::wstring get_process_path(HWND window) noexcept if (name.length() >= app_frame_host.length() && name.compare(name.length() - app_frame_host.length(), app_frame_host.length(), app_frame_host) == 0) { - // It is a UWP app. We will enumarate the windows and look for one created + // It is a UWP app. We will enumerate the windows and look for one created // by something with a different PID DWORD new_pid = pid; EnumChildWindows( diff --git a/src/common/common.h b/src/common/common.h index cd9758860e..5f70c1be7e 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -6,12 +6,12 @@ #include #include -// Returns RECT with positions of the minmize/maximize buttons of the given window. +// Returns RECT with positions of the minimize/maximize buttons of the given window. // Does not always work, since some apps draw custom toolbars. std::optional get_button_pos(HWND hwnd); // Gets position of given window. std::optional get_window_pos(HWND hwnd); -// Gets mouse postion. +// Gets mouse position. std::optional get_mouse_pos(); // Test if window can be zoned by FancyZones @@ -63,7 +63,7 @@ WindowState get_window_state(HWND hwnd); // Returns true if the current process is running with elevated privileges bool is_process_elevated(const bool use_cached_value = true); -// Drops the elevated privilages if present +// Drops the elevated privileges if present bool drop_elevated_privileges(); // Run command as elevated user, returns true if succeeded @@ -72,7 +72,7 @@ bool run_elevated(const std::wstring& file, const std::wstring& params); // Run command as non-elevated user, returns true if succeeded, puts the process id into returnPid if returnPid != NULL bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid); -// Run command with the same elevation, returns true if succedded +// Run command with the same elevation, returns true if succeeded bool run_same_elevation(const std::wstring& file, const std::wstring& params); // Returns true if the current process is running from administrator account diff --git a/src/common/d2d_window.cpp b/src/common/d2d_window.cpp index fea43b0de2..2556b48aa4 100644 --- a/src/common/d2d_window.cpp +++ b/src/common/d2d_window.cpp @@ -69,7 +69,7 @@ void D2DWindow::base_init() &options, d2d_factory.put_void())); } - // For all other stuff - assing nullptr first to release the object, to reset the com_ptr. + // For all other stuff - assign nullptr first to release the object, to reset the com_ptr. d2d_dc = nullptr; d2d_device = nullptr; dxgi_factory = nullptr; diff --git a/src/common/settings_objects.h b/src/common/settings_objects.h index 5bcd26f672..4760d35eff 100644 --- a/src/common/settings_objects.h +++ b/src/common/settings_objects.h @@ -159,7 +159,7 @@ namespace PowerToysSettings { auto layout = GetKeyboardLayout(0); auto scan_code = MapVirtualKeyExW(key_code, MAPVK_VK_TO_VSC_EX, layout); - // Determinate if vk is an extended key. Unfortunatly MAPVK_VK_TO_VSC_EX + // Determinate if vk is an extended key. Unfortunately MAPVK_VK_TO_VSC_EX // does not return correct values. static std::vector extended_keys = { VK_APPS, diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw b/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw index 990cfee37a..6a7cc6d078 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw +++ b/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw @@ -175,7 +175,7 @@ Select the profile to display the active key remap and shortcuts - Keyboard Manager configuration dropdown decription + Keyboard Manager configuration dropdown description Remap a key diff --git a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/KeyboardManagerViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/KeyboardManagerViewModel.cs index a4e4c304b6..7fe6ab3c77 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/KeyboardManagerViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/KeyboardManagerViewModel.cs @@ -45,7 +45,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels dispatcher = Window.Current.Dispatcher; if (SettingsUtils.SettingsExists(PowerToyName)) { - // Todo: Be more resillent while reading and saving settings. + // Todo: Be more resilient while reading and saving settings. settings = SettingsUtils.GetSettings(PowerToyName); // Load profile. @@ -158,8 +158,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels private async void OnConfigFileUpdate() { - // Note: FileSystemWatcher raise notification mutiple times for single update operation. - // Todo: Handle duplicate events either by somehow supress them or re-read the configuration everytime since we will be updating the UI only if something is changed. + // Note: FileSystemWatcher raise notification multiple times for single update operation. + // Todo: Handle duplicate events either by somehow suppress them or re-read the configuration everytime since we will be updating the UI only if something is changed. if (LoadProfile()) { await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Views/ShellPage.xaml.cs b/src/core/Microsoft.PowerToys.Settings.UI/Views/ShellPage.xaml.cs index ffc3601b8f..2a594835ad 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Views/ShellPage.xaml.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI/Views/ShellPage.xaml.cs @@ -13,7 +13,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views public sealed partial class ShellPage : UserControl { /// - /// Delcaration for the ipc callback function. + /// Declaration for the ipc callback function. /// /// message. public delegate void IPCMessageCallback(string msg); diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ModelsTests/BasePTModuleSettingsTest.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ModelsTests/BasePTModuleSettingsTest.cs index bc1034c287..42e351d1ee 100644 --- a/src/core/Microsoft.PowerToys.Settings.UnitTest/ModelsTests/BasePTModuleSettingsTest.cs +++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ModelsTests/BasePTModuleSettingsTest.cs @@ -12,7 +12,7 @@ namespace CommonLibTest { // Work around for System.JSON required properties: // https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to. - // Test also failes when the attributes are not initiliazed i.e they have null values. + // Test also fails when the attributes are not initialized i.e they have null values. [TestMethod] [Obsolete] public void ToJsonString_ShouldReturnValidJSONOfModel_WhenSuccessful() diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ShortcutGuide.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ShortcutGuide.cs index d050116930..6381692d57 100644 --- a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ShortcutGuide.cs +++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ShortcutGuide.cs @@ -58,7 +58,7 @@ namespace ViewModelTests ShortcutGuideViewModel viewModel = new ShortcutGuideViewModel(); // Assert - // Initilize mock function of sending IPC message. + // Initialize mock function of sending IPC message. ShellPage.DefaultSndMSGCallback = msg => { OutGoingGeneralSettings snd = JsonSerializer.Deserialize(msg); @@ -77,7 +77,7 @@ namespace ViewModelTests Assert.AreEqual(1, viewModel.ThemeIndex); // Assert - // Initilize mock function of sending IPC message. + // Initialize mock function of sending IPC message. ShellPage.DefaultSndMSGCallback = msg => { ShortcutGuideSettingsIPCMessage snd = JsonSerializer.Deserialize(msg); @@ -96,7 +96,7 @@ namespace ViewModelTests Assert.AreEqual(900, viewModel.PressTime); // Assert - // Initilize mock function of sending IPC message. + // Initialize mock function of sending IPC message. ShellPage.DefaultSndMSGCallback = msg => { ShortcutGuideSettingsIPCMessage snd = JsonSerializer.Deserialize(msg); @@ -115,7 +115,7 @@ namespace ViewModelTests Assert.AreEqual(90, viewModel.OverlayOpacity); // Assert - // Initilize mock function of sending IPC message. + // Initialize mock function of sending IPC message. ShellPage.DefaultSndMSGCallback = msg => { ShortcutGuideSettingsIPCMessage snd = JsonSerializer.Deserialize(msg); diff --git a/src/runner/main.cpp b/src/runner/main.cpp index e90db58eea..d1c20fd438 100644 --- a/src/runner/main.cpp +++ b/src/runner/main.cpp @@ -120,7 +120,7 @@ int runner(bool isProcessElevated) notifications::register_background_toast_handler(); chdir_current_executable(); - // Load Powertyos DLLS + // Load Powertoys DLLS // For now only load known DLLs std::wstring baseModuleFolder = L"modules/"; diff --git a/tools/FancyZones_zonable_tester/main.cpp b/tools/FancyZones_zonable_tester/main.cpp index 36084612e1..f39eb214c7 100644 --- a/tools/FancyZones_zonable_tester/main.cpp +++ b/tools/FancyZones_zonable_tester/main.cpp @@ -30,7 +30,7 @@ std::wstring get_process_path(HWND window) noexcept if (name.length() >= app_frame_host.length() && name.compare(name.length() - app_frame_host.length(), app_frame_host.length(), app_frame_host) == 0) { - // It is a UWP app. We will enumarate the windows and look for one created + // It is a UWP app. We will enumerate the windows and look for one created // by something with a different PID DWORD new_pid = pid; EnumChildWindows(window, [](HWND hwnd, LPARAM param) -> BOOL { diff --git a/tools/project_template/ModuleTemplate/dllmain.cpp b/tools/project_template/ModuleTemplate/dllmain.cpp index be128ce14b..2058936dde 100644 --- a/tools/project_template/ModuleTemplate/dllmain.cpp +++ b/tools/project_template/ModuleTemplate/dllmain.cpp @@ -75,7 +75,7 @@ public: } // Return array of the names of all events that this powertoy listens for, with - // nullptr as the last element of the array. Nullptr can also be retured for empty + // nullptr as the last element of the array. Nullptr can also be returned for empty // list. virtual const wchar_t** get_events() override { @@ -138,7 +138,7 @@ public: //); // A custom action property. When using this settings type, the "PowertoyModuleIface::call_custom_action()" - // method should be overriden as well. + // method should be overridden as well. //settings.add_custom_action( // L"custom_action_id", // action name. // L"This is what a CustomAction property looks like", // label above the field. diff --git a/tools/project_template/README.md b/tools/project_template/README.md index d146ae7125..f6ac6af00f 100644 --- a/tools/project_template/README.md +++ b/tools/project_template/README.md @@ -104,7 +104,7 @@ Here's an example from [the example PowerToy implementation](/src/modules/exampl ); // Add a custom action property. When using this settings type, the "PowertoyModuleIface::call_custom_action()" - // method should be overriden as well. + // method should be overridden as well. settings.add_custom_action( L"test_custom_action", // action name. L"This is what a CustomAction property looks like", // label above the field. @@ -174,7 +174,7 @@ or ```cpp settings.set_description(description_resource_id); ``` -where `description_resource_id` is the UINT index of a resouce string in the project .rc file. +where `description_resource_id` is the UINT index of a resource string in the project .rc file. #### icon_key The identifier of the PowerToy icon in the [`settings-web` project](/src/settings-web#updating-the-icons). @@ -297,7 +297,7 @@ A custom action property, invoked from the settings by a Button control. This ca It can be added to a `Settings` object by calling `add_custom_action`. ```cpp // Add a custom action property. When using this settings type, the "PowertoyModuleIface::call_custom_action()" -// method should be overriden as well. +// method should be overridden as well. settings.add_custom_action( L"test_custom_action", // action name. L"This is what a CustomAction property looks like", // label above the field: a string literal or a resource id