From 471bb251d988eb01a9b9776e4abdfce2ff218bf8 Mon Sep 17 00:00:00 2001 From: tombogle Date: Thu, 7 Oct 2021 17:11:25 -0400 Subject: [PATCH 1/5] [WIP] Added a "Give Feedback" dialog box --- src/HearThis/HearThis.csproj | 5 +- src/HearThis/UI/GiveFeedbackDlg.Designer.cs | 504 ++++++++++++++++++++ src/HearThis/UI/GiveFeedbackDlg.cs | 184 +++++++ src/HearThis/UI/GiveFeedbackDlg.resx | 126 +++++ src/HearThis/UI/Shell.Designer.cs | 14 + src/HearThis/UI/Shell.cs | 32 +- src/HearThisTests/HearThisTests.csproj | 2 +- 7 files changed, 862 insertions(+), 5 deletions(-) create mode 100644 src/HearThis/UI/GiveFeedbackDlg.Designer.cs create mode 100644 src/HearThis/UI/GiveFeedbackDlg.cs create mode 100644 src/HearThis/UI/GiveFeedbackDlg.resx diff --git a/src/HearThis/HearThis.csproj b/src/HearThis/HearThis.csproj index 84aac6a1..1ecf7c7e 100644 --- a/src/HearThis/HearThis.csproj +++ b/src/HearThis/HearThis.csproj @@ -10,7 +10,7 @@ Properties HearThis HearThis - NET472 + net472 false 512 UI\HearThis.ico @@ -190,6 +190,9 @@ + + Form + Form diff --git a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs new file mode 100644 index 00000000..f7de1f1a --- /dev/null +++ b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs @@ -0,0 +1,504 @@ +namespace HearThis.UI +{ + partial class GiveFeedbackDlg + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + Program.UnregisterStringsLocalized(HandleStringsLocalized); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GiveFeedbackDlg)); + this._btnOk = new System.Windows.Forms.Button(); + this.l10NSharpExtender1 = new L10NSharp.UI.L10NSharpExtender(this.components); + this._chkIncludeScreenshot = new System.Windows.Forms.CheckBox(); + this._linkCommunityHelp = new System.Windows.Forms.LinkLabel(); + this._txtTitle = new System.Windows.Forms.TextBox(); + this._lblTitle = new System.Windows.Forms.Label(); + this._lblTypeOfFeedback = new System.Windows.Forms.Label(); + this._lblPriorityOrSeverity = new System.Windows.Forms.Label(); + this._cboTypeOfFeedback = new System.Windows.Forms.ComboBox(); + this._cboPriority = new System.Windows.Forms.ComboBox(); + this._lblDescription = new System.Windows.Forms.Label(); + this._lblProject = new System.Windows.Forms.Label(); + this._chkIncludeRecordingInfo = new System.Windows.Forms.CheckBox(); + this._chkIncludeLog = new System.Windows.Forms.CheckBox(); + this._txtProjectOrWebsite = new System.Windows.Forms.TextBox(); + this._cboProjectOrWebsite = new System.Windows.Forms.ComboBox(); + this._lblInstructions = new System.Windows.Forms.Label(); + this._linkDonate = new System.Windows.Forms.LinkLabel(); + this._btnCancel = new System.Windows.Forms.Button(); + this._lblAffects = new System.Windows.Forms.Label(); + this._cboAffects = new System.Windows.Forms.ComboBox(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this._richTextBoxDescription = new System.Windows.Forms.RichTextBox(); + this._lblWebsiteURL = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.l10NSharpExtender1)).BeginInit(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // _btnOk + // + this._btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this._btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.l10NSharpExtender1.SetLocalizableToolTip(this._btnOk, null); + this.l10NSharpExtender1.SetLocalizationComment(this._btnOk, null); + this.l10NSharpExtender1.SetLocalizingId(this._btnOk, "Common.OK"); + this._btnOk.Location = new System.Drawing.Point(499, 429); + this._btnOk.Name = "_btnOk"; + this._btnOk.Size = new System.Drawing.Size(75, 23); + this._btnOk.TabIndex = 3; + this._btnOk.Text = "OK"; + this._btnOk.UseVisualStyleBackColor = true; + this._btnOk.Click += new System.EventHandler(this._btnOk_Click); + // + // l10NSharpExtender1 + // + this.l10NSharpExtender1.LocalizationManagerId = "HearThis"; + this.l10NSharpExtender1.PrefixForNewItems = ""; + // + // _chkIncludeScreenshot + // + this._chkIncludeScreenshot.AutoSize = true; + this._chkIncludeScreenshot.Enabled = false; + this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeScreenshot, null); + this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeScreenshot, null); + this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeScreenshot, "GiveFeedbackDlg._chkIncludeScreenshot"); + this._chkIncludeScreenshot.Location = new System.Drawing.Point(104, 257); + this._chkIncludeScreenshot.Margin = new System.Windows.Forms.Padding(3, 20, 3, 3); + this._chkIncludeScreenshot.Name = "_chkIncludeScreenshot"; + this._chkIncludeScreenshot.Size = new System.Drawing.Size(184, 17); + this._chkIncludeScreenshot.TabIndex = 3; + this._chkIncludeScreenshot.Text = "Include screenshot of {0} window"; + this._chkIncludeScreenshot.UseVisualStyleBackColor = true; + // + // _linkCommunityHelp + // + this._linkCommunityHelp.AutoSize = true; + this.tableLayoutPanel1.SetColumnSpan(this._linkCommunityHelp, 2); + this._linkCommunityHelp.LinkArea = new System.Windows.Forms.LinkArea(67, 29); + this.l10NSharpExtender1.SetLocalizableToolTip(this._linkCommunityHelp, null); + this.l10NSharpExtender1.SetLocalizationComment(this._linkCommunityHelp, "Put square brackets around the text that should appear as the hyperlink. The text" + + " in the brackets is localizable. However, note that the URL it will take the use" + + "r to is in English."); + this.l10NSharpExtender1.SetLocalizingId(this._linkCommunityHelp, "ReportProblemDlg._linkCommunityHelp"); + this._linkCommunityHelp.Location = new System.Drawing.Point(3, 0); + this._linkCommunityHelp.Name = "_linkCommunityHelp"; + this._linkCommunityHelp.Padding = new System.Windows.Forms.Padding(0, 0, 0, 16); + this._linkCommunityHelp.Size = new System.Drawing.Size(631, 46); + this._linkCommunityHelp.TabIndex = 4; + this._linkCommunityHelp.TabStop = true; + this._linkCommunityHelp.Text = "Before you report a problem or make a suggestion, please visit the [Scripture Sof" + + "tware Community] page for {0} to see if your issue is already addressed there."; + this._linkCommunityHelp.UseCompatibleTextRendering = true; + this._linkCommunityHelp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkClicked); + // + // _txtTitle + // + this._txtTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.l10NSharpExtender1.SetLocalizableToolTip(this._txtTitle, null); + this.l10NSharpExtender1.SetLocalizationComment(this._txtTitle, null); + this.l10NSharpExtender1.SetLocalizationPriority(this._txtTitle, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this._txtTitle, "GiveFeedbackDlg._txtTitle"); + this._txtTitle.Location = new System.Drawing.Point(104, 49); + this._txtTitle.Name = "_txtTitle"; + this._txtTitle.Size = new System.Drawing.Size(538, 20); + this._txtTitle.TabIndex = 5; + this._txtTitle.TextChanged += new System.EventHandler(this.UpdateOkButtonState); + // + // _lblTitle + // + this._lblTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._lblTitle.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblTitle, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblTitle, null); + this.l10NSharpExtender1.SetLocalizingId(this._lblTitle, "GiveFeedbackDlg._lblTitle"); + this._lblTitle.Location = new System.Drawing.Point(25, 46); + this._lblTitle.Name = "_lblTitle"; + this._lblTitle.Size = new System.Drawing.Size(73, 13); + this._lblTitle.TabIndex = 6; + this._lblTitle.Text = "Title of report*"; + this._lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _lblTypeOfFeedback + // + this._lblTypeOfFeedback.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._lblTypeOfFeedback.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblTypeOfFeedback, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblTypeOfFeedback, null); + this.l10NSharpExtender1.SetLocalizingId(this._lblTypeOfFeedback, "GiveFeedbackDlg._lblTypeOfFeedback"); + this._lblTypeOfFeedback.Location = new System.Drawing.Point(3, 72); + this._lblTypeOfFeedback.Name = "_lblTypeOfFeedback"; + this._lblTypeOfFeedback.Size = new System.Drawing.Size(95, 13); + this._lblTypeOfFeedback.TabIndex = 7; + this._lblTypeOfFeedback.Text = "Type of feedback*"; + this._lblTypeOfFeedback.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _lblPriorityOrSeverity + // + this._lblPriorityOrSeverity.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._lblPriorityOrSeverity.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblPriorityOrSeverity, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblPriorityOrSeverity, null); + this.l10NSharpExtender1.SetLocalizingId(this._lblPriorityOrSeverity, "GiveFeedbackDlg._lblPriorityOrSeverity"); + this._lblPriorityOrSeverity.Location = new System.Drawing.Point(49, 99); + this._lblPriorityOrSeverity.Name = "_lblPriorityOrSeverity"; + this._lblPriorityOrSeverity.Size = new System.Drawing.Size(49, 13); + this._lblPriorityOrSeverity.TabIndex = 8; + this._lblPriorityOrSeverity.Text = "Severity*"; + this._lblPriorityOrSeverity.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _cboTypeOfFeedback + // + this._cboTypeOfFeedback.FormattingEnabled = true; + this._cboTypeOfFeedback.Items.AddRange(new object[] { + "Report problem", + "Make a suggestion", + "Express appreciation", + "Donate to support software development"}); + this.l10NSharpExtender1.SetLocalizableToolTip(this._cboTypeOfFeedback, null); + this.l10NSharpExtender1.SetLocalizationComment(this._cboTypeOfFeedback, null); + this.l10NSharpExtender1.SetLocalizationPriority(this._cboTypeOfFeedback, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this._cboTypeOfFeedback, "GiveFeedbackDlg._cboTypeOfFeedback"); + this._cboTypeOfFeedback.Location = new System.Drawing.Point(104, 75); + this._cboTypeOfFeedback.Name = "_cboTypeOfFeedback"; + this._cboTypeOfFeedback.Size = new System.Drawing.Size(297, 21); + this._cboTypeOfFeedback.TabIndex = 9; + this._cboTypeOfFeedback.SelectedIndexChanged += new System.EventHandler(this._cboTypeOfFeedback_SelectedIndexChanged); + // + // _cboPriority + // + this._cboPriority.FormattingEnabled = true; + this._cboPriority.Items.AddRange(new object[] { + "I lost data", + "I was not able to complete a task", + "I completed a task, but it was difficult", + "I think the problem is minor"}); + this.l10NSharpExtender1.SetLocalizableToolTip(this._cboPriority, null); + this.l10NSharpExtender1.SetLocalizationComment(this._cboPriority, null); + this.l10NSharpExtender1.SetLocalizationPriority(this._cboPriority, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this._cboPriority, "GiveFeedbackDlg._cboPriority"); + this._cboPriority.Location = new System.Drawing.Point(104, 102); + this._cboPriority.Name = "_cboPriority"; + this._cboPriority.Size = new System.Drawing.Size(297, 21); + this._cboPriority.TabIndex = 10; + // + // _lblDescription + // + this._lblDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._lblDescription.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblDescription, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblDescription, null); + this.l10NSharpExtender1.SetLocalizingId(this._lblDescription, "GiveFeedbackDlg._lblDescription"); + this._lblDescription.Location = new System.Drawing.Point(34, 126); + this._lblDescription.Name = "_lblDescription"; + this._lblDescription.Size = new System.Drawing.Size(64, 13); + this._lblDescription.TabIndex = 11; + this._lblDescription.Text = "Description*"; + this._lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _lblProject + // + this._lblProject.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._lblProject.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblProject, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblProject, null); + this.l10NSharpExtender1.SetLocalizingId(this._lblProject, "GiveFeedbackDlg._lblProject"); + this._lblProject.Location = new System.Drawing.Point(55, 184); + this._lblProject.Name = "_lblProject"; + this._lblProject.Size = new System.Drawing.Size(43, 13); + this._lblProject.TabIndex = 13; + this._lblProject.Text = "Project:"; + this._lblProject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _chkIncludeRecordingInfo + // + this._chkIncludeRecordingInfo.AutoSize = true; + this._chkIncludeRecordingInfo.Checked = true; + this._chkIncludeRecordingInfo.CheckState = System.Windows.Forms.CheckState.Checked; + this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeRecordingInfo, null); + this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeRecordingInfo, null); + this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeRecordingInfo, "GiveFeedbackDlg._chkIncludeRecordingInfo"); + this._chkIncludeRecordingInfo.Location = new System.Drawing.Point(104, 280); + this._chkIncludeRecordingInfo.Name = "_chkIncludeRecordingInfo"; + this._chkIncludeRecordingInfo.Size = new System.Drawing.Size(168, 17); + this._chkIncludeRecordingInfo.TabIndex = 14; + this._chkIncludeRecordingInfo.Text = "Include the last clip I recorded"; + this._chkIncludeRecordingInfo.UseVisualStyleBackColor = true; + // + // _chkIncludeLog + // + this._chkIncludeLog.AutoSize = true; + this._chkIncludeLog.Checked = true; + this._chkIncludeLog.CheckState = System.Windows.Forms.CheckState.Checked; + this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeLog, null); + this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeLog, null); + this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeLog, "GiveFeedbackDlg._chkIncludeLog"); + this._chkIncludeLog.Location = new System.Drawing.Point(104, 303); + this._chkIncludeLog.Name = "_chkIncludeLog"; + this._chkIncludeLog.Size = new System.Drawing.Size(112, 17); + this._chkIncludeLog.TabIndex = 15; + this._chkIncludeLog.Text = "Include the log file"; + this._chkIncludeLog.UseVisualStyleBackColor = true; + // + // _txtProjectOrWebsite + // + this._txtProjectOrWebsite.Dock = System.Windows.Forms.DockStyle.Fill; + this.l10NSharpExtender1.SetLocalizableToolTip(this._txtProjectOrWebsite, null); + this.l10NSharpExtender1.SetLocalizationComment(this._txtProjectOrWebsite, null); + this.l10NSharpExtender1.SetLocalizingId(this._txtProjectOrWebsite, "textBox1"); + this._txtProjectOrWebsite.Location = new System.Drawing.Point(104, 214); + this._txtProjectOrWebsite.Name = "_txtProjectOrWebsite"; + this._txtProjectOrWebsite.Size = new System.Drawing.Size(538, 20); + this._txtProjectOrWebsite.TabIndex = 16; + this._txtProjectOrWebsite.Visible = false; + // + // _cboProjectOrWebsite + // + this._cboProjectOrWebsite.FormattingEnabled = true; + this._cboProjectOrWebsite.Items.AddRange(new object[] { + "Current project {0}", + "Not project-specific", + "Other (specify below)"}); + this.l10NSharpExtender1.SetLocalizableToolTip(this._cboProjectOrWebsite, null); + this.l10NSharpExtender1.SetLocalizationComment(this._cboProjectOrWebsite, null); + this.l10NSharpExtender1.SetLocalizationPriority(this._cboProjectOrWebsite, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this._cboProjectOrWebsite, "GiveFeedbackDlg._cboProjectOrWebsite"); + this._cboProjectOrWebsite.Location = new System.Drawing.Point(104, 187); + this._cboProjectOrWebsite.Name = "_cboProjectOrWebsite"; + this._cboProjectOrWebsite.Size = new System.Drawing.Size(297, 21); + this._cboProjectOrWebsite.TabIndex = 17; + // + // _lblInstructions + // + this._lblInstructions.AutoSize = true; + this._lblInstructions.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F); + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblInstructions, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblInstructions, null); + this.l10NSharpExtender1.SetLocalizationPriority(this._lblInstructions, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this._lblInstructions, "GiveFeedbackDlg._lblInstructions"); + this._lblInstructions.Location = new System.Drawing.Point(102, 343); + this._lblInstructions.Margin = new System.Windows.Forms.Padding(1, 20, 3, 0); + this._lblInstructions.Name = "_lblInstructions"; + this._lblInstructions.Size = new System.Drawing.Size(526, 39); + this._lblInstructions.TabIndex = 18; + this._lblInstructions.Text = resources.GetString("_lblInstructions.Text"); + // + // _linkDonate + // + this._linkDonate.AutoSize = true; + this._linkDonate.LinkArea = new System.Windows.Forms.LinkArea(15, 15); + this.l10NSharpExtender1.SetLocalizableToolTip(this._linkDonate, null); + this.l10NSharpExtender1.SetLocalizationComment(this._linkDonate, null); + this.l10NSharpExtender1.SetLocalizingId(this._linkDonate, "GiveFeedbackDlg._linkDonate"); + this._linkDonate.Location = new System.Drawing.Point(104, 382); + this._linkDonate.Name = "_linkDonate"; + this._linkDonate.Size = new System.Drawing.Size(164, 17); + this._linkDonate.TabIndex = 19; + this._linkDonate.TabStop = true; + this._linkDonate.Text = "Take me to the [donation page]."; + this._linkDonate.UseCompatibleTextRendering = true; + // + // _btnCancel + // + this._btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this._btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.l10NSharpExtender1.SetLocalizableToolTip(this._btnCancel, null); + this.l10NSharpExtender1.SetLocalizationComment(this._btnCancel, null); + this.l10NSharpExtender1.SetLocalizingId(this._btnCancel, "Common.Cancel"); + this._btnCancel.Location = new System.Drawing.Point(580, 429); + this._btnCancel.Name = "_btnCancel"; + this._btnCancel.Size = new System.Drawing.Size(75, 23); + this._btnCancel.TabIndex = 6; + this._btnCancel.Text = "Cancel"; + this._btnCancel.UseVisualStyleBackColor = true; + // + // _lblAffects + // + this._lblAffects.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._lblAffects.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblAffects, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblAffects, null); + this.l10NSharpExtender1.SetLocalizingId(this._lblAffects, "GiveFeedbackDlg._lblAffects"); + this._lblAffects.Location = new System.Drawing.Point(58, 157); + this._lblAffects.Name = "_lblAffects"; + this._lblAffects.Size = new System.Drawing.Size(40, 13); + this._lblAffects.TabIndex = 20; + this._lblAffects.Text = "Affects"; + this._lblAffects.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _cboAffects + // + this._cboAffects.FormattingEnabled = true; + this._cboAffects.Items.AddRange(new object[] { + "Does not apply", + "Exporting", + "Installation", + "Localization", + "Multiple areas", + "Navigation to desired book, chapter and block", + "Other", + "Playback", + "Project administration", + "Project selection", + "Recording", + "Settings", + "Website", + "Unknown"}); + this.l10NSharpExtender1.SetLocalizableToolTip(this._cboAffects, null); + this.l10NSharpExtender1.SetLocalizationComment(this._cboAffects, null); + this.l10NSharpExtender1.SetLocalizingId(this._cboAffects, "comboBox2"); + this._cboAffects.Location = new System.Drawing.Point(104, 160); + this._cboAffects.Name = "_cboAffects"; + this._cboAffects.Size = new System.Drawing.Size(297, 21); + this._cboAffects.TabIndex = 21; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this._linkCommunityHelp, 0, 0); + this.tableLayoutPanel1.Controls.Add(this._txtTitle, 1, 1); + this.tableLayoutPanel1.Controls.Add(this._lblTitle, 0, 1); + this.tableLayoutPanel1.Controls.Add(this._lblTypeOfFeedback, 0, 2); + this.tableLayoutPanel1.Controls.Add(this._lblPriorityOrSeverity, 0, 3); + this.tableLayoutPanel1.Controls.Add(this._cboTypeOfFeedback, 1, 2); + this.tableLayoutPanel1.Controls.Add(this._cboPriority, 1, 3); + this.tableLayoutPanel1.Controls.Add(this._lblDescription, 0, 4); + this.tableLayoutPanel1.Controls.Add(this._richTextBoxDescription, 1, 4); + this.tableLayoutPanel1.Controls.Add(this._lblProject, 0, 6); + this.tableLayoutPanel1.Controls.Add(this._chkIncludeScreenshot, 1, 8); + this.tableLayoutPanel1.Controls.Add(this._chkIncludeRecordingInfo, 1, 9); + this.tableLayoutPanel1.Controls.Add(this._chkIncludeLog, 1, 10); + this.tableLayoutPanel1.Controls.Add(this._txtProjectOrWebsite, 1, 7); + this.tableLayoutPanel1.Controls.Add(this._cboProjectOrWebsite, 1, 6); + this.tableLayoutPanel1.Controls.Add(this._lblInstructions, 1, 11); + this.tableLayoutPanel1.Controls.Add(this._linkDonate, 1, 12); + this.tableLayoutPanel1.Controls.Add(this._lblAffects, 0, 5); + this.tableLayoutPanel1.Controls.Add(this._cboAffects, 1, 5); + this.tableLayoutPanel1.Controls.Add(this._lblWebsiteURL, 0, 7); + this.tableLayoutPanel1.Location = new System.Drawing.Point(13, 12); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 13; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.Size = new System.Drawing.Size(645, 399); + this.tableLayoutPanel1.TabIndex = 5; + // + // _richTextBoxDescription + // + this._richTextBoxDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._richTextBoxDescription.Location = new System.Drawing.Point(104, 129); + this._richTextBoxDescription.Name = "_richTextBoxDescription"; + this._richTextBoxDescription.Size = new System.Drawing.Size(538, 25); + this._richTextBoxDescription.TabIndex = 12; + this._richTextBoxDescription.Text = ""; + // + // _lblWebsiteURL + // + this._lblWebsiteURL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._lblWebsiteURL.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblWebsiteURL, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblWebsiteURL, null); + this.l10NSharpExtender1.SetLocalizationPriority(this._lblWebsiteURL, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this._lblWebsiteURL, "GiveFeedbackDlg._lblWebsiteURL"); + this._lblWebsiteURL.Location = new System.Drawing.Point(15, 211); + this._lblWebsiteURL.Name = "_lblWebsiteURL"; + this._lblWebsiteURL.Size = new System.Drawing.Size(83, 13); + this._lblWebsiteURL.TabIndex = 22; + this._lblWebsiteURL.Text = "URL of website:"; + this._lblWebsiteURL.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this._lblWebsiteURL.Visible = false; + // + // GiveFeedbackDlg + // + this.AcceptButton = this._btnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this._btnCancel; + this.ClientSize = new System.Drawing.Size(670, 464); + this.Controls.Add(this._btnCancel); + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this._btnOk); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.l10NSharpExtender1.SetLocalizableToolTip(this, null); + this.l10NSharpExtender1.SetLocalizationComment(this, null); + this.l10NSharpExtender1.SetLocalizationPriority(this, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this, "ReportProblemDlg.WindowTitle"); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "GiveFeedbackDlg"; + this.Text = "Give Feedback"; + ((System.ComponentModel.ISupportInitialize)(this.l10NSharpExtender1)).EndInit(); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.Button _btnOk; + private L10NSharp.UI.L10NSharpExtender l10NSharpExtender1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.CheckBox _chkIncludeScreenshot; + private System.Windows.Forms.LinkLabel _linkCommunityHelp; + private System.Windows.Forms.TextBox _txtTitle; + private System.Windows.Forms.Label _lblTitle; + private System.Windows.Forms.Label _lblTypeOfFeedback; + private System.Windows.Forms.Label _lblPriorityOrSeverity; + private System.Windows.Forms.ComboBox _cboTypeOfFeedback; + private System.Windows.Forms.ComboBox _cboPriority; + private System.Windows.Forms.Label _lblDescription; + private System.Windows.Forms.RichTextBox _richTextBoxDescription; + private System.Windows.Forms.Label _lblProject; + private System.Windows.Forms.CheckBox _chkIncludeRecordingInfo; + private System.Windows.Forms.CheckBox _chkIncludeLog; + private System.Windows.Forms.TextBox _txtProjectOrWebsite; + private System.Windows.Forms.ComboBox _cboProjectOrWebsite; + private System.Windows.Forms.Label _lblInstructions; + private System.Windows.Forms.LinkLabel _linkDonate; + private System.Windows.Forms.Button _btnCancel; + private System.Windows.Forms.Label _lblAffects; + private System.Windows.Forms.ComboBox _cboAffects; + private System.Windows.Forms.Label _lblWebsiteURL; + } +} diff --git a/src/HearThis/UI/GiveFeedbackDlg.cs b/src/HearThis/UI/GiveFeedbackDlg.cs new file mode 100644 index 00000000..71de8b90 --- /dev/null +++ b/src/HearThis/UI/GiveFeedbackDlg.cs @@ -0,0 +1,184 @@ +// -------------------------------------------------------------------------------------------- +#region // Copyright (c) 2021, SIL International. All Rights Reserved. +// +// Copyright (c) 2021, SIL International. All Rights Reserved. +// +// Distributable under the terms of the MIT License (https://sil.mit-license.org/) +// +#endregion +// -------------------------------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Windows.Forms; +using L10NSharp; + +namespace HearThis.UI +{ + /// + /// This allows users a way to report a bug or give other feedback regarding HearThis. + /// + public partial class GiveFeedbackDlg : Form + { + public enum TypeOfFeedback + { + Problem = 0, + Suggestion = 1, + Gratitude = 2, + Donate = 3, + } + + public enum PriorityOrSeverity + { + LostData = 0, + NotAbleToCompleteTask = 1, + CompletedTaskWithDifficulty = 2, + Minor = 3, + NotApplicable, + } + + public enum AffectedArea + { + NotApplicable, // Only available if Feedback type is Gratitude + Exporting, + Installation, + Localization, + MultipleAreas, + Navigation, + Other, + Playback, + ProjectAdministration, + ProjectSelection, + Recording, + Settings, + Website, + Unknown, + } + + public GiveFeedbackDlg() + { + InitializeComponent(); + _linkCommunityHelp.Links[0].LinkData = new Action(() => Process.Start($"https://{Program.kSupportUrlSansHttps}")); + _linkDonate.Links[0].LinkData = new Action(OpenDonationPage); + + Program.RegisterStringsLocalized(HandleStringsLocalized); + HandleStringsLocalized(); + } + + #region Properties + public string Title => _txtTitle.Text; + + public TypeOfFeedback FeedbackType => (TypeOfFeedback)_cboTypeOfFeedback.SelectedIndex; + + public PriorityOrSeverity Priority => PriorityIsRelevant ? + (PriorityOrSeverity)_cboPriority.SelectedIndex : PriorityOrSeverity.NotApplicable; + + public string Description => _richTextBoxDescription.Text; + + public AffectedArea AffectedPartOfProgram => (AffectedArea) + (_cboAffects.SelectedIndex + (FeedbackType == TypeOfFeedback.Gratitude ? 0 : 1)); + + private bool PriorityIsRelevant + { + get => _cboPriority.Visible; + set => _cboPriority.Visible = _lblPriorityOrSeverity.Visible = value; + } + #endregion + + #region Evemnt handlers + private void HandleStringsLocalized() + { + _lblPriorityOrSeverity.Tag = _lblPriorityOrSeverity.Text; + _cboPriority.Tag = new List(from object item in _cboPriority.Items select item.ToString()); + _cboAffects.Tag = _cboAffects.Items[0].ToString(); + _linkCommunityHelp.SetLinkRegions(); + _linkDonate.SetLinkRegions(); + } + + private void LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + ((Action)e.Link.LinkData).Invoke(); + } + + private void UpdateOkButtonState(object sender, EventArgs e) + { + + } + + private void _cboTypeOfFeedback_SelectedIndexChanged(object sender, EventArgs e) + { + _cboPriority.Items.Clear(); + if (!(_cboPriority.Tag is List severityList) || severityList.Count != 4) + throw new ApplicationException("_cboPriority.Tag not set properly in HandleStringsLocalized"); + if (!(_cboAffects.Tag is string notApplicableItem)) + throw new ApplicationException("_cboAffects.Tag not set properly in HandleStringsLocalized"); + + switch (FeedbackType) + { + case TypeOfFeedback.Problem: + _lblPriorityOrSeverity.Text = _lblPriorityOrSeverity.Tag as string; + PriorityIsRelevant = true; + RemoveNotApplicableItemFromAffectsCombo(); + foreach (var item in severityList) + _cboPriority.Items.Add(item); + break; + + case TypeOfFeedback.Suggestion: + _lblPriorityOrSeverity.Text = LocalizationManager.GetString("GiveFeedbackDlg._lblPriorityOrSeverity.SuggestionText", + "Priority"); + PriorityIsRelevant = true; + RemoveNotApplicableItemFromAffectsCombo(); + _cboPriority.Items.Add(severityList[(int)PriorityOrSeverity.NotAbleToCompleteTask]); + _cboPriority.Items.Add(severityList[(int)PriorityOrSeverity.CompletedTaskWithDifficulty]); + _cboPriority.Items.Add(LocalizationManager.GetString("GiveFeedbackDlg._cboPriority.MinorEnhancement", + "Idea for a minor enhancement")); + break; + + case TypeOfFeedback.Gratitude: + if (_cboAffects.Items.Count == (int)AffectedArea.Unknown) + _cboAffects.Items.Insert(0, notApplicableItem); + PriorityIsRelevant = false; + break; + + case TypeOfFeedback.Donate: + PriorityIsRelevant = false; + _lblDescription.Visible = false; + _richTextBoxDescription.Visible = false; + _lblAffects.Visible = false; + _cboAffects.Visible = false; + _lblProject.Visible = false; + _cboProjectOrWebsite.Visible = false; + _linkDonate.Visible = true; + return; + default: + throw new IndexOutOfRangeException("Unexpected type of feedback."); + } + } + + private void _btnOk_Click(object sender, EventArgs e) + { + if (FeedbackType == TypeOfFeedback.Donate) + { + if (MessageBox.Show("Visit donation page now?", ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) + OpenDonationPage(); + } + } + #endregion + + #region private helper methods + private void RemoveNotApplicableItemFromAffectsCombo() + { + if (_cboAffects.Items.Count > (int)AffectedArea.Unknown) + _cboAffects.Items.RemoveAt(0); + } + + private void OpenDonationPage() + { + Process.Start("https://donate.givedirect.org/?cid=13536&n=289"); + DialogResult = DialogResult.Cancel; + Close(); + } + #endregion + } +} diff --git a/src/HearThis/UI/GiveFeedbackDlg.resx b/src/HearThis/UI/GiveFeedbackDlg.resx new file mode 100644 index 00000000..e6575026 --- /dev/null +++ b/src/HearThis/UI/GiveFeedbackDlg.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + Use this form to give feedback to the {0} development team about the program. You can use it to report a problem you have encountered or to make a suggestion for an improvement. In addition to the description that you provide, the report will automatically include details about the version of {0}. + + \ No newline at end of file diff --git a/src/HearThis/UI/Shell.Designer.cs b/src/HearThis/UI/Shell.Designer.cs index 5f08300e..8e78b5d8 100644 --- a/src/HearThis/UI/Shell.Designer.cs +++ b/src/HearThis/UI/Shell.Designer.cs @@ -49,6 +49,7 @@ private void InitializeComponent() this._saveHearthisPackItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); this.supportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.giveFeedbackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this._aboutHearThisItem = new System.Windows.Forms.ToolStripMenuItem(); this._actorCharacterButton = new System.Windows.Forms.Button(); @@ -164,6 +165,7 @@ private void InitializeComponent() this._saveHearthisPackItem, this.toolStripMenuItem4, this.supportToolStripMenuItem, + this.giveFeedbackToolStripMenuItem, this.toolStripSeparator1, this._aboutHearThisItem}); this._moreMenu.ForeColor = System.Drawing.Color.DarkGray; @@ -256,6 +258,17 @@ private void InitializeComponent() this.supportToolStripMenuItem.Text = "Support..."; this.supportToolStripMenuItem.Click += new System.EventHandler(this.supportToolStripMenuItem_Click); // + // giveFeedbackToolStripMenuItem + // + this.l10NSharpExtender1.SetLocalizableToolTip(this.giveFeedbackToolStripMenuItem, "Report a bug or suggest an improvement to HearThis"); + this.l10NSharpExtender1.SetLocalizationComment(this.giveFeedbackToolStripMenuItem, null); + this.l10NSharpExtender1.SetLocalizationPriority(this.giveFeedbackToolStripMenuItem, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this.giveFeedbackToolStripMenuItem, "Shell.Shell.giveFeedbackToolStripMenuItem"); + this.giveFeedbackToolStripMenuItem.Name = "giveFeedbackToolStripMenuItem"; + this.giveFeedbackToolStripMenuItem.Size = new System.Drawing.Size(194, 22); + this.giveFeedbackToolStripMenuItem.Text = "Give Feedback..."; + this.giveFeedbackToolStripMenuItem.Click += new System.EventHandler(this.giveFeedbackToolStripMenuItem_Click); + // // toolStripSeparator1 // this.toolStripSeparator1.BackColor = System.Drawing.Color.DarkRed; @@ -417,6 +430,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem supportToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.Panel _multiVoiceMarginPanel; + private System.Windows.Forms.ToolStripMenuItem giveFeedbackToolStripMenuItem; } } diff --git a/src/HearThis/UI/Shell.cs b/src/HearThis/UI/Shell.cs index 3a7ef550..81915e05 100644 --- a/src/HearThis/UI/Shell.cs +++ b/src/HearThis/UI/Shell.cs @@ -1,7 +1,7 @@ // -------------------------------------------------------------------------------------------- -#region // Copyright (c) 2020, SIL International. All Rights Reserved. -// -// Copyright (c) 2020, SIL International. All Rights Reserved. +#region // Copyright (c) 2021, SIL International. All Rights Reserved. +// +// Copyright (c) 2021, SIL International. All Rights Reserved. // // Distributable under the terms of the MIT License (https://sil.mit-license.org/) // @@ -26,8 +26,10 @@ using SIL.Windows.Forms.ReleaseNotes; using Paratext.Data; using SIL.DblBundle.Text; +using SIL.Email; using SIL.Reporting; using static System.String; +using NewItemPlaceholderPosition = System.ComponentModel.NewItemPlaceholderPosition; namespace HearThis.UI { @@ -886,6 +888,30 @@ private void supportToolStripMenuItem_Click(object sender, EventArgs e) Process.Start($"https://{Program.kSupportUrlSansHttps}"); } + private void giveFeedbackToolStripMenuItem_Click(object sender, EventArgs e) + { + using (var dlg = new GiveFeedbackDlg()) + { + if (dlg.ShowDialog(this) == DialogResult.OK) + { + try + { + var emailProvider = EmailProviderFactory.PreferredEmailProvider(); + var emailMessage = emailProvider.CreateMessage(); + emailMessage.To.Add(ErrorReport.EmailAddress); + emailMessage.Subject = dlg.Title; + emailMessage.Body = "TODO: Complete this"; + if (emailMessage.Send(emailProvider)) + Close(); + } + catch (Exception) + { + //swallow it and go to the alternate method + } + } + } + } + private void MenuDropDownOpening(object sender, EventArgs e) { var menuItem = sender as ToolStripDropDownButton; diff --git a/src/HearThisTests/HearThisTests.csproj b/src/HearThisTests/HearThisTests.csproj index a826bc6b..7007613d 100644 --- a/src/HearThisTests/HearThisTests.csproj +++ b/src/HearThisTests/HearThisTests.csproj @@ -10,7 +10,7 @@ Properties HearThisTests HearThisTests - NET472 + net472 false 512 From a1a01c4686bf7d7c5c09f22b17e5b3eea1acc956 Mon Sep 17 00:00:00 2001 From: tombogle Date: Tue, 9 Aug 2022 15:46:10 -0400 Subject: [PATCH 2/5] Cleaned up a few details in response to early code review --- src/HearThis/UI/GiveFeedbackDlg.Designer.cs | 4 ++-- src/HearThis/UI/GiveFeedbackDlg.cs | 2 +- src/HearThis/UI/Shell.Designer.cs | 6 +++--- src/HearThis/UI/Shell.cs | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs index a1614031..d114640b 100644 --- a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs +++ b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs @@ -100,7 +100,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizationComment(this._linkCommunityHelp, "Put square brackets around the text that should appear as the hyperlink. The text" + " in the brackets is localizable. However, note that the URL it will take the use" + "r to is in English."); - this.l10NSharpExtender1.SetLocalizingId(this._linkCommunityHelp, "ReportProblemDlg._linkCommunityHelp"); + this.l10NSharpExtender1.SetLocalizingId(this._linkCommunityHelp, "GiveFeedbackDlg._linkCommunityHelp"); this._linkCommunityHelp.Location = new System.Drawing.Point(3, 0); this._linkCommunityHelp.Name = "_linkCommunityHelp"; this._linkCommunityHelp.Padding = new System.Windows.Forms.Padding(0, 0, 0, 16); @@ -265,7 +265,7 @@ private void InitializeComponent() this._txtProjectOrWebsite.Dock = System.Windows.Forms.DockStyle.Fill; this.l10NSharpExtender1.SetLocalizableToolTip(this._txtProjectOrWebsite, null); this.l10NSharpExtender1.SetLocalizationComment(this._txtProjectOrWebsite, null); - this.l10NSharpExtender1.SetLocalizingId(this._txtProjectOrWebsite, "textBox1"); + this.l10NSharpExtender1.SetLocalizingId(this._txtProjectOrWebsite, "GiveFeedbackDlg._txtProjectOrWebsite"); this._txtProjectOrWebsite.Location = new System.Drawing.Point(104, 214); this._txtProjectOrWebsite.Name = "_txtProjectOrWebsite"; this._txtProjectOrWebsite.Size = new System.Drawing.Size(538, 20); diff --git a/src/HearThis/UI/GiveFeedbackDlg.cs b/src/HearThis/UI/GiveFeedbackDlg.cs index 86970384..76d7f41b 100644 --- a/src/HearThis/UI/GiveFeedbackDlg.cs +++ b/src/HearThis/UI/GiveFeedbackDlg.cs @@ -40,7 +40,7 @@ public enum PriorityOrSeverity public enum AffectedArea { - NotApplicable, // Only available if Feedback type is Gratitude + NotApplicable, // Not available for some types of Feedback Exporting, Installation, Localization, diff --git a/src/HearThis/UI/Shell.Designer.cs b/src/HearThis/UI/Shell.Designer.cs index 0ba22f0f..919a8287 100644 --- a/src/HearThis/UI/Shell.Designer.cs +++ b/src/HearThis/UI/Shell.Designer.cs @@ -130,7 +130,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._btnMode, null); this.l10NSharpExtender1.SetLocalizationComment(this._btnMode, null); this.l10NSharpExtender1.SetLocalizationPriority(this._btnMode, L10NSharp.LocalizationPriority.NotLocalizable); - this.l10NSharpExtender1.SetLocalizingId(this._btnMode, "Shell.Shell._btnMode"); + this.l10NSharpExtender1.SetLocalizingId(this._btnMode, "Shell._btnMode"); this._btnMode.Name = "_btnMode"; this._btnMode.Size = new System.Drawing.Size(97, 20); this._btnMode.Text = "Administrative"; @@ -263,7 +263,7 @@ private void InitializeComponent() // this.l10NSharpExtender1.SetLocalizableToolTip(this.supportToolStripMenuItem, null); this.l10NSharpExtender1.SetLocalizationComment(this.supportToolStripMenuItem, null); - this.l10NSharpExtender1.SetLocalizingId(this.supportToolStripMenuItem, "Shell.Shell.SupportMenuItem"); + this.l10NSharpExtender1.SetLocalizingId(this.supportToolStripMenuItem, "Shell.SupportMenuItem"); this.supportToolStripMenuItem.Name = "supportToolStripMenuItem"; this.supportToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.supportToolStripMenuItem.Text = "Support..."; @@ -274,7 +274,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this.giveFeedbackToolStripMenuItem, "Report a bug or suggest an improvement to HearThis"); this.l10NSharpExtender1.SetLocalizationComment(this.giveFeedbackToolStripMenuItem, null); this.l10NSharpExtender1.SetLocalizationPriority(this.giveFeedbackToolStripMenuItem, L10NSharp.LocalizationPriority.NotLocalizable); - this.l10NSharpExtender1.SetLocalizingId(this.giveFeedbackToolStripMenuItem, "Shell.Shell.giveFeedbackToolStripMenuItem"); + this.l10NSharpExtender1.SetLocalizingId(this.giveFeedbackToolStripMenuItem, "Shell.GiveFeedbackMenuItem"); this.giveFeedbackToolStripMenuItem.Name = "giveFeedbackToolStripMenuItem"; this.giveFeedbackToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.giveFeedbackToolStripMenuItem.Text = "Give Feedback..."; diff --git a/src/HearThis/UI/Shell.cs b/src/HearThis/UI/Shell.cs index bbcfac26..7c98110e 100644 --- a/src/HearThis/UI/Shell.cs +++ b/src/HearThis/UI/Shell.cs @@ -32,7 +32,6 @@ using SIL.Reporting; using SIL.Windows.Forms.Extensions; using static System.String; -using NewItemPlaceholderPosition = System.ComponentModel.NewItemPlaceholderPosition; namespace HearThis.UI { From f07d39be66415c89e101d137b83a6217d8ed994f Mon Sep 17 00:00:00 2001 From: tombogle Date: Wed, 10 Aug 2022 10:04:36 -0400 Subject: [PATCH 3/5] Made a few localization and layout improvements in GiveFeedbackDlg --- src/HearThis/UI/GiveFeedbackDlg.Designer.cs | 66 +++++++++++---------- src/HearThis/UI/GiveFeedbackDlg.resx | 3 + 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs index d114640b..012dcc95 100644 --- a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs +++ b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs @@ -49,9 +49,9 @@ private void InitializeComponent() this._btnCancel = new System.Windows.Forms.Button(); this._lblAffects = new System.Windows.Forms.Label(); this._cboAffects = new System.Windows.Forms.ComboBox(); + this._lblWebsiteURL = new System.Windows.Forms.Label(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this._richTextBoxDescription = new System.Windows.Forms.RichTextBox(); - this._lblWebsiteURL = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.l10NSharpExtender1)).BeginInit(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); @@ -81,9 +81,9 @@ private void InitializeComponent() this._chkIncludeScreenshot.AutoSize = true; this._chkIncludeScreenshot.Enabled = false; this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeScreenshot, null); - this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeScreenshot, null); + this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeScreenshot, "Param 0: HearThis main window caption"); this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeScreenshot, "GiveFeedbackDlg._chkIncludeScreenshot"); - this._chkIncludeScreenshot.Location = new System.Drawing.Point(104, 257); + this._chkIncludeScreenshot.Location = new System.Drawing.Point(104, 247); this._chkIncludeScreenshot.Margin = new System.Windows.Forms.Padding(3, 20, 3, 3); this._chkIncludeScreenshot.Name = "_chkIncludeScreenshot"; this._chkIncludeScreenshot.Size = new System.Drawing.Size(184, 17); @@ -223,7 +223,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._lblProject, null); this.l10NSharpExtender1.SetLocalizationComment(this._lblProject, null); this.l10NSharpExtender1.SetLocalizingId(this._lblProject, "GiveFeedbackDlg._lblProject"); - this._lblProject.Location = new System.Drawing.Point(55, 184); + this._lblProject.Location = new System.Drawing.Point(55, 174); this._lblProject.Name = "_lblProject"; this._lblProject.Size = new System.Drawing.Size(43, 13); this._lblProject.TabIndex = 13; @@ -238,7 +238,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeRecordingInfo, null); this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeRecordingInfo, null); this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeRecordingInfo, "GiveFeedbackDlg._chkIncludeRecordingInfo"); - this._chkIncludeRecordingInfo.Location = new System.Drawing.Point(104, 280); + this._chkIncludeRecordingInfo.Location = new System.Drawing.Point(104, 270); this._chkIncludeRecordingInfo.Name = "_chkIncludeRecordingInfo"; this._chkIncludeRecordingInfo.Size = new System.Drawing.Size(168, 17); this._chkIncludeRecordingInfo.TabIndex = 14; @@ -253,7 +253,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeLog, null); this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeLog, null); this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeLog, "GiveFeedbackDlg._chkIncludeLog"); - this._chkIncludeLog.Location = new System.Drawing.Point(104, 303); + this._chkIncludeLog.Location = new System.Drawing.Point(104, 293); this._chkIncludeLog.Name = "_chkIncludeLog"; this._chkIncludeLog.Size = new System.Drawing.Size(112, 17); this._chkIncludeLog.TabIndex = 15; @@ -266,7 +266,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._txtProjectOrWebsite, null); this.l10NSharpExtender1.SetLocalizationComment(this._txtProjectOrWebsite, null); this.l10NSharpExtender1.SetLocalizingId(this._txtProjectOrWebsite, "GiveFeedbackDlg._txtProjectOrWebsite"); - this._txtProjectOrWebsite.Location = new System.Drawing.Point(104, 214); + this._txtProjectOrWebsite.Location = new System.Drawing.Point(104, 204); this._txtProjectOrWebsite.Name = "_txtProjectOrWebsite"; this._txtProjectOrWebsite.Size = new System.Drawing.Size(538, 20); this._txtProjectOrWebsite.TabIndex = 16; @@ -283,7 +283,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizationComment(this._cboProjectOrWebsite, null); this.l10NSharpExtender1.SetLocalizationPriority(this._cboProjectOrWebsite, L10NSharp.LocalizationPriority.NotLocalizable); this.l10NSharpExtender1.SetLocalizingId(this._cboProjectOrWebsite, "GiveFeedbackDlg._cboProjectOrWebsite"); - this._cboProjectOrWebsite.Location = new System.Drawing.Point(104, 187); + this._cboProjectOrWebsite.Location = new System.Drawing.Point(104, 177); this._cboProjectOrWebsite.Name = "_cboProjectOrWebsite"; this._cboProjectOrWebsite.Size = new System.Drawing.Size(297, 21); this._cboProjectOrWebsite.TabIndex = 17; @@ -293,30 +293,34 @@ private void InitializeComponent() this._lblInstructions.AutoSize = true; this._lblInstructions.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F); this.l10NSharpExtender1.SetLocalizableToolTip(this._lblInstructions, null); - this.l10NSharpExtender1.SetLocalizationComment(this._lblInstructions, null); - this.l10NSharpExtender1.SetLocalizationPriority(this._lblInstructions, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizationComment(this._lblInstructions, "Param 0: \"HearThis\" (product name)"); this.l10NSharpExtender1.SetLocalizingId(this._lblInstructions, "GiveFeedbackDlg._lblInstructions"); - this._lblInstructions.Location = new System.Drawing.Point(102, 343); + this._lblInstructions.Location = new System.Drawing.Point(102, 333); this._lblInstructions.Margin = new System.Windows.Forms.Padding(1, 20, 3, 0); this._lblInstructions.Name = "_lblInstructions"; this._lblInstructions.Size = new System.Drawing.Size(526, 39); this._lblInstructions.TabIndex = 18; this._lblInstructions.Text = resources.GetString("_lblInstructions.Text"); + this._lblInstructions.Visible = false; // // _linkDonate // this._linkDonate.AutoSize = true; this._linkDonate.LinkArea = new System.Windows.Forms.LinkArea(15, 15); this.l10NSharpExtender1.SetLocalizableToolTip(this._linkDonate, null); - this.l10NSharpExtender1.SetLocalizationComment(this._linkDonate, null); + this.l10NSharpExtender1.SetLocalizationComment(this._linkDonate, "Put square brackets around the text that should appear as the hyperlink. The text" + + " in the brackets is localizable. However, note that the URL it will take the use" + + "r to is in English."); this.l10NSharpExtender1.SetLocalizingId(this._linkDonate, "GiveFeedbackDlg._linkDonate"); this._linkDonate.Location = new System.Drawing.Point(104, 382); + this._linkDonate.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0); this._linkDonate.Name = "_linkDonate"; this._linkDonate.Size = new System.Drawing.Size(164, 17); this._linkDonate.TabIndex = 19; this._linkDonate.TabStop = true; this._linkDonate.Text = "Take me to the [donation page]."; this._linkDonate.UseCompatibleTextRendering = true; + this._linkDonate.Visible = false; // // _btnCancel // @@ -339,7 +343,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._lblAffects, null); this.l10NSharpExtender1.SetLocalizationComment(this._lblAffects, null); this.l10NSharpExtender1.SetLocalizingId(this._lblAffects, "GiveFeedbackDlg._lblAffects"); - this._lblAffects.Location = new System.Drawing.Point(58, 157); + this._lblAffects.Location = new System.Drawing.Point(58, 147); this._lblAffects.Name = "_lblAffects"; this._lblAffects.Size = new System.Drawing.Size(40, 13); this._lblAffects.TabIndex = 20; @@ -367,11 +371,27 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._cboAffects, null); this.l10NSharpExtender1.SetLocalizationComment(this._cboAffects, null); this.l10NSharpExtender1.SetLocalizingId(this._cboAffects, "comboBox2"); - this._cboAffects.Location = new System.Drawing.Point(104, 160); + this._cboAffects.Location = new System.Drawing.Point(104, 150); this._cboAffects.Name = "_cboAffects"; this._cboAffects.Size = new System.Drawing.Size(297, 21); this._cboAffects.TabIndex = 21; // + // _lblWebsiteURL + // + this._lblWebsiteURL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._lblWebsiteURL.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._lblWebsiteURL, null); + this.l10NSharpExtender1.SetLocalizationComment(this._lblWebsiteURL, null); + this.l10NSharpExtender1.SetLocalizationPriority(this._lblWebsiteURL, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this._lblWebsiteURL, "GiveFeedbackDlg._lblWebsiteURL"); + this._lblWebsiteURL.Location = new System.Drawing.Point(15, 201); + this._lblWebsiteURL.Name = "_lblWebsiteURL"; + this._lblWebsiteURL.Size = new System.Drawing.Size(83, 13); + this._lblWebsiteURL.TabIndex = 22; + this._lblWebsiteURL.Text = "URL of website:"; + this._lblWebsiteURL.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this._lblWebsiteURL.Visible = false; + // // tableLayoutPanel1 // this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -426,26 +446,10 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this._richTextBoxDescription.Location = new System.Drawing.Point(104, 129); this._richTextBoxDescription.Name = "_richTextBoxDescription"; - this._richTextBoxDescription.Size = new System.Drawing.Size(538, 25); + this._richTextBoxDescription.Size = new System.Drawing.Size(538, 15); this._richTextBoxDescription.TabIndex = 12; this._richTextBoxDescription.Text = ""; // - // _lblWebsiteURL - // - this._lblWebsiteURL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this._lblWebsiteURL.AutoSize = true; - this.l10NSharpExtender1.SetLocalizableToolTip(this._lblWebsiteURL, null); - this.l10NSharpExtender1.SetLocalizationComment(this._lblWebsiteURL, null); - this.l10NSharpExtender1.SetLocalizationPriority(this._lblWebsiteURL, L10NSharp.LocalizationPriority.NotLocalizable); - this.l10NSharpExtender1.SetLocalizingId(this._lblWebsiteURL, "GiveFeedbackDlg._lblWebsiteURL"); - this._lblWebsiteURL.Location = new System.Drawing.Point(15, 211); - this._lblWebsiteURL.Name = "_lblWebsiteURL"; - this._lblWebsiteURL.Size = new System.Drawing.Size(83, 13); - this._lblWebsiteURL.TabIndex = 22; - this._lblWebsiteURL.Text = "URL of website:"; - this._lblWebsiteURL.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this._lblWebsiteURL.Visible = false; - // // GiveFeedbackDlg // this.AcceptButton = this._btnOk; diff --git a/src/HearThis/UI/GiveFeedbackDlg.resx b/src/HearThis/UI/GiveFeedbackDlg.resx index e6575026..2fc30c9b 100644 --- a/src/HearThis/UI/GiveFeedbackDlg.resx +++ b/src/HearThis/UI/GiveFeedbackDlg.resx @@ -123,4 +123,7 @@ Use this form to give feedback to the {0} development team about the program. You can use it to report a problem you have encountered or to make a suggestion for an improvement. In addition to the description that you provide, the report will automatically include details about the version of {0}. + + 42 + \ No newline at end of file From 8e70377097c42ceea7879f6762612ea9f6b839f5 Mon Sep 17 00:00:00 2001 From: tombogle Date: Wed, 10 Aug 2022 22:31:25 -0400 Subject: [PATCH 4/5] Removed errant NotLocalizable --- src/HearThis/UI/GiveFeedbackDlg.Designer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs index 012dcc95..13df96de 100644 --- a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs +++ b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs @@ -382,7 +382,6 @@ private void InitializeComponent() this._lblWebsiteURL.AutoSize = true; this.l10NSharpExtender1.SetLocalizableToolTip(this._lblWebsiteURL, null); this.l10NSharpExtender1.SetLocalizationComment(this._lblWebsiteURL, null); - this.l10NSharpExtender1.SetLocalizationPriority(this._lblWebsiteURL, L10NSharp.LocalizationPriority.NotLocalizable); this.l10NSharpExtender1.SetLocalizingId(this._lblWebsiteURL, "GiveFeedbackDlg._lblWebsiteURL"); this._lblWebsiteURL.Location = new System.Drawing.Point(15, 201); this._lblWebsiteURL.Name = "_lblWebsiteURL"; From bb28cb8d049e9088b471f9c5b7f90c4e9c20b507 Mon Sep 17 00:00:00 2001 From: tombogle Date: Tue, 16 Aug 2022 17:18:05 -0400 Subject: [PATCH 5/5] [WIP] Added GiveFeedbackViewModel and began playing with Jira API Added property to Project to remember last recorded clip --- HearThis.sln.DotSettings | 1 + src/HearThis/GiveFeedbackViewModel.cs | 189 ++++++++++++++++++ src/HearThis/Script/Project.cs | 3 + src/HearThis/UI/GiveFeedbackDlg.Designer.cs | 34 ++-- src/HearThis/UI/GiveFeedbackDlg.cs | 29 ++- .../UI/RecordingToolControl.Designer.cs | 2 +- src/HearThis/UI/Shell.cs | 5 +- 7 files changed, 229 insertions(+), 34 deletions(-) create mode 100644 src/HearThis/GiveFeedbackViewModel.cs diff --git a/HearThis.sln.DotSettings b/HearThis.sln.DotSettings index 513212ad..bea30115 100644 --- a/HearThis.sln.DotSettings +++ b/HearThis.sln.DotSettings @@ -1,6 +1,7 @@  LCS MVP + RTF UI True True diff --git a/src/HearThis/GiveFeedbackViewModel.cs b/src/HearThis/GiveFeedbackViewModel.cs new file mode 100644 index 00000000..b6b6c0c4 --- /dev/null +++ b/src/HearThis/GiveFeedbackViewModel.cs @@ -0,0 +1,189 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; +using System.Windows.Forms; +using Newtonsoft.Json; +using System.Diagnostics; + +namespace HearThis +{ + public enum TypeOfFeedback + { + Problem = 0, + Suggestion = 1, + Appreciation = 2, + Donate = 3 + } + + public enum ProblemSeverity + { + LostData, + Blocker, + Major, + Minor + } + + public enum Area + { + NotApplicable, + DataSharing, + Exporting, + Android, + Installation, + Localization, + Multiple, + Navigation, + Other, + Playback, + ProjectAdministration, + ProjectSelection, + Recording, + Settings, + Website, + Unknown + } + + public class GiveFeedbackViewModel + { + public string Title { get; set; } + public TypeOfFeedback Type { get; set; } + public ProblemSeverity Severity { get; set; } + public string DescriptionAsRTF { get; set; } + public Area AffectedArea { get; set; } + public string AffectedProject { get; set; } + public string WebsiteUrl { get; set; } + public Form MainForm { get; } + public string PathToLastClip { get; } + public string MainFormWindowTitle => MainForm.Text; + public bool IncludeScreenShot { get; set; } + public bool IncludeLastClip { get; set; } + public bool IncludeLogFile { get; set; } + + public GiveFeedbackViewModel(Form mainForm, string pathToLastClip) + { + MainForm = mainForm; + PathToLastClip = pathToLastClip; + } + + public void GoToCommunitySite() + { + Process.Start($"https://{Program.kSupportUrlSansHttps}"); + } + + public void IssueFeedback() + { + switch (Type) + { + case TypeOfFeedback.Problem: + if (ReportProblemViaRestApi()) + return; + break; + + case TypeOfFeedback.Donate: + Process.Start("https://donate.givedirect.org/?cid=13536&n=289"); + break; + } + } + + private byte[] Screenshot() + { + return null; + } + + private bool ReportProblemViaRestApi() + { + // https://www.educative.io/answers/how-to-create-a-json-string-in-c-sharp + // https://docs.atlassian.com/software/jira/docs/api/REST/8.22.6/#issue-getEditIssueMeta + // https://jira.sil.org/rest/api/latest/issue/createmeta/HT/issuetypes + return false; + } + } + + // Root myDeserializedClass = JsonConvert.DeserializeObject(myJsonResponse); + + public class Component + { + public string id { get; set; } + } + + public class Content + { + public string type { get; set; } + public List content { get; set; } + public string text { get; set; } + } + + public class Description + { + public string type { get; set; } + public int version { get; set; } + public List content { get; set; } + } + + public class SystemEnvironment + { + public string type { get; set; } + public int version { get; set; } + public List content { get; set; } + } + + public class Fields + { + public string summary { get; set; } + public Issuetype issuetype { get; set; } + public List components { get; set; } + public JiraProject project { get; set; } + public Description description { get; set; } + public Reporter reporter { get; set; } + public Priority priority { get; set; } + public List labels { get; set; } + public Security security { get; set; } + public SystemEnvironment environment { get; set; } + public List versions { get; set; } + } + + public class Issuetype + { + [JsonPropertyName("id")] + public string Id { get; set; } + } + + public class Priority + { + [JsonPropertyName("id")] + public string Id { get; set; } + } + + public class JiraProject + { + [JsonPropertyName("id")] + public string Id => "HT"; + } + + public class Reporter + { + [JsonPropertyName("id")] + public string Id { get; set; } + } + + public class Root + { + public Update update { get; set; } + public Fields fields { get; set; } + } + + public class Security + { + [JsonPropertyName("id")] + public string Id { get; set; } + } + + public class Update + { + } + + public class HtVersion + { + [JsonPropertyName("id")] + public string Id { get; set; } + } +} diff --git a/src/HearThis/Script/Project.cs b/src/HearThis/Script/Project.cs index 03b4433f..f7e234f8 100644 --- a/src/HearThis/Script/Project.cs +++ b/src/HearThis/Script/Project.cs @@ -364,6 +364,8 @@ public IScrProjectSettings ScrProjectSettings public int TotalCountOfBlocksAndExtraClipsForChapter => LineCountForChapter + ExtraRecordings.Count; + public string PathToLastClipRecorded { get; private set; } + public bool HasRecordedClip(int line) { if (line >= LineCountForChapter) @@ -610,6 +612,7 @@ private List GetRecordableBlocksUpThroughHole(IEnumerable indic public void HandleSoundFileCreated() { var clipPath = GetPathToRecordingForSelectedLine(); + PathToLastClipRecorded = clipPath; // Getting this into a local variable is not only more efficient, it also // prevents an annoying problem when working with the sample project, whereby // re-getting the current script line loses information that has not yet been saved. diff --git a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs index 13df96de..b32a5f05 100644 --- a/src/HearThis/UI/GiveFeedbackDlg.Designer.cs +++ b/src/HearThis/UI/GiveFeedbackDlg.Designer.cs @@ -63,7 +63,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._btnOk, null); this.l10NSharpExtender1.SetLocalizationComment(this._btnOk, null); this.l10NSharpExtender1.SetLocalizingId(this._btnOk, "Common.OK"); - this._btnOk.Location = new System.Drawing.Point(499, 429); + this._btnOk.Location = new System.Drawing.Point(499, 480); this._btnOk.Name = "_btnOk"; this._btnOk.Size = new System.Drawing.Size(75, 23); this._btnOk.TabIndex = 3; @@ -83,7 +83,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeScreenshot, null); this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeScreenshot, "Param 0: HearThis main window caption"); this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeScreenshot, "GiveFeedbackDlg._chkIncludeScreenshot"); - this._chkIncludeScreenshot.Location = new System.Drawing.Point(104, 247); + this._chkIncludeScreenshot.Location = new System.Drawing.Point(104, 298); this._chkIncludeScreenshot.Margin = new System.Windows.Forms.Padding(3, 20, 3, 3); this._chkIncludeScreenshot.Name = "_chkIncludeScreenshot"; this._chkIncludeScreenshot.Size = new System.Drawing.Size(184, 17); @@ -223,7 +223,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._lblProject, null); this.l10NSharpExtender1.SetLocalizationComment(this._lblProject, null); this.l10NSharpExtender1.SetLocalizingId(this._lblProject, "GiveFeedbackDlg._lblProject"); - this._lblProject.Location = new System.Drawing.Point(55, 174); + this._lblProject.Location = new System.Drawing.Point(55, 225); this._lblProject.Name = "_lblProject"; this._lblProject.Size = new System.Drawing.Size(43, 13); this._lblProject.TabIndex = 13; @@ -238,7 +238,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeRecordingInfo, null); this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeRecordingInfo, null); this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeRecordingInfo, "GiveFeedbackDlg._chkIncludeRecordingInfo"); - this._chkIncludeRecordingInfo.Location = new System.Drawing.Point(104, 270); + this._chkIncludeRecordingInfo.Location = new System.Drawing.Point(104, 321); this._chkIncludeRecordingInfo.Name = "_chkIncludeRecordingInfo"; this._chkIncludeRecordingInfo.Size = new System.Drawing.Size(168, 17); this._chkIncludeRecordingInfo.TabIndex = 14; @@ -253,7 +253,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._chkIncludeLog, null); this.l10NSharpExtender1.SetLocalizationComment(this._chkIncludeLog, null); this.l10NSharpExtender1.SetLocalizingId(this._chkIncludeLog, "GiveFeedbackDlg._chkIncludeLog"); - this._chkIncludeLog.Location = new System.Drawing.Point(104, 293); + this._chkIncludeLog.Location = new System.Drawing.Point(104, 344); this._chkIncludeLog.Name = "_chkIncludeLog"; this._chkIncludeLog.Size = new System.Drawing.Size(112, 17); this._chkIncludeLog.TabIndex = 15; @@ -266,7 +266,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._txtProjectOrWebsite, null); this.l10NSharpExtender1.SetLocalizationComment(this._txtProjectOrWebsite, null); this.l10NSharpExtender1.SetLocalizingId(this._txtProjectOrWebsite, "GiveFeedbackDlg._txtProjectOrWebsite"); - this._txtProjectOrWebsite.Location = new System.Drawing.Point(104, 204); + this._txtProjectOrWebsite.Location = new System.Drawing.Point(104, 255); this._txtProjectOrWebsite.Name = "_txtProjectOrWebsite"; this._txtProjectOrWebsite.Size = new System.Drawing.Size(538, 20); this._txtProjectOrWebsite.TabIndex = 16; @@ -283,7 +283,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizationComment(this._cboProjectOrWebsite, null); this.l10NSharpExtender1.SetLocalizationPriority(this._cboProjectOrWebsite, L10NSharp.LocalizationPriority.NotLocalizable); this.l10NSharpExtender1.SetLocalizingId(this._cboProjectOrWebsite, "GiveFeedbackDlg._cboProjectOrWebsite"); - this._cboProjectOrWebsite.Location = new System.Drawing.Point(104, 177); + this._cboProjectOrWebsite.Location = new System.Drawing.Point(104, 228); this._cboProjectOrWebsite.Name = "_cboProjectOrWebsite"; this._cboProjectOrWebsite.Size = new System.Drawing.Size(297, 21); this._cboProjectOrWebsite.TabIndex = 17; @@ -295,7 +295,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._lblInstructions, null); this.l10NSharpExtender1.SetLocalizationComment(this._lblInstructions, "Param 0: \"HearThis\" (product name)"); this.l10NSharpExtender1.SetLocalizingId(this._lblInstructions, "GiveFeedbackDlg._lblInstructions"); - this._lblInstructions.Location = new System.Drawing.Point(102, 333); + this._lblInstructions.Location = new System.Drawing.Point(102, 384); this._lblInstructions.Margin = new System.Windows.Forms.Padding(1, 20, 3, 0); this._lblInstructions.Name = "_lblInstructions"; this._lblInstructions.Size = new System.Drawing.Size(526, 39); @@ -312,7 +312,7 @@ private void InitializeComponent() " in the brackets is localizable. However, note that the URL it will take the use" + "r to is in English."); this.l10NSharpExtender1.SetLocalizingId(this._linkDonate, "GiveFeedbackDlg._linkDonate"); - this._linkDonate.Location = new System.Drawing.Point(104, 382); + this._linkDonate.Location = new System.Drawing.Point(104, 433); this._linkDonate.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0); this._linkDonate.Name = "_linkDonate"; this._linkDonate.Size = new System.Drawing.Size(164, 17); @@ -329,7 +329,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._btnCancel, null); this.l10NSharpExtender1.SetLocalizationComment(this._btnCancel, null); this.l10NSharpExtender1.SetLocalizingId(this._btnCancel, "Common.Cancel"); - this._btnCancel.Location = new System.Drawing.Point(580, 429); + this._btnCancel.Location = new System.Drawing.Point(580, 480); this._btnCancel.Name = "_btnCancel"; this._btnCancel.Size = new System.Drawing.Size(75, 23); this._btnCancel.TabIndex = 6; @@ -343,7 +343,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._lblAffects, null); this.l10NSharpExtender1.SetLocalizationComment(this._lblAffects, null); this.l10NSharpExtender1.SetLocalizingId(this._lblAffects, "GiveFeedbackDlg._lblAffects"); - this._lblAffects.Location = new System.Drawing.Point(58, 147); + this._lblAffects.Location = new System.Drawing.Point(58, 198); this._lblAffects.Name = "_lblAffects"; this._lblAffects.Size = new System.Drawing.Size(40, 13); this._lblAffects.TabIndex = 20; @@ -355,7 +355,9 @@ private void InitializeComponent() this._cboAffects.FormattingEnabled = true; this._cboAffects.Items.AddRange(new object[] { "Does not apply", + "Data sharing", "Exporting", + "HearThis Android", "Installation", "Localization", "Multiple areas", @@ -371,7 +373,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._cboAffects, null); this.l10NSharpExtender1.SetLocalizationComment(this._cboAffects, null); this.l10NSharpExtender1.SetLocalizingId(this._cboAffects, "comboBox2"); - this._cboAffects.Location = new System.Drawing.Point(104, 150); + this._cboAffects.Location = new System.Drawing.Point(104, 201); this._cboAffects.Name = "_cboAffects"; this._cboAffects.Size = new System.Drawing.Size(297, 21); this._cboAffects.TabIndex = 21; @@ -383,7 +385,7 @@ private void InitializeComponent() this.l10NSharpExtender1.SetLocalizableToolTip(this._lblWebsiteURL, null); this.l10NSharpExtender1.SetLocalizationComment(this._lblWebsiteURL, null); this.l10NSharpExtender1.SetLocalizingId(this._lblWebsiteURL, "GiveFeedbackDlg._lblWebsiteURL"); - this._lblWebsiteURL.Location = new System.Drawing.Point(15, 201); + this._lblWebsiteURL.Location = new System.Drawing.Point(15, 252); this._lblWebsiteURL.Name = "_lblWebsiteURL"; this._lblWebsiteURL.Size = new System.Drawing.Size(83, 13); this._lblWebsiteURL.TabIndex = 22; @@ -435,7 +437,7 @@ private void InitializeComponent() this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(645, 399); + this.tableLayoutPanel1.Size = new System.Drawing.Size(645, 450); this.tableLayoutPanel1.TabIndex = 5; // // _richTextBoxDescription @@ -445,7 +447,7 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this._richTextBoxDescription.Location = new System.Drawing.Point(104, 129); this._richTextBoxDescription.Name = "_richTextBoxDescription"; - this._richTextBoxDescription.Size = new System.Drawing.Size(538, 15); + this._richTextBoxDescription.Size = new System.Drawing.Size(538, 66); this._richTextBoxDescription.TabIndex = 12; this._richTextBoxDescription.Text = ""; // @@ -455,7 +457,7 @@ private void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this._btnCancel; - this.ClientSize = new System.Drawing.Size(670, 464); + this.ClientSize = new System.Drawing.Size(670, 515); this.Controls.Add(this._btnCancel); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this._btnOk); diff --git a/src/HearThis/UI/GiveFeedbackDlg.cs b/src/HearThis/UI/GiveFeedbackDlg.cs index 76d7f41b..43aba540 100644 --- a/src/HearThis/UI/GiveFeedbackDlg.cs +++ b/src/HearThis/UI/GiveFeedbackDlg.cs @@ -21,13 +21,7 @@ namespace HearThis.UI /// public partial class GiveFeedbackDlg : Form, ILocalizable { - public enum TypeOfFeedback - { - Problem = 0, - Suggestion = 1, - Gratitude = 2, - Donate = 3, - } + private readonly GiveFeedbackViewModel _model; public enum PriorityOrSeverity { @@ -56,10 +50,11 @@ public enum AffectedArea Unknown, } - public GiveFeedbackDlg() + public GiveFeedbackDlg(GiveFeedbackViewModel model) { + _model = model; InitializeComponent(); - _linkCommunityHelp.Links[0].LinkData = new Action(() => Process.Start($"https://{Program.kSupportUrlSansHttps}")); + _linkCommunityHelp.Links[0].LinkData = new Action(() => _model.GoToCommunitySite()); _linkDonate.Links[0].LinkData = new Action(OpenDonationPage); Program.RegisterLocalizable(this); @@ -69,7 +64,7 @@ public GiveFeedbackDlg() #region Properties public string Title => _txtTitle.Text; - public TypeOfFeedback FeedbackType => (TypeOfFeedback)_cboTypeOfFeedback.SelectedIndex; + public TypeOfFeedback FeedbackType => _model.Type; public PriorityOrSeverity Priority => PriorityIsRelevant ? (PriorityOrSeverity)_cboPriority.SelectedIndex : PriorityOrSeverity.NotApplicable; @@ -77,7 +72,7 @@ public GiveFeedbackDlg() public string Description => _richTextBoxDescription.Text; public AffectedArea AffectedPartOfProgram => (AffectedArea) - (_cboAffects.SelectedIndex + (FeedbackType == TypeOfFeedback.Gratitude ? 0 : 1)); + (_cboAffects.SelectedIndex + (FeedbackType == TypeOfFeedback.Appreciation ? 0 : 1)); private bool PriorityIsRelevant { @@ -108,6 +103,7 @@ private void UpdateOkButtonState(object sender, EventArgs e) private void _cboTypeOfFeedback_SelectedIndexChanged(object sender, EventArgs e) { + _model.Type = (TypeOfFeedback)_cboTypeOfFeedback.SelectedIndex; _cboPriority.Items.Clear(); if (!(_cboPriority.Tag is List severityList) || severityList.Count != 4) throw new ApplicationException("_cboPriority.Tag not set properly in HandleStringsLocalized"); @@ -135,7 +131,7 @@ private void _cboTypeOfFeedback_SelectedIndexChanged(object sender, EventArgs e) "Idea for a minor enhancement")); break; - case TypeOfFeedback.Gratitude: + case TypeOfFeedback.Appreciation: if (_cboAffects.Items.Count == (int)AffectedArea.Unknown) _cboAffects.Items.Insert(0, notApplicableItem); PriorityIsRelevant = false; @@ -160,8 +156,10 @@ private void _btnOk_Click(object sender, EventArgs e) { if (FeedbackType == TypeOfFeedback.Donate) { - if (MessageBox.Show("Visit donation page now?", ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) - OpenDonationPage(); + var msg = LocalizationManager.GetString("GiveFeedbackDlg.DonationConfirmation", + "Visit donation page now?"); + if (MessageBox.Show(msg, ProductName, MessageBoxButtons.YesNo) == DialogResult.No) + DialogResult = DialogResult.Cancel; } } #endregion @@ -175,8 +173,7 @@ private void RemoveNotApplicableItemFromAffectsCombo() private void OpenDonationPage() { - Process.Start("https://donate.givedirect.org/?cid=13536&n=289"); - DialogResult = DialogResult.Cancel; + DialogResult = DialogResult.OK; Close(); } #endregion diff --git a/src/HearThis/UI/RecordingToolControl.Designer.cs b/src/HearThis/UI/RecordingToolControl.Designer.cs index b37748fe..82d090fc 100644 --- a/src/HearThis/UI/RecordingToolControl.Designer.cs +++ b/src/HearThis/UI/RecordingToolControl.Designer.cs @@ -484,9 +484,9 @@ private void InitializeComponent() this._scriptSlider.Size = new System.Drawing.Size(661, 25); this._scriptSlider.TabIndex = 11; this._scriptSlider.Value = 4; + this._scriptSlider.MouseEnterSegment += new HearThis.UI.DiscontiguousProgressTrackBar.MouseEnterSegmentHandler(this._scriptSlider_MouseEnterSegment); this._scriptSlider.ValueChanged += new System.EventHandler(this.OnLineSlider_ValueChanged); this._scriptSlider.MouseClick += new System.Windows.Forms.MouseEventHandler(this._scriptSlider_MouseClick); - this._scriptSlider.MouseEnterSegment += new DiscontiguousProgressTrackBar.MouseEnterSegmentHandler(_scriptSlider_MouseEnterSegment); // // _peakMeter // diff --git a/src/HearThis/UI/Shell.cs b/src/HearThis/UI/Shell.cs index 7c98110e..ef0140bc 100644 --- a/src/HearThis/UI/Shell.cs +++ b/src/HearThis/UI/Shell.cs @@ -949,10 +949,13 @@ private void _mergeHearThisPackItem_Click(object sender, EventArgs e) private void giveFeedbackToolStripMenuItem_Click(object sender, EventArgs e) { - using (var dlg = new GiveFeedbackDlg()) + var model = new GiveFeedbackViewModel(this, Project.PathToLastClipRecorded); + using (var dlg = new GiveFeedbackDlg(model)) { if (dlg.ShowDialog(this) == DialogResult.OK) { + model.IssueFeedback(); + try { var emailProvider = EmailProviderFactory.PreferredEmailProvider();