Add documentation links (#12598)

* Add documentation links

* Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

* Update src/runner/Resources.resx

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

* Swap order of repo and documentation

* Fix potential security issue

* Add seperator

* Fix failing test and build

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
This commit is contained in:
Ben Constable 2021-08-19 15:32:03 +01:00 committed by GitHub
parent e87e06bae6
commit 44ef29ca39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 2 deletions

View File

@ -109,6 +109,9 @@
<data name="SETTINGS_MENU_TEXT" xml:space="preserve">
<value>Settings</value>
</data>
<data name="DOCUMENTATION_MENU_TEXT" xml:space="preserve">
<value>Open documentation</value>
</data>
<data name="EXIT_MENU_TEXT" xml:space="preserve">
<value>Exit</value>
<comment>Exit as a verb, as in Exit the application</comment>

View File

@ -18,4 +18,5 @@
#define ID_EXIT_MENU_COMMAND 40001
#define ID_SETTINGS_MENU_COMMAND 40002
#define ID_ABOUT_MENU_COMMAND 40003
#define ID_REPORT_BUG_COMMAND 40004
#define ID_REPORT_BUG_COMMAND 40004
#define ID_DOCUMENTATION_MENU_COMMAND 40005

View File

@ -10,6 +10,8 @@
BEGIN
MENUITEM "Settings", ID_SETTINGS_MENU_COMMAND
//MENUITEM "About", ID_ABOUT_MENU_COMMAND
MENUITEM SEPARATOR
MENUITEM "Documentation" ID_DOCUMENTATION_MENU_COMMAND
MENUITEM "Report Bug" ID_REPORT_BUG_COMMAND
MENUITEM SEPARATOR
MENUITEM "Exit", ID_EXIT_MENU_COMMAND

View File

@ -9,6 +9,7 @@
#include <common/utils/resources.h>
#include <common/version/version.h>
#include <common/logger/logger.h>
#include <common/utils/elevation.h>
namespace
{
@ -84,6 +85,7 @@ void handle_tray_command(HWND window, const WPARAM command_id)
}
break;
case ID_REPORT_BUG_COMMAND:
{
std::wstring bug_report_path = get_module_folderpath();
bug_report_path += L"\\Tools\\BugReportTool.exe";
SHELLEXECUTEINFOW sei{ sizeof(sei) };
@ -100,6 +102,14 @@ void handle_tray_command(HWND window, const WPARAM command_id)
break;
}
case ID_DOCUMENTATION_MENU_COMMAND:
{
RunNonElevatedEx(L"https://aka.ms/PowerToysOverview", L"");
break;
}
}
}
LRESULT __stdcall tray_icon_window_proc(HWND window, UINT message, WPARAM wparam, LPARAM lparam)
@ -171,10 +181,12 @@ LRESULT __stdcall tray_icon_window_proc(HWND window, UINT message, WPARAM wparam
static std::wstring settings_menuitem_label = GET_RESOURCE_STRING(IDS_SETTINGS_MENU_TEXT);
static std::wstring exit_menuitem_label = GET_RESOURCE_STRING(IDS_EXIT_MENU_TEXT);
static std::wstring submit_bug_menuitem_label = GET_RESOURCE_STRING(IDS_SUBMIT_BUG_TEXT);
static std::wstring documentation_menuitem_label = GET_RESOURCE_STRING(IDS_DOCUMENTATION_MENU_TEXT);
change_menu_item_text(ID_SETTINGS_MENU_COMMAND, settings_menuitem_label.data());
change_menu_item_text(ID_EXIT_MENU_COMMAND, exit_menuitem_label.data());
change_menu_item_text(ID_REPORT_BUG_COMMAND, submit_bug_menuitem_label.data());
change_menu_item_text(ID_DOCUMENTATION_MENU_COMMAND, documentation_menuitem_label.data());
}
if (!h_sub_menu)
{

View File

@ -1394,7 +1394,10 @@ From there, simply click on a Markdown file or SVG icon in the File Explorer and
<data name="ColorPicker_ColorFormat_ToggleSwitch.AutomationProperties.Name" xml:space="preserve">
<value>Show format in editor</value>
</data>
<data name="GeneralPage_Documentation.Label" xml:space="preserve">
<value>Open documentation</value>
</data>
<data name="PowerLauncher_SearchList.PlaceholderText" xml:space="preserve">
<value>Search this list</value>
</data>
</root>
</root>

View File

@ -222,6 +222,7 @@
<!-- Side panel -->
<controls:SettingsPageControl.ModuleLinks>
<controls:SidePanelLink x:Uid="GeneralPage_Documentation" Link="https://aka.ms/PowerToysOverview"/>
<controls:SidePanelLink x:Uid="General_Repository" Link="https://aka.ms/powertoys"/>
<controls:SidePanelLink x:Uid="GeneralPage_ReportAbug" Link="https://aka.ms/powerToysReportBug"/>
<controls:SidePanelLink x:Uid="GeneralPage_RequestAFeature_URL" Link="https://aka.ms/powerToysRequestFeature"/>