From 779877a5bb44f8fc38b99ef18613c6475ad096b3 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Mon, 23 Mar 2020 01:34:47 -0400 Subject: [PATCH] uwt-winforms taskdialog now has hyperlink support, let's use it --- .../UniversalEditor.UserInterface/Engine.cs | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs index b0d65c90..deecf51c 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs @@ -342,6 +342,7 @@ namespace UniversalEditor.UserInterface // Application.ThreadException += Application_ThreadException; #endif + Application.Title = "Universal Editor"; MBS.Framework.UserInterface.Application.Start(); // Glue.Common.Methods.SendApplicationEvent(new Glue.ApplicationEventEventArgs(Glue.Common.Constants.EventNames.ApplicationStop)); @@ -599,6 +600,23 @@ namespace UniversalEditor.UserInterface { Application.ShowHelp(); }); + Application.AttachCommandEventHandler("HelpCustomerFeedbackOptions", delegate (object sender, EventArgs e) + { + // MessageDialog.ShowDialog("This product has already been activated.", "Licensing and Activation", MessageDialogButtons.OK, MessageDialogIcon.Information); + TaskDialog td = new TaskDialog(); + td.ButtonStyle = TaskDialogButtonStyle.Commands; + + td.Prompt = "Please open a trouble ticket on GitHub if you need support."; + td.Text = "Customer Experience Improvement Program"; + td.Content = String.Format("You are using the GNU GPLv3 licensed version of {0}. This program comes with ABSOLUTELY NO WARRANTY.\r\n\r\nSupport contracts may be available for purchase; please contact your software distributor.", Application.Title); + td.Footer = "View the license terms"; + td.EnableHyperlinks = true; + td.HyperlinkClicked += Td_HyperlinkClicked; + + td.Icon = TaskDialogIcon.SecurityOK; + td.Parent = (Window)CurrentEngine.LastWindow; + td.ShowDialog(); + }); Application.AttachCommandEventHandler("HelpLicensingAndActivation", delegate (object sender, EventArgs e) { // MessageDialog.ShowDialog("This product has already been activated.", "Licensing and Activation", MessageDialogButtons.OK, MessageDialogIcon.Information); @@ -607,7 +625,10 @@ namespace UniversalEditor.UserInterface td.Prompt = "This product has already been activated."; td.Text = "Licensing and Activation"; - td.Content = "You are using the GNU GPLv3 licensed version of Universal Editor. No activation is necessary."; + td.Content = String.Format("You are using the GNU GPLv3 licensed version of {0}. No activation is necessary.", Application.Title); + td.Footer = "View the license terms"; + td.EnableHyperlinks = true; + td.HyperlinkClicked += Td_HyperlinkClicked; td.Icon = TaskDialogIcon.SecurityOK; td.Parent = (Window)CurrentEngine.LastWindow; @@ -669,7 +690,7 @@ namespace UniversalEditor.UserInterface Command helpAboutPlatform = Application.Commands["HelpAboutPlatform"]; if (helpAboutPlatform != null) { - helpAboutPlatform.Title = String.Format(helpAboutPlatform.Title, Application.DefaultLanguage.GetStringTableEntry("ApplicationTitle", "Universal Editor")); + helpAboutPlatform.Title = String.Format(helpAboutPlatform.Title, Application.DefaultLanguage.GetStringTableEntry("Application.Title", "Universal Editor")); } Command helpLanguage = Application.Commands["HelpLanguage"]; @@ -693,6 +714,12 @@ namespace UniversalEditor.UserInterface #endregion } + void Td_HyperlinkClicked(object sender, TaskDialogHyperlinkClickedEventArgs e) + { + System.Diagnostics.Process.Start("https://www.gnu.org/licenses/gpl-3.0.en.html"); + } + + void cmdViewToolbarsToolbar_Executed(object sender, EventArgs e) { Command cmd = (sender as Command);