summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spedytor/Form1.Designer.cs2
-rw-r--r--spedytor/Form1.cs18
-rw-r--r--spedytor/MysqlSettings.cs2
3 files changed, 16 insertions, 6 deletions
diff --git a/spedytor/Form1.Designer.cs b/spedytor/Form1.Designer.cs
index d504306..32913cc 100644
--- a/spedytor/Form1.Designer.cs
+++ b/spedytor/Form1.Designer.cs
@@ -255,7 +255,7 @@
this.Name = "Form1";
this.Text = "Spedytor";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
- this.Load += new System.EventHandler(this.Form1_Load);
+ this.Shown += new System.EventHandler(this.Form1_Shown);
this.Resize += new System.EventHandler(this.Form1_Resize);
((System.ComponentModel.ISupportInitialize)(this.nInterval)).EndInit();
this.contextMenuStrip.ResumeLayout(false);
diff --git a/spedytor/Form1.cs b/spedytor/Form1.cs
index ce82b80..4448d8e 100644
--- a/spedytor/Form1.cs
+++ b/spedytor/Form1.cs
@@ -44,10 +44,17 @@ namespace spedytor
this.Dispose();
}
- private void Form1_Load(object sender, EventArgs e)
+ private void Form1_Shown(object sender, EventArgs e)
{
- if (!MySQL.getConfigured()) (new MysqlSettings()).ShowDialog();
- if (!MySQL.getConfigured()) this.Dispose();
+ if (!MySQL.getConfigured())
+ {
+ (new MysqlSettings()).ShowDialog();
+ }
+ if (!MySQL.getConfigured())
+ {
+ this.Dispose();
+ return;
+ }
this.restoreSettings();
this.refreshDatabaseList();
this.checkS3Options();
@@ -387,7 +394,10 @@ namespace spedytor
private void restoreSettings()
{
- this.setSelectedDBs(Properties.OptionSettings.Default.DB_NAMES.Cast<string>().ToList());
+ if (Properties.OptionSettings.Default.DB_NAMES != null)
+ {
+ this.setSelectedDBs(Properties.OptionSettings.Default.DB_NAMES.Cast<string>().ToList());
+ }
this.cSend.Checked = Properties.OptionSettings.Default.SEND_FLAG;
this.nInterval.Value = Properties.OptionSettings.Default.RUN_INTERVAL;
}
diff --git a/spedytor/MysqlSettings.cs b/spedytor/MysqlSettings.cs
index bce4f01..af7c636 100644
--- a/spedytor/MysqlSettings.cs
+++ b/spedytor/MysqlSettings.cs
@@ -63,7 +63,7 @@ namespace spedytor
{
Properties.Settings.Default.CONFIGURED = true;
Properties.Settings.Default.Save();
- Close();
+ Dispose();
}
else
{