From ae9fddd795e67f3b6129053020fdb15856601285 Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 13 Oct 2018 16:43:14 +0200 Subject: UI tweaks --- kurier/Form1.Designer.cs | 1 + kurier/Form1.cs | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'kurier') diff --git a/kurier/Form1.Designer.cs b/kurier/Form1.Designer.cs index c9a2934..64fed6b 100644 --- a/kurier/Form1.Designer.cs +++ b/kurier/Form1.Designer.cs @@ -74,6 +74,7 @@ this.tBucketID.Name = "tBucketID"; this.tBucketID.Size = new System.Drawing.Size(138, 20); this.tBucketID.TabIndex = 3; + this.tBucketID.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBucketID_KeyPress); // // bExit // diff --git a/kurier/Form1.cs b/kurier/Form1.cs index 86754e5..7053fee 100644 --- a/kurier/Form1.cs +++ b/kurier/Form1.cs @@ -25,6 +25,10 @@ namespace kurier private void cSend_CheckedChanged(object sender, EventArgs e) { this.tBucketID.Enabled = this.cSend.Checked; + if (this.cSend.Checked) + { + this.tBucketID.Focus(); + } } private void Form1_Load(object sender, EventArgs e) @@ -55,6 +59,8 @@ namespace kurier private void bSave_Click(object sender, EventArgs e) { + this.Enabled = false; + Cursor.Current = Cursors.WaitCursor; FolderBrowserDialog fd = new FolderBrowserDialog(); if (fd.ShowDialog() == DialogResult.OK) { @@ -65,12 +71,34 @@ namespace kurier c.backup(filePath); c.close(); MessageBox.Show("Wyeksportowano pomyślnie do pliku: " + filePath, "Sukces eksportu!", MessageBoxButtons.OK, MessageBoxIcon.Information); + if (cSend.Checked) { + if (tBucketID.Text.Length > 0) + { + S3 s3Client = new S3(); + s3Client.send(this.tBucketID.Text, filePath, this.cbDatabaseName.SelectedItem.ToString() + ".sql"); + MessageBox.Show("Wysłano Zimnemu!", "Sukces eksportu!", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + MessageBox.Show("Nie wpisałeś ID do wysłania Zimnemu!", "Błąd eksportu!", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } } catch (Exception ex) { MessageBox.Show(ex.Message, "Błąd eksportu!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } + this.Enabled = true; + Cursor.Current = Cursors.Default; + } + + private void tBucketID_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == (char)Keys.Return) + { + this.bSave_Click(null, null); + } } } } -- cgit v1.2.3