From 56019680a0ab1de0c95cc7570470e6d4bdcf4186 Mon Sep 17 00:00:00 2001 From: fffonion Date: Thu, 13 Mar 2014 15:57:04 +0800 Subject: [PATCH] bugfix --- frmConfig.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frmConfig.cs b/frmConfig.cs index 430fec2..1629166 100644 --- a/frmConfig.cs +++ b/frmConfig.cs @@ -118,7 +118,12 @@ private void refreshAll() chkUsePlugins.Checked = cf.ReadBool("system", "enable_plugin"); chkAllowLongSleep.Checked = cf.ReadBool("system", "allow_long_sleep"); txtReconnectGap.Text = cf.Read("system", "reconnect_gap"); - if (new Regex(@"\d+\:\d+", RegexOptions.Compiled).IsMatch(txtReconnectGap.Text)) + if (txtReconnectGap.Text == "") + { + txtReconnectGap.Text = "0"; + cboReconnectGapIndicator.SelectedIndex = 0; + } + else if (new Regex(@"\d+\:\d+", RegexOptions.Compiled).IsMatch(txtReconnectGap.Text)) cboReconnectGapIndicator.SelectedIndex = 2; else if (txtReconnectGap.Text == "0") cboReconnectGapIndicator.SelectedIndex = 0; @@ -1901,7 +1906,10 @@ private void txtReconnectGap_TextChanged(object sender, EventArgs e) private void cboReconnectGapIndicator_SelectedIndexChanged(object sender, EventArgs e) { if (cboReconnectGapIndicator.SelectedIndex == 0) - txtReconnectGap.Enabled=false; + { + txtReconnectGap.Enabled = false; + txtReconnectGap.Text = "0"; + } else txtReconnectGap.Enabled = true; txtReconnectGap_TextChanged(sender, e);