From 9531302788306233048e07fe3a982d72a066dc03 Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sat, 28 Mar 2020 16:25:22 +0100 Subject: [PATCH] #69 --- IEC Mate/App.config | 18 +++ IEC Mate/IEC Mate.csproj | 4 +- IEC Mate/MainWindow.xaml | 172 +++++++++++++++++++++- IEC Mate/MainWindow.xaml.cs | 129 +++++++++++++++- IEC Mate/Properties/AssemblyInfo.cs | 4 +- IEC Mate/Properties/Resources.Designer.cs | 27 ++++ IEC Mate/Properties/Resources.de-DE.resx | 9 ++ IEC Mate/Properties/Resources.en-GB.resx | 9 ++ IEC Mate/Properties/Resources.resx | 9 ++ IEC Mate/Properties/Settings.Designer.cs | 72 +++++++++ IEC Mate/Properties/Settings.settings | 18 +++ 11 files changed, 461 insertions(+), 10 deletions(-) diff --git a/IEC Mate/App.config b/IEC Mate/App.config index a47b06e..f8a5a3c 100644 --- a/IEC Mate/App.config +++ b/IEC Mate/App.config @@ -133,6 +133,24 @@ update_Dataview_simu_DB_to_vers_1_2_x_and_this_order.bat + + + + + + + + + + + + + + + + + + diff --git a/IEC Mate/IEC Mate.csproj b/IEC Mate/IEC Mate.csproj index ae5b200..2cfcfb0 100644 --- a/IEC Mate/IEC Mate.csproj +++ b/IEC Mate/IEC Mate.csproj @@ -28,7 +28,7 @@ AssemblyVersionAttribute None.None.Increment.DateStamp None.None.Increment.DateStamp - 1.0.1622.20088 + 1.0.1645.20088 C:\Users\r.scheidegger\Downloads\IEC Mate\ true Disk @@ -42,7 +42,7 @@ IEC-Mate Remo Scheidegger 19222 - 1.0.1622.20088 + 1.0.1645.20088 false true true diff --git a/IEC Mate/MainWindow.xaml b/IEC Mate/MainWindow.xaml index 65216ab..97ea8d1 100644 --- a/IEC Mate/MainWindow.xaml +++ b/IEC Mate/MainWindow.xaml @@ -1214,7 +1214,7 @@ + Width="300" VerticalContentAlignment="Center" TextChanged="Text_projktpfad_helfer_TextChanged" IsReadOnly="True"> + Width="300" VerticalContentAlignment="Center" TextChanged="Text_projktpfad_dataview_TextChanged" IsReadOnly="True"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IEC Mate/MainWindow.xaml.cs b/IEC Mate/MainWindow.xaml.cs index b875ce2..ecfa61c 100644 --- a/IEC Mate/MainWindow.xaml.cs +++ b/IEC Mate/MainWindow.xaml.cs @@ -232,6 +232,19 @@ public MainWindow() text_px_nummer.Text = Properties.Settings.Default.pxnummer; ts_offnen_nppp.IsChecked = Properties.Settings.Default.offnen_mit_nppp; + text_pfadOrdner1.Text = Properties.Settings.Default.ordner1; + setButtonLabel(lb_Ordner1, Properties.Settings.Default.ordner1); + text_pfadOrdner2.Text = Properties.Settings.Default.ordner2; + setButtonLabel(lb_Ordner2, Properties.Settings.Default.ordner2); + text_pfadOrdner3.Text = Properties.Settings.Default.ordner3; + setButtonLabel(lb_Ordner3, Properties.Settings.Default.ordner3); + text_pfadOrdner4.Text = Properties.Settings.Default.ordner4; + setButtonLabel(lb_Ordner4, Properties.Settings.Default.ordner4); + text_pfadOrdner5.Text = Properties.Settings.Default.ordner5; + setButtonLabel(lb_Ordner5, Properties.Settings.Default.ordner5); + text_pfadOrdner6.Text = Properties.Settings.Default.ordner6; + setButtonLabel(lb_Ordner6, Properties.Settings.Default.ordner6); + cb_hotkey_pxBeginEnd.Text = key2.ToString(); cb_hotekey_plain.Text = key3.ToString(); cb_hotkey_pxComment.Text = key1.ToString(); @@ -1216,6 +1229,13 @@ private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEven Properties.Settings.Default.exakte_suche = (bool)ts_exakte_suche.IsChecked; Properties.Settings.Default.offnen_mit_nppp = (bool)ts_offnen_nppp.IsChecked; + Properties.Settings.Default.ordner1 = text_pfadOrdner1.Text; + Properties.Settings.Default.ordner2 = text_pfadOrdner2.Text; + Properties.Settings.Default.ordner3 = text_pfadOrdner3.Text; + Properties.Settings.Default.ordner4 = text_pfadOrdner4.Text; + Properties.Settings.Default.ordner5 = text_pfadOrdner5.Text; + Properties.Settings.Default.ordner6 = text_pfadOrdner6.Text; + Properties.Settings.Default.Save(); HotkeyManager.Current.Remove("PxBeginEnd"); @@ -3931,10 +3951,117 @@ private void Btn_update_bitset_option_Click(object sender, RoutedEventArgs e) UpdateBitsetKundenspez(text_option.Text, text_neue_option.Text, "option"); } + private void Btn_pfadOrdner1_Click(object sender, RoutedEventArgs e) + { + selctOrdnerPfad(text_pfadOrdner1, "1", bt_Ordner1, lb_Ordner1); + } - #endregion + private void Bt_Ordner1_Click(object sender, RoutedEventArgs e) + { + openOrdnerPfad(text_pfadOrdner1.Text); + } + private void Btn_pfadOrdner2_Click(object sender, RoutedEventArgs e) + { + selctOrdnerPfad(text_pfadOrdner2, "2", bt_Ordner2, lb_Ordner2); + } + + private void Bt_Ordner2_Click(object sender, RoutedEventArgs e) + { + openOrdnerPfad(text_pfadOrdner2.Text); + } + private void Btn_pfadOrdner3_Click(object sender, RoutedEventArgs e) + { + selctOrdnerPfad(text_pfadOrdner3, "3", bt_Ordner3, lb_Ordner3); + } + + private void Bt_Ordner3_Click(object sender, RoutedEventArgs e) + { + openOrdnerPfad(text_pfadOrdner3.Text); + } + private void Btn_pfadOrdner4_Click(object sender, RoutedEventArgs e) + { + selctOrdnerPfad(text_pfadOrdner4, "4", bt_Ordner4, lb_Ordner4); + } + + private void Bt_Ordner4_Click(object sender, RoutedEventArgs e) + { + openOrdnerPfad(text_pfadOrdner4.Text); + } + private void Btn_pfadOrdner5_Click(object sender, RoutedEventArgs e) + { + selctOrdnerPfad(text_pfadOrdner5, "5", bt_Ordner5, lb_Ordner5); + } + + private void Bt_Ordner5_Click(object sender, RoutedEventArgs e) + { + openOrdnerPfad(text_pfadOrdner5.Text); + } + private void Btn_pfadOrdner6_Click(object sender, RoutedEventArgs e) + { + selctOrdnerPfad(text_pfadOrdner6, "6", bt_Ordner6, lb_Ordner6); + } + + private void Bt_Ordner6_Click(object sender, RoutedEventArgs e) + { + openOrdnerPfad(text_pfadOrdner6.Text); + } + + private void selctOrdnerPfad(TextBox pfad, string no, Button button, Label label) + { + try + { + WinForms.FolderBrowserDialog folderDialog = new WinForms.FolderBrowserDialog(); + folderDialog.ShowNewFolderButton = false; + if (Directory.Exists(pfad.Text)) + { + folderDialog.SelectedPath = pfad.Text; + } + else + { + folderDialog.SelectedPath = Properties.Paths.drive_c; + } + + WinForms.DialogResult result = folderDialog.ShowDialog(); + + if (result == WinForms.DialogResult.OK) + { + pfad.Text = folderDialog.SelectedPath; + setButtonLabel(label, folderDialog.SelectedPath); + Log.Information("Helfer: Konfigurierbarer Ordner " + no + " Pfad {p} wurde ausgewählt.", folderDialog.SelectedPath); + } + + } + catch (Exception ex) + { + Log.Error(ex, "Error"); + } + } + + private void openOrdnerPfad(string pfad) + { + try + { + OpenFileOrFolder(pfad); + } + catch (Exception ex) + { + Log.Error(ex, "Error"); + } + } + + private void setButtonLabel(Label label, string pfad) + { + if (!String.IsNullOrWhiteSpace(pfad)) + { + label.Content = new DirectoryInfo(pfad).Name; + } + } + + + #endregion + } } diff --git a/IEC Mate/Properties/AssemblyInfo.cs b/IEC Mate/Properties/AssemblyInfo.cs index be061cd..79f1ee5 100644 --- a/IEC Mate/Properties/AssemblyInfo.cs +++ b/IEC Mate/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.1622.20088")] -[assembly: AssemblyFileVersion("1.0.1622.20088")] +[assembly: AssemblyVersion("1.0.1645.20088")] +[assembly: AssemblyFileVersion("1.0.1645.20088")] diff --git a/IEC Mate/Properties/Resources.Designer.cs b/IEC Mate/Properties/Resources.Designer.cs index 905a36a..2f0b180 100644 --- a/IEC Mate/Properties/Resources.Designer.cs +++ b/IEC Mate/Properties/Resources.Designer.cs @@ -627,6 +627,15 @@ public static string gb_hotkeys { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Ordner öffnen ähnelt. + /// + public static string gb_ordner { + get { + return ResourceManager.GetString("gb_ordner", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Variablen ähnelt. /// @@ -987,6 +996,15 @@ public static string lb_option { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Kein Ordner ausgewählt ähnelt. + /// + public static string lb_ordner { + get { + return ResourceManager.GetString("lb_ordner", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Open Source Lizenzen: ähnelt. /// @@ -1950,6 +1968,15 @@ public static string wm_file_ext { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Ordner auswählen... ähnelt. + /// + public static string wm_ordner { + get { + return ResourceManager.GetString("wm_ordner", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Skript Name (update_Dataview_simu****.bat) ähnelt. /// diff --git a/IEC Mate/Properties/Resources.de-DE.resx b/IEC Mate/Properties/Resources.de-DE.resx index cea97fd..d7dcdaa 100644 --- a/IEC Mate/Properties/Resources.de-DE.resx +++ b/IEC Mate/Properties/Resources.de-DE.resx @@ -735,6 +735,9 @@ Skript Name (update_Dataview_simu****.bat) + + Ordner öffnen + Prüfsumme @@ -744,10 +747,16 @@ Option + + Kein Ordner ausgewählt + EN_OP_DEVICE neuer Wert (Dezimalzahl) + + Ordner auswählen... + \ No newline at end of file diff --git a/IEC Mate/Properties/Resources.en-GB.resx b/IEC Mate/Properties/Resources.en-GB.resx index 17639b0..2d31b8f 100644 --- a/IEC Mate/Properties/Resources.en-GB.resx +++ b/IEC Mate/Properties/Resources.en-GB.resx @@ -735,6 +735,9 @@ Script Name (update_Dataview_simu****.bat) + + Open folder + Checksum @@ -744,10 +747,16 @@ Option + + No folder selected + EN_OP_DEVICE new value (decimal number) + + Select folder... + \ No newline at end of file diff --git a/IEC Mate/Properties/Resources.resx b/IEC Mate/Properties/Resources.resx index c539ae1..a591884 100644 --- a/IEC Mate/Properties/Resources.resx +++ b/IEC Mate/Properties/Resources.resx @@ -735,6 +735,9 @@ Skript Name (update_Dataview_simu****.bat) + + Ordner öffnen + Prüfsumme @@ -744,10 +747,16 @@ Option + + Kein Ordner ausgewählt + EN_OP_DEVICE neuer Wert (Dezimalzahl) + + Ordner auswählen... + \ No newline at end of file diff --git a/IEC Mate/Properties/Settings.Designer.cs b/IEC Mate/Properties/Settings.Designer.cs index e1ea989..0f2e485 100644 --- a/IEC Mate/Properties/Settings.Designer.cs +++ b/IEC Mate/Properties/Settings.Designer.cs @@ -516,5 +516,77 @@ public string update_bat { this["update_bat"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ordner1 { + get { + return ((string)(this["ordner1"])); + } + set { + this["ordner1"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ordner2 { + get { + return ((string)(this["ordner2"])); + } + set { + this["ordner2"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ordner3 { + get { + return ((string)(this["ordner3"])); + } + set { + this["ordner3"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ordner4 { + get { + return ((string)(this["ordner4"])); + } + set { + this["ordner4"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ordner5 { + get { + return ((string)(this["ordner5"])); + } + set { + this["ordner5"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ordner6 { + get { + return ((string)(this["ordner6"])); + } + set { + this["ordner6"] = value; + } + } } } diff --git a/IEC Mate/Properties/Settings.settings b/IEC Mate/Properties/Settings.settings index 02b3fdb..98b84d8 100644 --- a/IEC Mate/Properties/Settings.settings +++ b/IEC Mate/Properties/Settings.settings @@ -125,5 +125,23 @@ update_Dataview_simu_DB_to_vers_1_2_x_and_this_order.bat + + + + + + + + + + + + + + + + + + \ No newline at end of file