summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-10-13 16:43:14 +0200
committeremkael <emkael@tlen.pl>2019-10-27 14:52:17 +0100
commitae9fddd795e67f3b6129053020fdb15856601285 (patch)
tree564c4b240f0047d01b35b637d7ffb76f5c3db495
parent1d4a0fc3c8ed735cdd9db7df79c66761556c025a (diff)
UI tweaks
-rw-r--r--kurier/Form1.Designer.cs1
-rw-r--r--kurier/Form1.cs28
2 files changed, 29 insertions, 0 deletions
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);
+ }
}
}
}