From f0366782867de119d5133f18746adb58a26a0ddc Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 23 Oct 2018 19:03:04 +0200 Subject: UI improvements of blocking hand records with insecure PINs --- Aktywator/MainForm.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Aktywator/MainForm.cs') diff --git a/Aktywator/MainForm.cs b/Aktywator/MainForm.cs index 2752b31..6144a28 100644 --- a/Aktywator/MainForm.cs +++ b/Aktywator/MainForm.cs @@ -686,17 +686,21 @@ namespace Aktywator if (Array.IndexOf(unsafePINs, Int32.Parse(pin)) > -1) { this.lPINWarning.Visible = true; + this.tpRecords.Enabled = false; + this.tpRecords.ImageIndex = 3; + this.tpRecords.ToolTipText = "Wczytanie rozkładów przy przewidywalnym PINie jest niedozwolone."; if (explicitWarning) { MessageBox.Show("Próbujesz ustawić PIN, który jest łatwy do przewidzenia przez zawodników.\n\nMam nadzieję, że wiesz, co robisz!\n\nNiestety, nie możemy pozwolić Ci na wgranie do BWSa rozkładów.", "Przewidywalny PIN!", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.bws.clearHandRecords(); - this.tabControl1.TabPages[2].Enabled = false; } } else { this.lPINWarning.Visible = false; - this.tabControl1.TabPages[2].Enabled = true; + this.tpRecords.Enabled = true; + this.tpRecords.ImageIndex = 2; + this.tpRecords.ToolTipText = ""; } } catch (FormatException e) @@ -718,5 +722,13 @@ namespace Aktywator { this.xPINcode.Text = this.bws._getRandomPIN(); } + + private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e) + { + if (!e.TabPage.Enabled) + { + e.Cancel = true; + } + } } } -- cgit v1.2.3