diff options
author | emkael <emkael@tlen.pl> | 2017-09-19 19:41:20 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-09-19 19:41:20 +0200 |
commit | 9f8e0908356a7ccdf5fac95aed77a77f7ffa047c (patch) | |
tree | e2a48a64c5ed10a4bc3a6c719480b0c3801d6ce0 /Aktywator/MainForm.cs | |
parent | a9f5093df64222395f6b0de21e6afee954c7a9a2 (diff) |
Handling prolonged loading situations in main window UI
Diffstat (limited to 'Aktywator/MainForm.cs')
-rw-r--r-- | Aktywator/MainForm.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Aktywator/MainForm.cs b/Aktywator/MainForm.cs index e254f9a..10fa819 100644 --- a/Aktywator/MainForm.cs +++ b/Aktywator/MainForm.cs @@ -310,6 +310,7 @@ namespace Aktywator private void bMySQLTournament_Click(object sender, EventArgs e) { + startLoading(); try { ChooseTournament choose = new ChooseTournament(); @@ -324,10 +325,12 @@ namespace Aktywator { MessageBox.Show(ee.Message, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Stop); } + stopLoading(); } private void bRRBTournament_Click(object sender, EventArgs e) { + startLoading(); try { OpenFileDialog fDialog = new OpenFileDialog(); @@ -344,6 +347,7 @@ namespace Aktywator { MessageBox.Show(ee.Message, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Stop); } + stopLoading(); } private void updateTournamentInfo(Tournament tournament) @@ -579,5 +583,17 @@ namespace Aktywator { teamNames.ShowDialog(); } + + internal void startLoading() + { + tabControl1.Enabled = false; + this.Cursor = Cursors.WaitCursor; + } + + internal void stopLoading() + { + tabControl1.Enabled = true; + this.Cursor = Cursors.Default; + } } } |