main: Added logo to login page and added warning when node isn't synced

This commit is contained in:
Nathan Woodburn 2023-07-07 15:44:29 +10:00
parent 55da4f4fc1
commit a09a10dd10
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
3 changed files with 1104 additions and 3 deletions

View File

@ -34,6 +34,7 @@
SyncLabel = new ToolStripStatusLabel(); SyncLabel = new ToolStripStatusLabel();
timerUpdate = new System.Windows.Forms.Timer(components); timerUpdate = new System.Windows.Forms.Timer(components);
panelLogin = new Panel(); panelLogin = new Panel();
pictureBoxLogo = new PictureBox();
groupBoxLogin = new GroupBox(); groupBoxLogin = new GroupBox();
labelWelcome = new Label(); labelWelcome = new Label();
textBoxPassword = new TextBox(); textBoxPassword = new TextBox();
@ -49,8 +50,10 @@
groupBoxAccount = new GroupBox(); groupBoxAccount = new GroupBox();
labelDomains = new Label(); labelDomains = new Label();
labelBalance = new Label(); labelBalance = new Label();
LabelSyncWarning = new ToolStripStatusLabel();
statusStripMain.SuspendLayout(); statusStripMain.SuspendLayout();
panelLogin.SuspendLayout(); panelLogin.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBoxLogo).BeginInit();
groupBoxLogin.SuspendLayout(); groupBoxLogin.SuspendLayout();
panelPortfolio.SuspendLayout(); panelPortfolio.SuspendLayout();
groupBoxDomains.SuspendLayout(); groupBoxDomains.SuspendLayout();
@ -61,7 +64,7 @@
// statusStripMain // statusStripMain
// //
statusStripMain.Dock = DockStyle.Top; statusStripMain.Dock = DockStyle.Top;
statusStripMain.Items.AddRange(new ToolStripItem[] { SyncLabel }); statusStripMain.Items.AddRange(new ToolStripItem[] { SyncLabel, LabelSyncWarning });
statusStripMain.Location = new Point(0, 0); statusStripMain.Location = new Point(0, 0);
statusStripMain.Name = "statusStripMain"; statusStripMain.Name = "statusStripMain";
statusStripMain.Size = new Size(1099, 22); statusStripMain.Size = new Size(1099, 22);
@ -83,12 +86,23 @@
// //
// panelLogin // panelLogin
// //
panelLogin.Controls.Add(pictureBoxLogo);
panelLogin.Controls.Add(groupBoxLogin); panelLogin.Controls.Add(groupBoxLogin);
panelLogin.Location = new Point(1081, 556); panelLogin.Location = new Point(12, 40);
panelLogin.Name = "panelLogin"; panelLogin.Name = "panelLogin";
panelLogin.Size = new Size(1099, 558); panelLogin.Size = new Size(1099, 558);
panelLogin.TabIndex = 1; panelLogin.TabIndex = 1;
// //
// pictureBoxLogo
//
pictureBoxLogo.Image = (Image)resources.GetObject("pictureBoxLogo.Image");
pictureBoxLogo.Location = new Point(453, 20);
pictureBoxLogo.Name = "pictureBoxLogo";
pictureBoxLogo.Size = new Size(130, 98);
pictureBoxLogo.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxLogo.TabIndex = 5;
pictureBoxLogo.TabStop = false;
//
// groupBoxLogin // groupBoxLogin
// //
groupBoxLogin.Controls.Add(labelWelcome); groupBoxLogin.Controls.Add(labelWelcome);
@ -151,7 +165,7 @@
panelPortfolio.Controls.Add(groupBoxDomains); panelPortfolio.Controls.Add(groupBoxDomains);
panelPortfolio.Controls.Add(panelNav); panelPortfolio.Controls.Add(panelNav);
panelPortfolio.Controls.Add(groupBoxAccount); panelPortfolio.Controls.Add(groupBoxAccount);
panelPortfolio.Location = new Point(0, 22); panelPortfolio.Location = new Point(1041, 468);
panelPortfolio.Name = "panelPortfolio"; panelPortfolio.Name = "panelPortfolio";
panelPortfolio.Size = new Size(1052, 529); panelPortfolio.Size = new Size(1052, 529);
panelPortfolio.TabIndex = 2; panelPortfolio.TabIndex = 2;
@ -255,6 +269,13 @@
labelBalance.TabIndex = 0; labelBalance.TabIndex = 0;
labelBalance.Text = "labelBal"; labelBalance.Text = "labelBal";
// //
// LabelSyncWarning
//
LabelSyncWarning.Name = "LabelSyncWarning";
LabelSyncWarning.Size = new Size(443, 17);
LabelSyncWarning.Text = "Please wait for node to sync. Account info could be incorrect while node is behind.";
LabelSyncWarning.Visible = false;
//
// MainForm // MainForm
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
@ -273,6 +294,7 @@
statusStripMain.ResumeLayout(false); statusStripMain.ResumeLayout(false);
statusStripMain.PerformLayout(); statusStripMain.PerformLayout();
panelLogin.ResumeLayout(false); panelLogin.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)pictureBoxLogo).EndInit();
groupBoxLogin.ResumeLayout(false); groupBoxLogin.ResumeLayout(false);
groupBoxLogin.PerformLayout(); groupBoxLogin.PerformLayout();
panelPortfolio.ResumeLayout(false); panelPortfolio.ResumeLayout(false);
@ -305,5 +327,7 @@
private Panel panelDomainList; private Panel panelDomainList;
private Button buttonRenew; private Button buttonRenew;
private Button buttonSend; private Button buttonSend;
private PictureBox pictureBoxLogo;
private ToolStripStatusLabel LabelSyncWarning;
} }
} }

View File

@ -160,6 +160,9 @@ namespace FireWalletLite
JObject chain = JObject.Parse(resp["chain"].ToString()); JObject chain = JObject.Parse(resp["chain"].ToString());
decimal progress = Convert.ToDecimal(chain["progress"].ToString()); decimal progress = Convert.ToDecimal(chain["progress"].ToString());
SyncLabel.Text = "Sync: " + decimal.Round(progress * 100, 2) + "%"; SyncLabel.Text = "Sync: " + decimal.Round(progress * 100, 2) + "%";
if (progress < 1) LabelSyncWarning.Visible = true;
else LabelSyncWarning.Visible = false;
} }
// Try to keep wallet unlocked // Try to keep wallet unlocked
@ -385,6 +388,13 @@ namespace FireWalletLite
{ {
groupBoxLogin.Left = (this.ClientSize.Width - groupBoxLogin.Width) / 2; groupBoxLogin.Left = (this.ClientSize.Width - groupBoxLogin.Width) / 2;
groupBoxLogin.Top = (this.ClientSize.Height - groupBoxLogin.Height) / 2; groupBoxLogin.Top = (this.ClientSize.Height - groupBoxLogin.Height) / 2;
pictureBoxLogo.Height = groupBoxLogin.Top - 20;
pictureBoxLogo.Width = pictureBoxLogo.Height;
pictureBoxLogo.Top = 10;
pictureBoxLogo.Left = (this.ClientSize.Width - pictureBoxLogo.Width) / 2;
textBoxPassword.Focus(); textBoxPassword.Focus();
} }
private async void TestForLogin() private async void TestForLogin()

File diff suppressed because it is too large Load Diff