From e7a79d9c9ebb00433e0ecfcf4215a7b5cc6fdbc0 Mon Sep 17 00:00:00 2001 From: AdamSotak <92621643+AdamSotak@users.noreply.github.com> Date: Tue, 19 Jul 2022 21:59:02 +0200 Subject: [PATCH] Added Source Code and Send Feedback buttons to About dialog (#13510) ## Summary of the Pull Request Added two new buttons to the About dialog. Source Code and Send Feedback buttons link directly to the Terminal project on GitHub and to the Issues page respectively. ## References #13371 ## PR Checklist * [ ] Closes #13371 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #13371 ## Validation Steps Performed Performed manual testing and confirmed that the implementation works. --- src/cascadia/TerminalApp/Resources/en-US/Resources.resw | 7 +++++++ src/cascadia/TerminalApp/TerminalPage.cpp | 9 +++++++-- src/cascadia/TerminalApp/TerminalPage.h | 1 + src/cascadia/TerminalApp/TerminalPage.xaml | 5 ++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw index 29e70316f88..195535985d9 100644 --- a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw @@ -436,6 +436,9 @@ About + + Send Feedback + OK @@ -447,6 +450,10 @@ Getting Started A hyperlink name for a guide on how to get started using Terminal + + Source Code + A hyperlink name for the Terminal's documentation + Documentation A hyperlink name for user documentation diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index f4b2f262d62..2032125d0e4 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -693,8 +693,8 @@ namespace winrt::TerminalApp::implementation // Method Description: // - Show a dialog with "About" information. Displays the app's Display - // Name, version, getting started link, documentation link, release - // Notes link, and privacy policy link. + // Name, version, getting started link, source code link, documentation link, release + // Notes link, send feedback link and privacy policy link. void TerminalPage::_ShowAboutDialog() { _ShowDialogHelper(L"AboutDialog"); @@ -710,6 +710,11 @@ namespace winrt::TerminalApp::implementation return CascadiaSettings::ApplicationVersion(); } + void TerminalPage::_SendFeedbackOnClick(const IInspectable& /*sender*/, const Windows::UI::Xaml::Controls::ContentDialogButtonClickEventArgs& /*eventArgs*/) + { + ShellExecute(nullptr, nullptr, L"https://github.com/microsoft/terminal/issues", nullptr, nullptr, SW_SHOW); + } + void TerminalPage::_ThirdPartyNoticesOnClick(const IInspectable& /*sender*/, const Windows::UI::Xaml::RoutedEventArgs& /*eventArgs*/) { std::filesystem::path currentPath{ wil::GetModuleFileNameW(nullptr) }; diff --git a/src/cascadia/TerminalApp/TerminalPage.h b/src/cascadia/TerminalApp/TerminalPage.h index 9a4e0a13d55..3d5b70efe5e 100644 --- a/src/cascadia/TerminalApp/TerminalPage.h +++ b/src/cascadia/TerminalApp/TerminalPage.h @@ -251,6 +251,7 @@ namespace winrt::TerminalApp::implementation void _CommandPaletteButtonOnClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs); void _AboutButtonOnClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs); void _ThirdPartyNoticesOnClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs); + void _SendFeedbackOnClick(const IInspectable& sender, const Windows::UI::Xaml::Controls::ContentDialogButtonClickEventArgs& eventArgs); void _KeyDownHandler(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::Input::KeyRoutedEventArgs& e); static ::Microsoft::Terminal::Core::ControlKeyStates _GetPressedModifierKeys() noexcept; diff --git a/src/cascadia/TerminalApp/TerminalPage.xaml b/src/cascadia/TerminalApp/TerminalPage.xaml index 41bb331e405..a2f430cfcb1 100644 --- a/src/cascadia/TerminalApp/TerminalPage.xaml +++ b/src/cascadia/TerminalApp/TerminalPage.xaml @@ -100,13 +100,16 @@ x:Uid="AboutDialog" Grid.Row="2" x:Load="False" - DefaultButton="Close"> + DefaultButton="Close" + PrimaryButtonClick="_SendFeedbackOnClick"> +