cec-config-gui: set cbPortNumber enabled when the physical address override isn't...
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 28 Feb 2012 01:08:14 +0000 (02:08 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 28 Feb 2012 01:13:47 +0000 (02:13 +0100)
src/cec-config-gui/CecConfigGUI.cs

index 2f9b38903b5b24eb740c6cfb2bdfaafd6c3df025..b404fbd4eb48b59b3c2f16f9dcd49cbcc75ed505 100644 (file)
@@ -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)