From 5eb80bcd06ce91d2a32944865b8bc5c824938640 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 14 Jun 2023 17:30:47 +1000 Subject: [PATCH] main: Added help menu --- FireWallet/MainForm.Designer.cs | 43 ++++++++++++++++++++++++++++++++- FireWallet/MainForm.cs | 42 +++++++++++++++++++++++++++++++- FireWallet/MainForm.resx | 11 ++++++++- 3 files changed, 93 insertions(+), 3 deletions(-) diff --git a/FireWallet/MainForm.Designer.cs b/FireWallet/MainForm.Designer.cs index b5ef3bb..2875f3a 100644 --- a/FireWallet/MainForm.Designer.cs +++ b/FireWallet/MainForm.Designer.cs @@ -41,6 +41,10 @@ namespace FireWallet toolStripStatusLabelaccount = new ToolStripStatusLabel(); toolStripStatusLabelLedger = new ToolStripStatusLabel(); toolStripSplitButtonlogout = new ToolStripSplitButton(); + toolStripDropDownButtonHelp = new ToolStripDropDownButton(); + githubToolStripMenuItem = new ToolStripMenuItem(); + websiteToolStripMenuItem = new ToolStripMenuItem(); + supportDiscordServerToolStripMenuItem = new ToolStripMenuItem(); timerNodeStatus = new System.Windows.Forms.Timer(components); panelaccount = new Panel(); groupBoxaccount = new GroupBox(); @@ -139,7 +143,7 @@ namespace FireWallet // statusStripmain // statusStripmain.Dock = DockStyle.Top; - statusStripmain.Items.AddRange(new ToolStripItem[] { toolStripStatusLabelNetwork, toolStripStatusLabelstatus, toolStripStatusLabelaccount, toolStripStatusLabelLedger, toolStripSplitButtonlogout }); + statusStripmain.Items.AddRange(new ToolStripItem[] { toolStripStatusLabelNetwork, toolStripStatusLabelstatus, toolStripStatusLabelaccount, toolStripStatusLabelLedger, toolStripSplitButtonlogout, toolStripDropDownButtonHelp }); statusStripmain.Location = new Point(0, 0); statusStripmain.Name = "statusStripmain"; statusStripmain.Size = new Size(1152, 22); @@ -190,6 +194,39 @@ namespace FireWallet toolStripSplitButtonlogout.Visible = false; toolStripSplitButtonlogout.ButtonClick += Logout; // + // toolStripDropDownButtonHelp + // + toolStripDropDownButtonHelp.DisplayStyle = ToolStripItemDisplayStyle.Text; + toolStripDropDownButtonHelp.DropDownItems.AddRange(new ToolStripItem[] { githubToolStripMenuItem, websiteToolStripMenuItem, supportDiscordServerToolStripMenuItem }); + toolStripDropDownButtonHelp.Image = (Image)resources.GetObject("toolStripDropDownButtonHelp.Image"); + toolStripDropDownButtonHelp.ImageTransparentColor = Color.Magenta; + toolStripDropDownButtonHelp.Margin = new Padding(20, 2, 0, 0); + toolStripDropDownButtonHelp.Name = "toolStripDropDownButtonHelp"; + toolStripDropDownButtonHelp.Size = new Size(45, 20); + toolStripDropDownButtonHelp.Text = "Help"; + toolStripDropDownButtonHelp.ToolTipText = "Help"; + // + // githubToolStripMenuItem + // + githubToolStripMenuItem.Name = "githubToolStripMenuItem"; + githubToolStripMenuItem.Size = new Size(194, 22); + githubToolStripMenuItem.Text = "Github"; + githubToolStripMenuItem.Click += githubToolStripMenuItem_Click; + // + // websiteToolStripMenuItem + // + websiteToolStripMenuItem.Name = "websiteToolStripMenuItem"; + websiteToolStripMenuItem.Size = new Size(194, 22); + websiteToolStripMenuItem.Text = "Website"; + websiteToolStripMenuItem.Click += websiteToolStripMenuItem_Click; + // + // supportDiscordServerToolStripMenuItem + // + supportDiscordServerToolStripMenuItem.Name = "supportDiscordServerToolStripMenuItem"; + supportDiscordServerToolStripMenuItem.Size = new Size(194, 22); + supportDiscordServerToolStripMenuItem.Text = "Support Discord Server"; + supportDiscordServerToolStripMenuItem.Click += supportDiscordServerToolStripMenuItem_Click; + // // timerNodeStatus // timerNodeStatus.Enabled = true; @@ -1137,5 +1174,9 @@ namespace FireWallet private Button buttonRevealAll; private Button buttonExportDomains; private Button buttonRenewAll; + private ToolStripDropDownButton toolStripDropDownButtonHelp; + private ToolStripMenuItem githubToolStripMenuItem; + private ToolStripMenuItem websiteToolStripMenuItem; + private ToolStripMenuItem supportDiscordServerToolStripMenuItem; } } \ No newline at end of file diff --git a/FireWallet/MainForm.cs b/FireWallet/MainForm.cs index 669df96..46a4b8d 100644 --- a/FireWallet/MainForm.cs +++ b/FireWallet/MainForm.cs @@ -48,6 +48,14 @@ namespace FireWallet timerNodeStatus.Stop(); LoadSettings(); UpdateTheme(); + // Theme drop down + foreach (ToolStripMenuItem c in toolStripDropDownButtonHelp.DropDownItems) + { + c.ForeColor = ColorTranslator.FromHtml(theme["foreground"]); + c.BackColor = ColorTranslator.FromHtml(theme["background"]); + } + toolStripDropDownButtonHelp.DropDown.BackColor = ColorTranslator.FromHtml(theme["background"]); + if (await LoadNode() != true) this.Close(); @@ -903,7 +911,8 @@ namespace FireWallet if (watchOnly) { APIresponse = await APIPost("", true, "{\"method\": \"listtransactions\",\"params\": [\"default\"," + toGet + "," + toSkip + ", true]}"); - } else + } + else { APIresponse = await APIPost("", true, "{\"method\": \"listtransactions\",\"params\": [\"default\"," + toGet + "," + toSkip + "]}"); } @@ -1983,5 +1992,36 @@ namespace FireWallet AddBatch(domain, "RENEW"); } } + + private void githubToolStripMenuItem_Click(object sender, EventArgs e) + { + // Open the GitHub page + ProcessStartInfo psi = new ProcessStartInfo + { + FileName = "https://github.com/Nathanwoodburn/FireWallet/", + UseShellExecute = true + }; + Process.Start(psi); + } + + private void websiteToolStripMenuItem_Click(object sender, EventArgs e) + { + ProcessStartInfo psi = new ProcessStartInfo + { + FileName = "https://firewallet", + UseShellExecute = true + }; + Process.Start(psi); + } + + private void supportDiscordServerToolStripMenuItem_Click(object sender, EventArgs e) + { + ProcessStartInfo psi = new ProcessStartInfo + { + FileName = "https://l.woodburn.au/discord", + UseShellExecute = true + }; + Process.Start(psi); + } } } \ No newline at end of file diff --git a/FireWallet/MainForm.resx b/FireWallet/MainForm.resx index f4122f6..41012d3 100644 --- a/FireWallet/MainForm.resx +++ b/FireWallet/MainForm.resx @@ -120,10 +120,19 @@ 133, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACRSURBVDhPY/j27dt/SjDYACcnJ7IwigEf3n8kCZNswPNb + J/+f6DYF0yA+yQac6Db5f6hWCmwIiE+mC0wIu2DS2Vf/F1x6DefjwlgNyNr34r/0wkdgTMgQDAOQNRNj + CIoBOg0rMTTDMLIhIHbriZeYBmDTiIxBGkEYxge5liQDsGGQqykyAISpZwAlmIEywMAAAAc1/Jwvt6sN + AAAAAElFTkSuQmCC + + 269, 17 - AAABAAEAAAAAAAEAIAB2pAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAOEAAADAAgGAAAAfG+p9QAAIABJ