From 48460b01c3b60335d504d25ea89f0f19c7a628bd Mon Sep 17 00:00:00 2001
From: AdamSotak <92621643+AdamSotak@users.noreply.github.com>
Date: Fri, 15 Jul 2022 13:22:30 +0200
Subject: [PATCH] Added Source Code and Send Feedback buttons to About dialog
---
src/cascadia/TerminalApp/Resources/en-US/Resources.resw | 7 +++++++
src/cascadia/TerminalApp/TerminalPage.cpp | 9 +++++++--
src/cascadia/TerminalApp/TerminalPage.h | 2 ++
src/cascadia/TerminalApp/TerminalPage.xaml | 3 +++
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw
index 29e70316f886..195535985d94 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 f4b2f262d62b..170c9b00e58a 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::RoutedEventArgs& /*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 9a4e0a13d55d..7159789d0e53 100644
--- a/src/cascadia/TerminalApp/TerminalPage.h
+++ b/src/cascadia/TerminalApp/TerminalPage.h
@@ -251,6 +251,8 @@ 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::RoutedEventArgs& 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 41bb331e4050..3c23e1adab51 100644
--- a/src/cascadia/TerminalApp/TerminalPage.xaml
+++ b/src/cascadia/TerminalApp/TerminalPage.xaml
@@ -100,6 +100,7 @@
x:Uid="AboutDialog"
Grid.Row="2"
x:Load="False"
+ PrimaryButtonClick="_SendFeedbackOnClick"
DefaultButton="Close">
@@ -107,6 +108,8 @@
+