From e9b4fa14846c4309955b5a0a6d4c702d9cf0b6ca Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Fri, 17 Feb 2023 20:42:30 +0100 Subject: [PATCH 1/2] Added specific icons for Godot and .NET settings --- .../UI WinForms/Components/Setting.cs | 12 +++++------ .../UI WinForms/Resources/Icons.Designer.cs | 20 ++++++++++++++++++ .../UI WinForms/Resources/Icons.resx | 6 ++++++ .../UI WinForms/Resources/godot-icon.png | Bin 0 -> 2212 bytes .../Resources/icons8-c-sharp-logo.svg.png | Bin 0 -> 3927 bytes 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 I18N Commander/UI WinForms/Resources/godot-icon.png create mode 100644 I18N Commander/UI WinForms/Resources/icons8-c-sharp-logo.svg.png diff --git a/I18N Commander/UI WinForms/Components/Setting.cs b/I18N Commander/UI WinForms/Components/Setting.cs index 504157f..133bf45 100644 --- a/I18N Commander/UI WinForms/Components/Setting.cs +++ b/I18N Commander/UI WinForms/Components/Setting.cs @@ -441,7 +441,7 @@ public sealed partial class Setting : UserControl var currentSetting = await AppSettings.GetGeneratorDotnetEnabled(); var settingData = new SettingUIData( - Icon: Icons.icons8_code_512, + Icon: Icons.icons8_c_sharp_logo_svg, SettingName: () => "Generator: .NET", ChangeNeedsRestart: false, SettingExplanation: () => "When enabled, .NET translation files are generated. Requires a .NET 7 or newer project.", @@ -469,7 +469,7 @@ public sealed partial class Setting : UserControl var currentSetting = await AppSettings.GetGeneratorDotnetDestinationPath(); var settingData = new SettingUIData( - Icon: Icons.icons8_code_512, + Icon: Icons.icons8_c_sharp_logo_svg, SettingName: () => "Generator: .NET Destination Path", ChangeNeedsRestart: false, SettingExplanation: () => "The destination path for the .NET translation files. You might use environment variables like %USERPROFILE%.", @@ -528,7 +528,7 @@ public sealed partial class Setting : UserControl var currentSetting = await AppSettings.GetGeneratorDotnetNamespace(); var settingData = new SettingUIData( - Icon: Icons.icons8_code_512, + Icon: Icons.icons8_c_sharp_logo_svg, SettingName: () => "Generator: .NET Namespace", ChangeNeedsRestart: false, SettingExplanation: () => "The namespace for the .NET I18N files.", @@ -560,7 +560,7 @@ public sealed partial class Setting : UserControl // Attention: We have to store the culture's index, because the index is not // continuous and can change when the user adds or removes a culture! var settingData = new SettingUIData( - Icon: Icons.icons8_code_512, + Icon: Icons.icons8_c_sharp_logo_svg, SettingName: () => "Generator: .NET Default Culture", ChangeNeedsRestart: false, SettingExplanation: () => "The default culture for the .NET, which is used when no culture is specified or available.", @@ -604,7 +604,7 @@ public sealed partial class Setting : UserControl var currentSetting = await AppSettings.GetGeneratorGodotEnabled(); var settingData = new SettingUIData( - Icon: Icons.icons8_code_512, + Icon: Icons.godot_icon, SettingName: () => "Generator: Godot", ChangeNeedsRestart: false, SettingExplanation: () => "When enabled, Godot translation files are generated. Requires a Godot 3.5 or newer project.", @@ -632,7 +632,7 @@ public sealed partial class Setting : UserControl var currentSetting = await AppSettings.GetGeneratorGodotDestinationPath(); var settingData = new SettingUIData( - Icon: Icons.icons8_code_512, + Icon: Icons.godot_icon, SettingName: () => "Generator: Godot Destination Path", ChangeNeedsRestart: false, SettingExplanation: () => "The destination path for the Godot translation files. You might use environment variables like %USERPROFILE%.", diff --git a/I18N Commander/UI WinForms/Resources/Icons.Designer.cs b/I18N Commander/UI WinForms/Resources/Icons.Designer.cs index 9425012..366c5b6 100644 --- a/I18N Commander/UI WinForms/Resources/Icons.Designer.cs +++ b/I18N Commander/UI WinForms/Resources/Icons.Designer.cs @@ -70,6 +70,16 @@ namespace UI_WinForms.Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap godot_icon { + get { + object obj = ResourceManager.GetObject("godot_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -120,6 +130,16 @@ namespace UI_WinForms.Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_c_sharp_logo_svg { + get { + object obj = ResourceManager.GetObject("icons8_c_sharp_logo_svg", 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 5e58ae2..1de0062 100644 --- a/I18N Commander/UI WinForms/Resources/Icons.resx +++ b/I18N Commander/UI WinForms/Resources/Icons.resx @@ -121,6 +121,9 @@ deepl_logo_icon_170284.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + godot-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + icons8-add-folder-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -151,6 +154,9 @@ icons8-collectibles-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + icons8-c-sharp-logo.svg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + icons8-delete-folder-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/I18N Commander/UI WinForms/Resources/godot-icon.png b/I18N Commander/UI WinForms/Resources/godot-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5439e2171eaa744e248ad1e59cacc87f930adc4d GIT binary patch literal 2212 zcmV;V2wV4wP);)5u$5U~gntrCffK^u#RFHnmlf>E2~ z%tOfIxJ!^=E7%GOqK&UY{{n3VYe7&HL2R{Fw9#S+IsuN?Nb+ zLOPSv0uz4ce0afG_l%WR9CR=kQFL`CI3A*^ecWL&zg6|mF`k0`2^ z6P^^FUd^c{Zwt36$;h(ssjyp<3ku(wdbG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:00:00 2001 From: Thorsten Sommer Date: Fri, 17 Feb 2023 20:58:22 +0100 Subject: [PATCH 2/2] Added specific settings for WinForms generator --- .../DataModel/Database/SettingNames.cs | 2 + I18N Commander/Processor/AppSettings.cs | 16 +++ .../Processor/Generators/DotnetWinForms.cs | 14 +++ I18N Commander/Processor/Version.cs | 2 +- .../UI WinForms/Components/Setting.cs | 91 +++++++++++++++++- .../UI WinForms/Resources/Icons.Designer.cs | 10 ++ .../UI WinForms/Resources/Icons.resx | 3 + .../Resources/icons8-user-interface-512.png | Bin 0 -> 3934 bytes 8 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 I18N Commander/Processor/Generators/DotnetWinForms.cs create mode 100644 I18N Commander/UI WinForms/Resources/icons8-user-interface-512.png diff --git a/I18N Commander/DataModel/Database/SettingNames.cs b/I18N Commander/DataModel/Database/SettingNames.cs index 040b428..75d5dfb 100644 --- a/I18N Commander/DataModel/Database/SettingNames.cs +++ b/I18N Commander/DataModel/Database/SettingNames.cs @@ -18,4 +18,6 @@ public static class SettingNames public static readonly string AUTO_EXPORT_DESTINATION_PATH = "Auto-Export Destination Path"; public static readonly string AUTO_EXPORT_FILENAME = "Auto-Export Filename"; public static readonly string AUTO_EXPORT_SENSITIVE_DATA = "Auto-Export Sensitive Data"; + public static readonly string GENERATOR_DOTNET_WIN_FORMS_ENABLED = "Generator .NET WinForms Enabled"; + public static readonly string GENERATOR_DOTNET_WIN_FORMS_ROOT_PATH = "Generator .NET WinForms Root Path"; } \ No newline at end of file diff --git a/I18N Commander/Processor/AppSettings.cs b/I18N Commander/Processor/AppSettings.cs index 401be31..67d1135 100644 --- a/I18N Commander/Processor/AppSettings.cs +++ b/I18N Commander/Processor/AppSettings.cs @@ -423,6 +423,22 @@ public static class AppSettings public static async Task SetGeneratorGodotDestinationPath(string path) => await AppSettings.SetSetting(SettingNames.GENERATOR_GODOT_DESTINATION_PATH, path); + #endregion + + #region .NET WinForms Generator Enabled/Disabled + + public static async Task GetGeneratorDotnetWinFormsEnabled() => await AppSettings.GetSetting(SettingNames.GENERATOR_DOTNET_WIN_FORMS_ENABLED, false); + + public static async Task SetGeneratorDotnetWinFormsEnabled(bool enabled) => await AppSettings.SetSetting(SettingNames.GENERATOR_DOTNET_WIN_FORMS_ENABLED, enabled); + + #endregion + + #region .NET WinForms Generator Root Path + + public static async Task GetGeneratorDotnetWinFormsRootPath() => await AppSettings.GetSetting(SettingNames.GENERATOR_DOTNET_WIN_FORMS_ROOT_PATH, string.Empty); + + public static async Task SetGeneratorDotnetWinFormsRootPath(string path) => await AppSettings.SetSetting(SettingNames.GENERATOR_DOTNET_WIN_FORMS_ROOT_PATH, path); + #endregion #endregion diff --git a/I18N Commander/Processor/Generators/DotnetWinForms.cs b/I18N Commander/Processor/Generators/DotnetWinForms.cs new file mode 100644 index 0000000..a5ae782 --- /dev/null +++ b/I18N Commander/Processor/Generators/DotnetWinForms.cs @@ -0,0 +1,14 @@ +namespace Processor.Generators; + +public class DotnetWinForms : IGenerator +{ + #region Implementation of IGenerator + + /// + public async Task> GenerateAsync() + { + return new ProcessorResult(1); + } + + #endregion +} \ No newline at end of file diff --git a/I18N Commander/Processor/Version.cs b/I18N Commander/Processor/Version.cs index ff8a151..c258519 100644 --- a/I18N Commander/Processor/Version.cs +++ b/I18N Commander/Processor/Version.cs @@ -2,5 +2,5 @@ public static class Version { - public static string Text => $"v0.9.7 (2023-02-16), .NET {Environment.Version}"; + public static string Text => $"v0.10.1 (2023-02-17), .NET {Environment.Version}"; } \ No newline at end of file diff --git a/I18N Commander/UI WinForms/Components/Setting.cs b/I18N Commander/UI WinForms/Components/Setting.cs index 133bf45..790bb2c 100644 --- a/I18N Commander/UI WinForms/Components/Setting.cs +++ b/I18N Commander/UI WinForms/Components/Setting.cs @@ -686,6 +686,93 @@ public sealed partial class Setting : UserControl return new Setting(settingData); } + private static async Task ShowGeneratorDotnetWinFormsEnabledSettingAsync() + { + var currentSetting = await AppSettings.GetGeneratorDotnetWinFormsEnabled(); + + var settingData = new SettingUIData( + Icon: Icons.icons8_user_interface_512, + SettingName: () => "Generator: .NET WinForms", + ChangeNeedsRestart: false, + SettingExplanation: () => "When enabled, .NET WinForms translation files are generated. Requires a .NET WinForms project.", + SettingExplanationLink: () => (string.Empty, string.Empty), + SetupDataControl: (changeTrigger) => + { + // Set up an checkbox: + var checkbox = new CheckBox(); + checkbox.Checked = currentSetting; + checkbox.CheckedChanged += async (sender, args) => await AppSettings.SetGeneratorDotnetWinFormsEnabled(checkbox.Checked); + checkbox.CheckedChanged += (sender, args) => changeTrigger(); + checkbox.Text = "Enable .NET WinForms Generator"; + + // Apply the desired layout: + checkbox.Dock = DockStyle.Fill; + return checkbox; + } + ); + + return new Setting(settingData); + } + + private static async Task ShowGeneratorDotnetWinFormsRootPathSettingAsync() + { + var currentSetting = await AppSettings.GetGeneratorDotnetWinFormsRootPath(); + + var settingData = new SettingUIData( + Icon: Icons.icons8_user_interface_512, + SettingName: () => "Generator: .NET WinForms Root Path", + ChangeNeedsRestart: false, + SettingExplanation: () => "The root path for the .NET WinForms project. You might use environment variables like %USERPROFILE%. Starting from this path, the generator will search for *.Designer.cs files to find used translation keys.", + SettingExplanationLink: () => (string.Empty, string.Empty), + SetupDataControl: (changeTrigger) => + { + // Set up a horizontal layout: + var layout = new TableLayoutPanel(); + layout.ColumnCount = 2; + layout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); + layout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 66F)); + layout.RowCount = 1; + layout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + layout.Dock = DockStyle.Fill; + + // Set up a textbox: + var textbox = new TextBox(); + textbox.Text = currentSetting; + textbox.TextChanged += async (sender, args) => await AppSettings.SetGeneratorDotnetWinFormsRootPath(textbox.Text); + textbox.TextChanged += (sender, args) => changeTrigger(); + textbox.Dock = DockStyle.Fill; + textbox.Margin = new Padding(0, 13, 0, 13); + layout.Controls.Add(textbox, 0, 0); + + // Set up a button: + var button = new Button(); + button.Text = string.Empty; + button.Image = Icons.icons8_folder_tree_512; + button.FlatStyle = FlatStyle.Flat; + button.FlatAppearance.BorderSize = 0; + button.BackColor = Color.Empty; + button.UseVisualStyleBackColor = true; + button.Size = new Size(60, 60); + button.Click += (sender, args) => + { + var dialog = new FolderBrowserDialog(); + dialog.SelectedPath = textbox.Text; + dialog.InitialDirectory = textbox.Text; + dialog.Description = "Select the root path for the .NET WinForms project."; + dialog.ShowNewFolderButton = true; + if (dialog.ShowDialog() == DialogResult.OK) + textbox.Text = dialog.SelectedPath; + }; + button.Dock = DockStyle.Fill; + layout.Controls.Add(button, 1, 0); + + return layout; + } + ); + + return new Setting(settingData); + } + private static async Task ShowGeneratorAutoExportEnabledSettingAsync() { var currentSetting = await AppSettings.GetAutoExportEnabled(); @@ -837,7 +924,9 @@ public sealed partial class Setting : UserControl yield return ShowGeneratorAutoExportDestinationPathSettingAsync(); yield return ShowGeneratorAutoExportExportSensitiveDataSettingAsync(); yield return ShowGeneratorAutoExportEnabledSettingAsync(); - + + yield return ShowGeneratorDotnetWinFormsRootPathSettingAsync(); + yield return ShowGeneratorDotnetWinFormsEnabledSettingAsync(); yield return ShowGeneratorGodotDestinationPathSettingAsync(); yield return ShowGeneratorGodotEnabledSettingAsync(); yield return ShowGeneratorDotnetDefaultCultureSettingAsync(); diff --git a/I18N Commander/UI WinForms/Resources/Icons.Designer.cs b/I18N Commander/UI WinForms/Resources/Icons.Designer.cs index 366c5b6..7d02295 100644 --- a/I18N Commander/UI WinForms/Resources/Icons.Designer.cs +++ b/I18N Commander/UI WinForms/Resources/Icons.Designer.cs @@ -399,5 +399,15 @@ namespace UI_WinForms.Resources { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_user_interface_512 { + get { + object obj = ResourceManager.GetObject("icons8_user_interface_512", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/I18N Commander/UI WinForms/Resources/Icons.resx b/I18N Commander/UI WinForms/Resources/Icons.resx index 1de0062..7c1ae01 100644 --- a/I18N Commander/UI WinForms/Resources/Icons.resx +++ b/I18N Commander/UI WinForms/Resources/Icons.resx @@ -220,4 +220,7 @@ icons8-trigger(1).svg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + icons8-user-interface-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/I18N Commander/UI WinForms/Resources/icons8-user-interface-512.png b/I18N Commander/UI WinForms/Resources/icons8-user-interface-512.png new file mode 100644 index 0000000000000000000000000000000000000000..ed78e8b7304c01fa1b51c633e4f6e8305cfe6653 GIT binary patch literal 3934 zcmai1c|6o>`yP=svS&9~-Y@mmd){--@At=iXP)P}?(4aq`+A;xKHnrq2Rm_5B~cIvB#uE_ zI|JX^>mOl3;E7OreHH`~xK49*W4mDwB8c=L7@kBYkYSu427rS=NOKMYPYfWl!2~ju z7L0<-HZ(!NG!hDO*bu9OWmu8@Xy^zg*(Jikl^78~G$BFE%|wwL1RxMZX5+z}puk`j zf`fu==pumM>(g)uc!RzbIDz;*QCdV1ObLz{Ipn2qOX2eWppOMKI?CbNi48iP%v2ZPr& z@dSD(8wG&?IQY9bn@0Jm9?bf_eV`EVbp);p(}Djtoy?*A1AQI&3!ULdXVY1JbjFVj z{Ar0F@LvLf^8I}X2haFBG8X%P(}RNkv<(*9CJZRV_oDtOr~fR#ay`l*!=1@2dMJ}f zwh1E#vv+J%V!bX1Oc0(*K1dFxvi(pH1H=CT4%0~gJHIXz7`pBRE|>-^t@ks;?I(tU z80*1xe?snm3$2$L;Yj0<1Kq4?LF8Z-p!y?=pP>6cfL8QCI@1L>)?^gq+gd+-Kx|-G zIthUEH`4eCVXUkinRE&*5WrZ@c9vj_jg^tEiII`E9_*V8U>X95rBRMr+FjU&pmDqP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