From 0aeec1885f30ac63393cb7f20ac62974b679edf8 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 17 Sep 2022 19:23:11 +0200 Subject: [PATCH] Added a multi-line state to the text elements --- .../DataModel/Database/Common/DataContext.cs | 1 + .../DataModel/Database/TextElement.cs | 2 + ...32808_202209AddMultiLineOption.Designer.cs | 206 ++++++++++++++++++ ...20220917132808_202209AddMultiLineOption.cs | 35 +++ .../Migrations/DataContextModelSnapshot.cs | 7 +- .../Processor/TextElementProcessor.cs | 30 ++- .../Components/TextElements.Designer.cs | 35 ++- .../UI WinForms/Components/TextElements.cs | 54 ++++- .../UI WinForms/Components/TextElements.resx | 3 + .../UI WinForms/Dialogs/InputDialog.cs | 4 +- .../UI WinForms/Resources/Icons.Designer.cs | 10 + .../UI WinForms/Resources/Icons.resx | 3 + .../UI WinForms/Resources/icons8-row-512.png | Bin 0 -> 2063 bytes 13 files changed, 361 insertions(+), 29 deletions(-) create mode 100644 I18N Commander/DataModel/Migrations/20220917132808_202209AddMultiLineOption.Designer.cs create mode 100644 I18N Commander/DataModel/Migrations/20220917132808_202209AddMultiLineOption.cs create mode 100644 I18N Commander/UI WinForms/Resources/icons8-row-512.png diff --git a/I18N Commander/DataModel/Database/Common/DataContext.cs b/I18N Commander/DataModel/Database/Common/DataContext.cs index d4155a5..cc5bb23 100644 --- a/I18N Commander/DataModel/Database/Common/DataContext.cs +++ b/I18N Commander/DataModel/Database/Common/DataContext.cs @@ -47,6 +47,7 @@ public sealed class DataContext : DbContext, IDataContext modelBuilder.Entity().HasIndex(n => n.Id); modelBuilder.Entity().HasIndex(n => n.Code); modelBuilder.Entity().HasIndex(n => n.Name); + modelBuilder.Entity().HasIndex(n => n.IsMultiLine); modelBuilder.Entity().Navigation(n => n.Section).AutoInclude(); #endregion diff --git a/I18N Commander/DataModel/Database/TextElement.cs b/I18N Commander/DataModel/Database/TextElement.cs index 43fe3c0..7c7a943 100644 --- a/I18N Commander/DataModel/Database/TextElement.cs +++ b/I18N Commander/DataModel/Database/TextElement.cs @@ -11,6 +11,8 @@ public sealed class TextElement public string Code { get; set; } = string.Empty; + public bool IsMultiLine { get; set; } = false; + public Section Section { get; set; } public List Translations { get; set; } = new(); diff --git a/I18N Commander/DataModel/Migrations/20220917132808_202209AddMultiLineOption.Designer.cs b/I18N Commander/DataModel/Migrations/20220917132808_202209AddMultiLineOption.Designer.cs new file mode 100644 index 0000000..750af7c --- /dev/null +++ b/I18N Commander/DataModel/Migrations/20220917132808_202209AddMultiLineOption.Designer.cs @@ -0,0 +1,206 @@ +// +using System; +using DataModel.Database.Common; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace DataModel.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20220917132808_202209AddMultiLineOption")] + partial class _202209AddMultiLineOption + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "6.0.9"); + + modelBuilder.Entity("DataModel.Database.Section", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DataKey") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Depth") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("DataKey"); + + b.HasIndex("Depth"); + + b.HasIndex("Id"); + + b.HasIndex("Name"); + + b.HasIndex("ParentId"); + + b.ToTable("Sections"); + }); + + modelBuilder.Entity("DataModel.Database.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BoolValue") + .HasColumnType("INTEGER"); + + b.Property("Code") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("GuidValue") + .HasColumnType("TEXT"); + + b.Property("IntegerValue") + .HasColumnType("INTEGER"); + + b.Property("TextValue") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("BoolValue"); + + b.HasIndex("Code") + .IsUnique(); + + b.HasIndex("GuidValue"); + + b.HasIndex("Id"); + + b.HasIndex("IntegerValue"); + + b.HasIndex("TextValue"); + + b.ToTable("Settings"); + }); + + modelBuilder.Entity("DataModel.Database.TextElement", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Code") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IsMultiLine") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SectionId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("Id"); + + b.HasIndex("IsMultiLine"); + + b.HasIndex("Name"); + + b.HasIndex("SectionId"); + + b.ToTable("TextElements"); + }); + + modelBuilder.Entity("DataModel.Database.Translation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Culture") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Text") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TextElementId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Culture"); + + b.HasIndex("Id"); + + b.HasIndex("Text"); + + b.HasIndex("TextElementId"); + + b.ToTable("Translations"); + }); + + modelBuilder.Entity("DataModel.Database.Section", b => + { + b.HasOne("DataModel.Database.Section", "Parent") + .WithMany() + .HasForeignKey("ParentId"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("DataModel.Database.TextElement", b => + { + b.HasOne("DataModel.Database.Section", "Section") + .WithMany("TextElements") + .HasForeignKey("SectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Section"); + }); + + modelBuilder.Entity("DataModel.Database.Translation", b => + { + b.HasOne("DataModel.Database.TextElement", "TextElement") + .WithMany("Translations") + .HasForeignKey("TextElementId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TextElement"); + }); + + modelBuilder.Entity("DataModel.Database.Section", b => + { + b.Navigation("TextElements"); + }); + + modelBuilder.Entity("DataModel.Database.TextElement", b => + { + b.Navigation("Translations"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/I18N Commander/DataModel/Migrations/20220917132808_202209AddMultiLineOption.cs b/I18N Commander/DataModel/Migrations/20220917132808_202209AddMultiLineOption.cs new file mode 100644 index 0000000..fe22be5 --- /dev/null +++ b/I18N Commander/DataModel/Migrations/20220917132808_202209AddMultiLineOption.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace DataModel.Migrations +{ + public partial class _202209AddMultiLineOption : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "IsMultiLine", + table: "TextElements", + type: "INTEGER", + nullable: false, + defaultValue: false); + + migrationBuilder.CreateIndex( + name: "IX_TextElements_IsMultiLine", + table: "TextElements", + column: "IsMultiLine"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_TextElements_IsMultiLine", + table: "TextElements"); + + migrationBuilder.DropColumn( + name: "IsMultiLine", + table: "TextElements"); + } + } +} diff --git a/I18N Commander/DataModel/Migrations/DataContextModelSnapshot.cs b/I18N Commander/DataModel/Migrations/DataContextModelSnapshot.cs index a43e0c8..091a4e5 100644 --- a/I18N Commander/DataModel/Migrations/DataContextModelSnapshot.cs +++ b/I18N Commander/DataModel/Migrations/DataContextModelSnapshot.cs @@ -15,7 +15,7 @@ namespace DataModel.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.5"); + modelBuilder.HasAnnotation("ProductVersion", "6.0.9"); modelBuilder.Entity("DataModel.Database.Section", b => { @@ -103,6 +103,9 @@ namespace DataModel.Migrations .IsRequired() .HasColumnType("TEXT"); + b.Property("IsMultiLine") + .HasColumnType("INTEGER"); + b.Property("Name") .IsRequired() .HasColumnType("TEXT"); @@ -116,6 +119,8 @@ namespace DataModel.Migrations b.HasIndex("Id"); + b.HasIndex("IsMultiLine"); + b.HasIndex("Name"); b.HasIndex("SectionId"); diff --git a/I18N Commander/Processor/TextElementProcessor.cs b/I18N Commander/Processor/TextElementProcessor.cs index 7f30adc..ae71b46 100644 --- a/I18N Commander/Processor/TextElementProcessor.cs +++ b/I18N Commander/Processor/TextElementProcessor.cs @@ -26,7 +26,7 @@ public static class TextElementProcessor } // Adds a new text element: - public static async Task> AddTextElement(string? currentSectionKey, string elementName) + public static async Task> AddTextElement(string? currentSectionKey, string elementName, bool isMultiLine) { await using var db = ProcessorMeta.ServiceProvider.GetRequiredService(); @@ -45,6 +45,7 @@ public static class TextElementProcessor Name = elementName, Code = code, Section = currentSection, + IsMultiLine = isMultiLine, }; // Add the new element to the database: @@ -62,15 +63,31 @@ public static class TextElementProcessor } } - // Renames a text element: - public static async Task> RenameTextElement(int id, string newName) + // Updates the multi-line flag of a text element: + public static async Task> UpdateTextElementState(int id, bool isMultiLine) { await using var db = ProcessorMeta.ServiceProvider.GetRequiredService(); - var textElement = await db.TextElements.FirstAsync(n => n.Id == id); - if (textElement is null) - throw new ArgumentOutOfRangeException(nameof(id)); + textElement.IsMultiLine = isMultiLine; + try + { + // Save the changes: + await db.SaveChangesAsync(); + return new ProcessorResult(textElement); + } + catch (DbUpdateException updateException) + { + return updateException.ToProcessorResult(); + } + } + + // Renames a text element: + public static async Task> RenameTextElement(int id, string newName, bool isMultiLine) + { + await using var db = ProcessorMeta.ServiceProvider.GetRequiredService(); + var textElement = await db.TextElements.FirstAsync(n => n.Id == id); + // Get the corresponding section: var section = (await db.TextElements.FirstAsync(n => n.Id == id)).Section; @@ -79,6 +96,7 @@ public static class TextElementProcessor textElement.Name = newName; textElement.Code = code; + textElement.IsMultiLine = isMultiLine; // Save the changes: try diff --git a/I18N Commander/UI WinForms/Components/TextElements.Designer.cs b/I18N Commander/UI WinForms/Components/TextElements.Designer.cs index a9a5cfd..f4325b3 100644 --- a/I18N Commander/UI WinForms/Components/TextElements.Designer.cs +++ b/I18N Commander/UI WinForms/Components/TextElements.Designer.cs @@ -40,6 +40,7 @@ this.listTextElements = new System.Windows.Forms.ListView(); this.column = new System.Windows.Forms.ColumnHeader(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.buttonChangeMultiLine = new System.Windows.Forms.Button(); this.tableLayout.SuspendLayout(); this.flowLayoutToolbar.SuspendLayout(); this.SuspendLayout(); @@ -62,7 +63,7 @@ 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, 100F)); this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); - this.tableLayout.Size = new System.Drawing.Size(706, 201); + this.tableLayout.Size = new System.Drawing.Size(706, 302); this.tableLayout.TabIndex = 0; // // flowLayoutToolbar @@ -70,13 +71,14 @@ this.flowLayoutToolbar.Controls.Add(this.buttonAdd); this.flowLayoutToolbar.Controls.Add(this.buttonRemove); this.flowLayoutToolbar.Controls.Add(this.buttonRename); + this.flowLayoutToolbar.Controls.Add(this.buttonChangeMultiLine); this.flowLayoutToolbar.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutToolbar.FlowDirection = System.Windows.Forms.FlowDirection.BottomUp; this.flowLayoutToolbar.Location = new System.Drawing.Point(0, 0); this.flowLayoutToolbar.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutToolbar.Name = "flowLayoutToolbar"; this.tableLayout.SetRowSpan(this.flowLayoutToolbar, 3); - this.flowLayoutToolbar.Size = new System.Drawing.Size(66, 201); + this.flowLayoutToolbar.Size = new System.Drawing.Size(66, 302); this.flowLayoutToolbar.TabIndex = 0; // // buttonAdd @@ -85,7 +87,7 @@ this.buttonAdd.FlatAppearance.BorderSize = 0; this.buttonAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonAdd.Image = global::UI_WinForms.Resources.Icons.icons8_add_tag_512; - this.buttonAdd.Location = new System.Drawing.Point(3, 138); + this.buttonAdd.Location = new System.Drawing.Point(3, 239); this.buttonAdd.Name = "buttonAdd"; this.buttonAdd.Size = new System.Drawing.Size(60, 60); this.buttonAdd.TabIndex = 0; @@ -99,7 +101,7 @@ this.buttonRemove.FlatAppearance.BorderSize = 0; this.buttonRemove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonRemove.Image = global::UI_WinForms.Resources.Icons.icons8_remove_tag_512; - this.buttonRemove.Location = new System.Drawing.Point(3, 72); + this.buttonRemove.Location = new System.Drawing.Point(3, 173); this.buttonRemove.Name = "buttonRemove"; this.buttonRemove.Size = new System.Drawing.Size(60, 60); this.buttonRemove.TabIndex = 2; @@ -113,7 +115,7 @@ this.buttonRename.FlatAppearance.BorderSize = 0; this.buttonRename.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonRename.Image = global::UI_WinForms.Resources.Icons.icons8_rename_512; - this.buttonRename.Location = new System.Drawing.Point(3, 6); + this.buttonRename.Location = new System.Drawing.Point(3, 107); this.buttonRename.Name = "buttonRename"; this.buttonRename.Size = new System.Drawing.Size(60, 60); this.buttonRename.TabIndex = 1; @@ -124,7 +126,7 @@ // textBoxFilter // this.textBoxFilter.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxFilter.Location = new System.Drawing.Point(149, 164); + this.textBoxFilter.Location = new System.Drawing.Point(149, 265); this.textBoxFilter.Name = "textBoxFilter"; this.textBoxFilter.Size = new System.Drawing.Size(554, 34); this.textBoxFilter.TabIndex = 2; @@ -135,7 +137,7 @@ // this.labelFilter.AutoSize = true; this.labelFilter.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelFilter.Location = new System.Drawing.Point(69, 161); + this.labelFilter.Location = new System.Drawing.Point(69, 262); this.labelFilter.Name = "labelFilter"; this.labelFilter.Size = new System.Drawing.Size(74, 40); this.labelFilter.TabIndex = 3; @@ -166,7 +168,7 @@ this.listTextElements.Location = new System.Drawing.Point(69, 43); this.listTextElements.MultiSelect = false; this.listTextElements.Name = "listTextElements"; - this.listTextElements.Size = new System.Drawing.Size(634, 115); + this.listTextElements.Size = new System.Drawing.Size(634, 216); this.listTextElements.TabIndex = 5; this.listTextElements.UseCompatibleStateImageBehavior = false; this.listTextElements.View = System.Windows.Forms.View.SmallIcon; @@ -184,6 +186,20 @@ this.toolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; this.toolTip.ToolTipTitle = "Help"; // + // buttonChangeMultiLine + // + this.buttonChangeMultiLine.Enabled = false; + this.buttonChangeMultiLine.FlatAppearance.BorderSize = 0; + this.buttonChangeMultiLine.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonChangeMultiLine.Image = global::UI_WinForms.Resources.Icons.icons8_align_text_left_512; + this.buttonChangeMultiLine.Location = new System.Drawing.Point(3, 41); + this.buttonChangeMultiLine.Name = "buttonChangeMultiLine"; + this.buttonChangeMultiLine.Size = new System.Drawing.Size(60, 60); + this.buttonChangeMultiLine.TabIndex = 3; + this.toolTip.SetToolTip(this.buttonChangeMultiLine, "Toggles the selected element\'s multi-line state"); + this.buttonChangeMultiLine.UseVisualStyleBackColor = true; + this.buttonChangeMultiLine.Click += new System.EventHandler(this.buttonChangeMultiLine_Click); + // // TextElements // this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); @@ -191,7 +207,7 @@ this.Controls.Add(this.tableLayout); this.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.Name = "TextElements"; - this.Size = new System.Drawing.Size(706, 201); + this.Size = new System.Drawing.Size(706, 302); this.tableLayout.ResumeLayout(false); this.tableLayout.PerformLayout(); this.flowLayoutToolbar.ResumeLayout(false); @@ -212,5 +228,6 @@ private Label labelSectionPath; private ListView listTextElements; private ColumnHeader column; + private Button buttonChangeMultiLine; } } diff --git a/I18N Commander/UI WinForms/Components/TextElements.cs b/I18N Commander/UI WinForms/Components/TextElements.cs index abed227..3a00f42 100644 --- a/I18N Commander/UI WinForms/Components/TextElements.cs +++ b/I18N Commander/UI WinForms/Components/TextElements.cs @@ -22,6 +22,7 @@ public partial class TextElements : UserControl var imgList = new ImageList(); imgList.ImageSize = new Size(45, 45); imgList.ColorDepth = ColorDepth.Depth32Bit; + imgList.Images.Add(Icons.icons8_row_512); imgList.Images.Add(Icons.icons8_align_text_left_512); // Set the image list to the list box: @@ -33,8 +34,8 @@ public partial class TextElements : UserControl this.currentSection = section; this.currentTextElement = null; this.buttonAdd.Enabled = this.currentSection is not null; - this.buttonRename.Enabled = this.buttonRemove.Enabled = false; - + this.buttonRename.Enabled = this.buttonRemove.Enabled = this.buttonChangeMultiLine.Enabled = false; + if (this.currentSection is null) return; @@ -47,7 +48,12 @@ public partial class TextElements : UserControl AppEvents.WhenTextElementChanged += (sender, textElement) => { this.currentTextElement = textElement; - this.buttonRename.Enabled = this.buttonRemove.Enabled = this.currentTextElement is not null; + this.buttonRename.Enabled = this.buttonRemove.Enabled = this.buttonChangeMultiLine.Enabled = this.currentTextElement is not null; + + if (this.currentTextElement is not null && this.currentTextElement.IsMultiLine) + this.buttonChangeMultiLine.Image = Icons.icons8_row_512; + else + this.buttonChangeMultiLine.Image = Icons.icons8_align_text_left_512; }; } @@ -63,7 +69,7 @@ public partial class TextElements : UserControl // Update the list: this.listTextElements.Items.Clear(); foreach (var textElement in textElements) - this.listTextElements.Items.Add(new ListViewItem(textElement.Name, 0) + this.listTextElements.Items.Add(new ListViewItem(textElement.Name, textElement.IsMultiLine ? 1 : 0) { Tag = textElement.Id, }); @@ -80,21 +86,22 @@ public partial class TextElements : UserControl Message: "Please type the desired text element's name.", Title: "Add a text element", Placeholder: "My text element", - ShowQuestionCheckbox: false + ShowQuestionCheckbox: true, + QuestionCheckboxText: "Is multi-line?" )); if(result.DialogResult == DialogResult.Cancel) return; - + // Add the text element to the database into the current section: - var newTextElement = await TextElementProcessor.AddTextElement(this.currentSection?.DataKey, result.Text); + var newTextElement = await TextElementProcessor.AddTextElement(this.currentSection?.DataKey, result.Text, result.AnswerToQuestion); newTextElement.ProcessError(); if(!newTextElement.Successful) return; // Add the text element to the list: - this.listTextElements.Items.Add(new ListViewItem(newTextElement.Result!.Name, 0) + this.listTextElements.Items.Add(new ListViewItem(newTextElement.Result!.Name, newTextElement.Result.IsMultiLine ? 1 : 0) { Tag = newTextElement.Result.Id, }); @@ -131,16 +138,39 @@ public partial class TextElements : UserControl var result = InputDialog.Show(new InputDialog.Options( Message: "Please edit the text element's name.", PreloadedText: this.currentTextElement!.Name, - ShowQuestionCheckbox: false, - Title: "Rename text element" + ShowQuestionCheckbox: true, + Title: "Rename text element", + QuestionCheckboxText: "Is multi-line?", + QuestionCheckboxState: this.currentTextElement.IsMultiLine )); // If the user canceled, return: if(result.DialogResult == DialogResult.Cancel) return; + + ProcessorResult alteredTextElement; + if(this.currentTextElement.Name == result.Text) + // Update the multi-line state: + alteredTextElement = await TextElementProcessor.UpdateTextElementState(this.currentTextElement.Id, result.AnswerToQuestion); + else + // Rename the text element: + alteredTextElement = await TextElementProcessor.RenameTextElement(this.currentTextElement.Id, result.Text, result.AnswerToQuestion); - // Rename the text element: - var alteredTextElement = await TextElementProcessor.RenameTextElement(this.currentTextElement.Id, result.Text); + alteredTextElement.ProcessError(); + if(!alteredTextElement.Successful) + return; + + // Reload the text elements: + await this.LoadTextElements(); + } + + private async void buttonChangeMultiLine_Click(object sender, EventArgs e) + { + if(this.DesignMode) + return; + + // Update the multi-line state: + var alteredTextElement = await TextElementProcessor.UpdateTextElementState(this.currentTextElement!.Id, !this.currentTextElement.IsMultiLine); alteredTextElement.ProcessError(); if(!alteredTextElement.Successful) diff --git a/I18N Commander/UI WinForms/Components/TextElements.resx b/I18N Commander/UI WinForms/Components/TextElements.resx index 99de901..8d589da 100644 --- a/I18N Commander/UI WinForms/Components/TextElements.resx +++ b/I18N Commander/UI WinForms/Components/TextElements.resx @@ -60,4 +60,7 @@ 17, 17 + + 17, 17 + \ No newline at end of file diff --git a/I18N Commander/UI WinForms/Dialogs/InputDialog.cs b/I18N Commander/UI WinForms/Dialogs/InputDialog.cs index eb92d63..09502f1 100644 --- a/I18N Commander/UI WinForms/Dialogs/InputDialog.cs +++ b/I18N Commander/UI WinForms/Dialogs/InputDialog.cs @@ -10,7 +10,8 @@ public partial class InputDialog : Form string OkButtonText = "Ok", string CancelButtonText = "Cancel", bool ShowQuestionCheckbox = false, - string QuestionCheckboxText = "" + string QuestionCheckboxText = "", + bool QuestionCheckboxState = false ); private InputDialog() @@ -29,6 +30,7 @@ public partial class InputDialog : Form inputDialog.buttonCancel.Text = options.CancelButtonText; inputDialog.checkBoxQuestion.Visible = options.ShowQuestionCheckbox; inputDialog.checkBoxQuestion.Text = options.QuestionCheckboxText; + inputDialog.checkBoxQuestion.Checked = options.QuestionCheckboxState; // Ensure, that the text box is focused on load: inputDialog.textBoxInput.Select(); diff --git a/I18N Commander/UI WinForms/Resources/Icons.Designer.cs b/I18N Commander/UI WinForms/Resources/Icons.Designer.cs index eec4a58..b719be1 100644 --- a/I18N Commander/UI WinForms/Resources/Icons.Designer.cs +++ b/I18N Commander/UI WinForms/Resources/Icons.Designer.cs @@ -280,6 +280,16 @@ namespace UI_WinForms.Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_row_512 { + get { + object obj = ResourceManager.GetObject("icons8_row_512", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/I18N Commander/UI WinForms/Resources/Icons.resx b/I18N Commander/UI WinForms/Resources/Icons.resx index ccb480d..5afe036 100644 --- a/I18N Commander/UI WinForms/Resources/Icons.resx +++ b/I18N Commander/UI WinForms/Resources/Icons.resx @@ -184,6 +184,9 @@ icons8-rename-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + icons8-row-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + icons8-settings.svg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/I18N Commander/UI WinForms/Resources/icons8-row-512.png b/I18N Commander/UI WinForms/Resources/icons8-row-512.png new file mode 100644 index 0000000000000000000000000000000000000000..3542a95396a41a676e931e89515458f3b1c82c01 GIT binary patch literal 2063 zcmah~Yfuwc6po`s9y-Me!^_sV2wIgS1Ol=U8Iqu6Bs_y8tqLL8goPv9UHMG>gH92l_bj1NGe(3=E7McW^n?7iQ2zH{z5=bqga z60~l@!|0>zYM zy{0GzOC*>O1aR`CIDty1)s^_<@j)V}dW7mqp;6zbBUr3F%1eo1F|tWrVa;fjW8jjuc;o)#JU9Tw2~3@2*fO?xIFevo8JBX@(BEXTp~|pGtj{_V zQmHXXq8O1FoC7%{iepkjBT^%NGEiV9y^>j)7G_I>5~- zJr|MNI#SU^jV?L87YaL<%Q)-Tl(aTea`$P+%Zr^`n+6`?*GoIObH;7WyI1 za0%Zh%zt*ptFAq0rI(#u=(i~5sqN6V4BTI_?O9ZbFrd|5yF!=le(!hlJ!ZkHWW4>J zx&!C=a=#Hl)s1Wm^Qgr~FBSE;|aCta9G8I60g?TT)2oSf^s`tEuMzWiGMrQYi2-goW1jWsz8`uvZ%XfXEY4*0I`NyVlZSq5>UJq!`69xm z{L1X7>Z{6e3l&>7*j9mxz~{nD6(Gb(B#VXmXBMg8pe-nohRgBe3v^E(_{LlLEi&n< z_tmb*Yh!({`?Jr!E?6YH#6Mx0uCsJlqAN|W6{1ClqFCjyzubRSU=G_M^JbM6pNX-t;sl2psu?Lo&)MsEzxQ;HYh7dukN>YO)sA!phjo|+pZ z`(|UUBjNm@v?cLi-MzP&x6FsqTNbV9>3O`h!oE8WkUG4z^aUGf4m!JGLGhO-D(m00 zy;h%TN5?oh&5Ji^XsvEU*M~cJ8F7w_3XT#zUT2k!qW98E9=j+z5dnrw8^fH^X`>M zTv4Ze%BDLzvJ#GLvoD%RF)2G*z&f>)FDOabm+i|u+3G;$ UQQ=ReI{kN?>mS4^V@2=y7v3}t