diff options
author | emkael <emkael@tlen.pl> | 2018-10-13 16:43:14 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-10-27 14:52:17 +0100 |
commit | ae9fddd795e67f3b6129053020fdb15856601285 (patch) | |
tree | 564c4b240f0047d01b35b637d7ffb76f5c3db495 /kurier/Form1.cs | |
parent | 1d4a0fc3c8ed735cdd9db7df79c66761556c025a (diff) |
UI tweaks
Diffstat (limited to 'kurier/Form1.cs')
-rw-r--r-- | kurier/Form1.cs | 28 |
1 files changed, 28 insertions, 0 deletions
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); + } } } } |