From 441363100658b3c0c6051da143f67e81c7544bb8 Mon Sep 17 00:00:00 2001 From: John Link Date: Mon, 28 Mar 2016 10:46:58 -0400 Subject: [PATCH 1/2] Added a suggested save file name to the GUI that contains the database name, date, and time. This can be typed over easily but it's nice to have the date/time prepopulated for the user. --- ssdumpGUI/ssdumpGUI.Designer.cs | 2 +- ssdumpGUI/ssdumpGUI.cs | 3 ++- ssdumpGUI/ssdumpGUI.resx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ssdumpGUI/ssdumpGUI.Designer.cs b/ssdumpGUI/ssdumpGUI.Designer.cs index 4a60856..9884d15 100644 --- a/ssdumpGUI/ssdumpGUI.Designer.cs +++ b/ssdumpGUI/ssdumpGUI.Designer.cs @@ -95,7 +95,7 @@ private void InitializeComponent() // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // diff --git a/ssdumpGUI/ssdumpGUI.cs b/ssdumpGUI/ssdumpGUI.cs index 3ae9dc0..f30301c 100644 --- a/ssdumpGUI/ssdumpGUI.cs +++ b/ssdumpGUI/ssdumpGUI.cs @@ -45,6 +45,7 @@ private void btnExecute_Click(object sender, EventArgs e) saveFileDialog1.Filter = "sql files (*.sql)|*.sql|All files(*.*)|*.*"; saveFileDialog1.FilterIndex = 1; saveFileDialog1.RestoreDirectory = true; + saveFileDialog1.FileName = txtDatabase.Text + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss"); if (saveFileDialog1.ShowDialog() == DialogResult.OK) { @@ -57,7 +58,7 @@ private void btnExecute_Click(object sender, EventArgs e) { processor.Execute(); processing.Close(); - MessageBox.Show("SQL Server Dump Complete", "Complete", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); + MessageBox.Show("SQL Server Dump Complete", "Complete", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1); } catch (Exception ex) { diff --git a/ssdumpGUI/ssdumpGUI.resx b/ssdumpGUI/ssdumpGUI.resx index cd6ac4f..e91d848 100644 --- a/ssdumpGUI/ssdumpGUI.resx +++ b/ssdumpGUI/ssdumpGUI.resx @@ -127,6 +127,6 @@ True - 48 + 113 \ No newline at end of file From 11b2ecaa99ae78c85e6c37555cb1c6aa59a1b4b2 Mon Sep 17 00:00:00 2001 From: John Link Date: Mon, 28 Mar 2016 11:50:14 -0400 Subject: [PATCH 2/2] Changed the host drop down from a locked list to one the user can type into and save previously used hosts. The list can still be edited like before. --- ssdumpGUI/ssdumpGUI.Designer.cs | 3 +-- ssdumpGUI/ssdumpGUI.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ssdumpGUI/ssdumpGUI.Designer.cs b/ssdumpGUI/ssdumpGUI.Designer.cs index 4a60856..c5fc7c7 100644 --- a/ssdumpGUI/ssdumpGUI.Designer.cs +++ b/ssdumpGUI/ssdumpGUI.Designer.cs @@ -95,7 +95,7 @@ private void InitializeComponent() // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // @@ -127,7 +127,6 @@ private void InitializeComponent() // // cboHostList // - this.cboHostList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboHostList.FormattingEnabled = true; this.cboHostList.Location = new System.Drawing.Point(157, 3); this.cboHostList.Name = "cboHostList"; diff --git a/ssdumpGUI/ssdumpGUI.cs b/ssdumpGUI/ssdumpGUI.cs index 3ae9dc0..c001cb7 100644 --- a/ssdumpGUI/ssdumpGUI.cs +++ b/ssdumpGUI/ssdumpGUI.cs @@ -42,6 +42,18 @@ private void exitToolStripMenuItem_Click(object sender, EventArgs e) private void btnExecute_Click(object sender, EventArgs e) { + string NewHostName = cboHostList.Text; + + if (!Properties.Settings.Default.Hosts.Contains(NewHostName)) + { + int NewSelectionIndex = Properties.Settings.Default.Hosts.Count; + Properties.Settings.Default.Hosts.Add(NewHostName); + Properties.Settings.Default.Save(); + cboHostList.DataSource = null; + cboHostList.DataSource = Properties.Settings.Default.Hosts; + cboHostList.SelectedIndex = NewSelectionIndex; + } + saveFileDialog1.Filter = "sql files (*.sql)|*.sql|All files(*.*)|*.*"; saveFileDialog1.FilterIndex = 1; saveFileDialog1.RestoreDirectory = true;