From 642a6ab0223a2b0a6ffca6d1e33d6b668c8fefe6 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 6 Nov 2022 20:12:26 +0100 Subject: [PATCH] Added & shows version text --- I18N Commander/Processor/Version.cs | 6 +++++ .../Components/LoaderStart.Designer.cs | 26 +++++++++++++++---- .../UI WinForms/Components/LoaderStart.cs | 2 ++ .../Components/Settings.Designer.cs | 16 +++++++++++- .../UI WinForms/Components/Settings.cs | 2 ++ I18N Commander/UI WinForms/Program.cs | 1 - 6 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 I18N Commander/Processor/Version.cs diff --git a/I18N Commander/Processor/Version.cs b/I18N Commander/Processor/Version.cs new file mode 100644 index 0000000..31affb9 --- /dev/null +++ b/I18N Commander/Processor/Version.cs @@ -0,0 +1,6 @@ +namespace Processor; + +public static class Version +{ + public static string Text => $"v0.7.0 (2022-11-06), .NET {Environment.Version}"; +} \ No newline at end of file diff --git a/I18N Commander/UI WinForms/Components/LoaderStart.Designer.cs b/I18N Commander/UI WinForms/Components/LoaderStart.Designer.cs index 2adebcb..f193020 100644 --- a/I18N Commander/UI WinForms/Components/LoaderStart.Designer.cs +++ b/I18N Commander/UI WinForms/Components/LoaderStart.Designer.cs @@ -35,6 +35,7 @@ this.flowLayoutButtons = new System.Windows.Forms.FlowLayoutPanel(); this.buttonNew = new System.Windows.Forms.Button(); this.buttonOpen = new System.Windows.Forms.Button(); + this.labelVersion = new System.Windows.Forms.Label(); this.contextMenuRecentProjects = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.tableLayout.SuspendLayout(); @@ -50,17 +51,18 @@ this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 128F)); this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 360F)); this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayout.Controls.Add(this.pictureBox, 1, 1); this.tableLayout.Controls.Add(this.labelTitle, 2, 1); this.tableLayout.Controls.Add(this.flowLayoutButtons, 1, 2); + this.tableLayout.Controls.Add(this.labelVersion, 1, 3); this.tableLayout.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayout.Location = new System.Drawing.Point(0, 0); this.tableLayout.Name = "tableLayout"; - this.tableLayout.RowCount = 4; + this.tableLayout.RowCount = 5; this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 128F)); this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 66F)); + this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayout.Size = new System.Drawing.Size(937, 465); this.tableLayout.TabIndex = 0; @@ -69,7 +71,7 @@ // this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBox.Image = global::UI_WinForms.Resources.Icons.icons8_language_512; - this.pictureBox.Location = new System.Drawing.Point(227, 138); + this.pictureBox.Location = new System.Drawing.Point(227, 118); this.pictureBox.Name = "pictureBox"; this.pictureBox.Size = new System.Drawing.Size(122, 122); this.pictureBox.TabIndex = 0; @@ -79,7 +81,7 @@ // this.labelTitle.Dock = System.Windows.Forms.DockStyle.Fill; this.labelTitle.Font = new System.Drawing.Font("Segoe UI", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.labelTitle.Location = new System.Drawing.Point(355, 135); + this.labelTitle.Location = new System.Drawing.Point(355, 115); this.labelTitle.Name = "labelTitle"; this.labelTitle.Size = new System.Drawing.Size(354, 128); this.labelTitle.TabIndex = 1; @@ -92,7 +94,7 @@ this.flowLayoutButtons.Controls.Add(this.buttonNew); this.flowLayoutButtons.Controls.Add(this.buttonOpen); this.flowLayoutButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutButtons.Location = new System.Drawing.Point(224, 263); + this.flowLayoutButtons.Location = new System.Drawing.Point(224, 243); this.flowLayoutButtons.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutButtons.Name = "flowLayoutButtons"; this.flowLayoutButtons.Size = new System.Drawing.Size(488, 66); @@ -124,6 +126,18 @@ this.buttonOpen.UseVisualStyleBackColor = true; this.buttonOpen.Click += new System.EventHandler(this.buttonOpen_Click); // + // labelVersion + // + this.labelVersion.AutoSize = true; + this.labelVersion.BackColor = System.Drawing.Color.LightGray; + this.tableLayout.SetColumnSpan(this.labelVersion, 2); + this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelVersion.Location = new System.Drawing.Point(227, 309); + this.labelVersion.Name = "labelVersion"; + this.labelVersion.Size = new System.Drawing.Size(482, 40); + this.labelVersion.TabIndex = 3; + this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // contextMenuRecentProjects // this.contextMenuRecentProjects.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); @@ -148,6 +162,7 @@ this.Name = "LoaderStart"; this.Size = new System.Drawing.Size(937, 465); this.tableLayout.ResumeLayout(false); + this.tableLayout.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.flowLayoutButtons.ResumeLayout(false); this.contextMenuRecentProjects.ResumeLayout(false); @@ -165,5 +180,6 @@ private Button buttonOpen; private ContextMenuStrip contextMenuRecentProjects; private ToolStripMenuItem toolStripMenuItem1; + private Label labelVersion; } } diff --git a/I18N Commander/UI WinForms/Components/LoaderStart.cs b/I18N Commander/UI WinForms/Components/LoaderStart.cs index 9a18582..523bc35 100644 --- a/I18N Commander/UI WinForms/Components/LoaderStart.cs +++ b/I18N Commander/UI WinForms/Components/LoaderStart.cs @@ -1,5 +1,6 @@ using System.ComponentModel; using Microsoft.Win32; +using Version = Processor.Version; namespace UI_WinForms.Components; @@ -11,6 +12,7 @@ public partial class LoaderStart : UserControl public LoaderStart() { this.InitializeComponent(); + this.labelVersion.Text = Version.Text; } #region Recent Projects diff --git a/I18N Commander/UI WinForms/Components/Settings.Designer.cs b/I18N Commander/UI WinForms/Components/Settings.Designer.cs index 6701b53..1164284 100644 --- a/I18N Commander/UI WinForms/Components/Settings.Designer.cs +++ b/I18N Commander/UI WinForms/Components/Settings.Designer.cs @@ -38,6 +38,7 @@ this.buttonDeleteCulture = new System.Windows.Forms.Button(); this.contextMenuDelete = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.labelVersion = new System.Windows.Forms.Label(); this.tableLayout.SuspendLayout(); this.flowLayoutToolbar.SuspendLayout(); this.SuspendLayout(); @@ -100,6 +101,7 @@ this.tableLayout.SetColumnSpan(this.flowLayoutToolbar, 2); this.flowLayoutToolbar.Controls.Add(this.buttonAddCulture); this.flowLayoutToolbar.Controls.Add(this.buttonDeleteCulture); + this.flowLayoutToolbar.Controls.Add(this.labelVersion); this.flowLayoutToolbar.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutToolbar.Location = new System.Drawing.Point(0, 315); this.flowLayoutToolbar.Margin = new System.Windows.Forms.Padding(0); @@ -139,7 +141,7 @@ this.contextMenuDelete.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.contextMenuDelete.ImageScalingSize = new System.Drawing.Size(20, 20); this.contextMenuDelete.Name = "contextMenuDelete"; - this.contextMenuDelete.Size = new System.Drawing.Size(211, 32); + this.contextMenuDelete.Size = new System.Drawing.Size(61, 4); // // toolTip // @@ -149,6 +151,16 @@ this.toolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; this.toolTip.ToolTipTitle = "Help"; // + // labelVersion + // + this.labelVersion.AutoSize = true; + this.labelVersion.Dock = System.Windows.Forms.DockStyle.Left; + this.labelVersion.Location = new System.Drawing.Point(135, 0); + this.labelVersion.Name = "labelVersion"; + this.labelVersion.Size = new System.Drawing.Size(0, 66); + this.labelVersion.TabIndex = 1; + this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // Settings // this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); @@ -160,6 +172,7 @@ this.tableLayout.ResumeLayout(false); this.tableLayout.PerformLayout(); this.flowLayoutToolbar.ResumeLayout(false); + this.flowLayoutToolbar.PerformLayout(); this.ResumeLayout(false); } @@ -175,5 +188,6 @@ private Button buttonAddCulture; private Button buttonDeleteCulture; private ContextMenuStrip contextMenuDelete; + private Label labelVersion; } } diff --git a/I18N Commander/UI WinForms/Components/Settings.cs b/I18N Commander/UI WinForms/Components/Settings.cs index 5e3c002..950551d 100644 --- a/I18N Commander/UI WinForms/Components/Settings.cs +++ b/I18N Commander/UI WinForms/Components/Settings.cs @@ -1,4 +1,5 @@ using Processor; +using Version = Processor.Version; namespace UI_WinForms.Components; @@ -7,6 +8,7 @@ public partial class Settings : UserControl public Settings() { this.InitializeComponent(); + this.labelVersion.Text = Version.Text; this.Load += async (sender, args) => await this.LoadAllSettings(); } diff --git a/I18N Commander/UI WinForms/Program.cs b/I18N Commander/UI WinForms/Program.cs index 2504c35..054d7de 100644 --- a/I18N Commander/UI WinForms/Program.cs +++ b/I18N Commander/UI WinForms/Program.cs @@ -8,7 +8,6 @@ namespace UI_WinForms; internal static class Program { - internal const string VERSION = "v0.1.0"; internal static IServiceProvider? SERVICE_PROVIDER; internal static bool RestartMainApp = false;