From c94ddd514fb44f50c82cad8f8684d72805522bb6 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 22 Aug 2017 20:38:11 +0200 Subject: Adding property flag set on first MySQL configuration save --- Aktywator/Properties/Settings.Designer.cs | 14 +++++++++++++- Aktywator/Properties/Settings.settings | 3 +++ Aktywator/app.config | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Aktywator/Properties/Settings.Designer.cs b/Aktywator/Properties/Settings.Designer.cs index b099227..b5c16ed 100644 --- a/Aktywator/Properties/Settings.Designer.cs +++ b/Aktywator/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.225 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -70,5 +70,17 @@ namespace Aktywator.Properties { this["PORT"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool CONFIGURED { + get { + return ((bool)(this["CONFIGURED"])); + } + set { + this["CONFIGURED"] = value; + } + } } } diff --git a/Aktywator/Properties/Settings.settings b/Aktywator/Properties/Settings.settings index 76a000d..7dbc1ee 100644 --- a/Aktywator/Properties/Settings.settings +++ b/Aktywator/Properties/Settings.settings @@ -14,5 +14,8 @@ 3306 + + False + \ No newline at end of file diff --git a/Aktywator/app.config b/Aktywator/app.config index 7473011..f8dd4d2 100644 --- a/Aktywator/app.config +++ b/Aktywator/app.config @@ -19,6 +19,9 @@ 3306 + + False + \ No newline at end of file -- cgit v1.2.3 From 4d4d518a2a029603bcc9ec3488c12a185999d314 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 22 Aug 2017 20:38:50 +0200 Subject: Displaying MySQL configuration on start-up only if MySQL has not been configured, regardless of password-less accounts Fixes #14 --- Aktywator/MainForm.cs | 2 +- Aktywator/MySQL.cs | 1 + Aktywator/MysqlSettings.cs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Aktywator/MainForm.cs b/Aktywator/MainForm.cs index 85ec29f..25268b6 100644 --- a/Aktywator/MainForm.cs +++ b/Aktywator/MainForm.cs @@ -31,7 +31,7 @@ namespace Aktywator private void MainForm_Load(object sender, EventArgs e) { - if (MySQL.getPass() == "") (new MysqlSettings()).ShowDialog(); + if (!MySQL.getConfigured()) (new MysqlSettings()).ShowDialog(); } private void MainForm_Shown(object sender, EventArgs e) diff --git a/Aktywator/MySQL.cs b/Aktywator/MySQL.cs index 29b90b5..a4d19c2 100644 --- a/Aktywator/MySQL.cs +++ b/Aktywator/MySQL.cs @@ -86,5 +86,6 @@ namespace Aktywator public static string getUser() { return Properties.Settings.Default.USER; } public static string getPass() { return Properties.Settings.Default.PASS; } public static string getPort() { return Properties.Settings.Default.PORT; } + public static bool getConfigured() { return Properties.Settings.Default.CONFIGURED; } } } diff --git a/Aktywator/MysqlSettings.cs b/Aktywator/MysqlSettings.cs index df2fb15..ac46470 100644 --- a/Aktywator/MysqlSettings.cs +++ b/Aktywator/MysqlSettings.cs @@ -29,6 +29,7 @@ namespace Aktywator Properties.Settings.Default.USER = eUser.Text; Properties.Settings.Default.PASS = ePass.Text; Properties.Settings.Default.PORT = ePort.Text; + Properties.Settings.Default.CONFIGURED = true; Properties.Settings.Default.Save(); string msg = MySQL.test(); -- cgit v1.2.3 From 59197aac15252d8d2afdbb12c3893b880fa4a107 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 22 Aug 2017 20:41:09 +0200 Subject: Save settings and mark them as set only if the settings actually work --- Aktywator/MysqlSettings.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Aktywator/MysqlSettings.cs b/Aktywator/MysqlSettings.cs index ac46470..c6f1b8c 100644 --- a/Aktywator/MysqlSettings.cs +++ b/Aktywator/MysqlSettings.cs @@ -29,12 +29,18 @@ namespace Aktywator Properties.Settings.Default.USER = eUser.Text; Properties.Settings.Default.PASS = ePass.Text; Properties.Settings.Default.PORT = ePort.Text; - Properties.Settings.Default.CONFIGURED = true; - Properties.Settings.Default.Save(); string msg = MySQL.test(); - if (msg == "") Close(); - else MessageBox.Show(msg, "Nieprawidłowe ustawienia", MessageBoxButtons.OK, MessageBoxIcon.Stop); + if (msg == "") + { + Properties.Settings.Default.CONFIGURED = true; + Properties.Settings.Default.Save(); + Close(); + } + else + { + MessageBox.Show(msg, "Nieprawidłowe ustawienia", MessageBoxButtons.OK, MessageBoxIcon.Stop); + } } } } -- cgit v1.2.3 From dff9977d85ed30c038c7db4ba14a6a6239f377ed Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 22 Aug 2017 20:46:03 +0200 Subject: Changelog updated --- Aktywator.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Aktywator.txt b/Aktywator.txt index 5dab1d0..e3ef305 100644 --- a/Aktywator.txt +++ b/Aktywator.txt @@ -5,6 +5,7 @@ Aktywator 1.1.0 (beta) 30.07.2017 [mkl] * wczytywanie nazwisk z plików RRBridge + * zapamiętywanie ustawień MySQL również dla bezhasłowych kont --------------------- Aktywator 1.0.8 -- cgit v1.2.3