summaryrefslogtreecommitdiff
path: root/Aktywator
diff options
context:
space:
mode:
Diffstat (limited to 'Aktywator')
-rw-r--r--Aktywator/MainForm.cs2
-rw-r--r--Aktywator/MySQL.cs1
-rw-r--r--Aktywator/MysqlSettings.cs13
-rw-r--r--Aktywator/Properties/Settings.Designer.cs14
-rw-r--r--Aktywator/Properties/Settings.settings3
-rw-r--r--Aktywator/app.config3
6 files changed, 31 insertions, 5 deletions
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..c6f1b8c 100644
--- a/Aktywator/MysqlSettings.cs
+++ b/Aktywator/MysqlSettings.cs
@@ -29,11 +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.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);
+ }
}
}
}
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 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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 @@
<Setting Name="PORT" Type="System.String" Scope="User">
<Value Profile="(Default)">3306</Value>
</Setting>
+ <Setting Name="CONFIGURED" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
</Settings>
</SettingsFile> \ 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 @@
<setting name="PORT" serializeAs="String">
<value>3306</value>
</setting>
+ <setting name="CONFIGURED" serializeAs="String">
+ <value>False</value>
+ </setting>
</Aktywator.Properties.Settings>
</userSettings>
</configuration> \ No newline at end of file