From: Lars Op den Kamp Date: Tue, 28 Feb 2012 01:08:14 +0000 (+0100) Subject: cec-config-gui: set cbPortNumber enabled when the physical address override isn't... X-Git-Tag: upstream/2.2.0~1^2~33^2~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b113b95ac84c2dd99d82ecc7c8dfbc296209bf23;p=deb_libcec.git cec-config-gui: set cbPortNumber enabled when the physical address override isn't checked instead --- diff --git a/src/cec-config-gui/CecConfigGUI.cs b/src/cec-config-gui/CecConfigGUI.cs index 2f9b389..b404fbd 100644 --- a/src/cec-config-gui/CecConfigGUI.cs +++ b/src/cec-config-gui/CecConfigGUI.cs @@ -322,8 +322,8 @@ namespace CecConfigGui private void SetControlsEnabled(bool val) { - SetControlEnabled(cbPortNumber, val && !Config.AutodetectAddress && Config.PhysicalAddress != 0); - SetControlEnabled(cbConnectedDevice, cbConnectedDevice.Items.Count > 1 && !Config.AutodetectAddress && val); + SetControlEnabled(cbPortNumber, val && !cbOverrideAddress.Checked); + SetControlEnabled(cbConnectedDevice, cbConnectedDevice.Items.Count > 1 && !cbOverrideAddress.Checked && val); SetControlEnabled(cbOverrideAddress, val); SetControlEnabled(tbPhysicalAddress, val && !Config.AutodetectAddress && cbOverrideAddress.Checked); SetControlEnabled(cbDeviceType, val); @@ -483,6 +483,8 @@ namespace CecConfigGui private void cbOverrideAddress_CheckedChanged(object sender, EventArgs e) { SetControlEnabled(tbPhysicalAddress, ((CheckBox)sender).Checked); + SetControlEnabled(cbPortNumber, !((CheckBox)sender).Checked); + SetControlEnabled(cbConnectedDevice, !((CheckBox)sender).Checked && cbConnectedDevice.Items.Count > 1); } private void tbPhysicalAddress_TextChanged(object sender, EventArgs e)