X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcec-config-gui%2FCecConfigGUI.cs;h=5004e041024dfa77eac9913bfbc49a6fd09b4482;hb=1ea419fa5dcfa91666239d6ff86520605f95ba51;hp=06e66018ff2feee19c3a48f89dde97376ebc7b52;hpb=959712c603a6c40b551e6bc801b14a7540bdc69f;p=deb_libcec.git
diff --git a/src/cec-config-gui/CecConfigGUI.cs b/src/cec-config-gui/CecConfigGUI.cs
index 06e6601..5004e04 100644
--- a/src/cec-config-gui/CecConfigGUI.cs
+++ b/src/cec-config-gui/CecConfigGUI.cs
@@ -326,7 +326,8 @@ namespace CecConfigGui
{
SetControlEnabled(cbPortNumber, val && !Config.AutodetectAddress);
SetControlEnabled(cbConnectedDevice, cbConnectedDevice.Items.Count > 1 && !Config.AutodetectAddress ? val : false);
- SetControlEnabled(tbPhysicalAddress, val && !Config.AutodetectAddress);
+ SetControlEnabled(cbOverrideAddress, val);
+ SetControlEnabled(tbPhysicalAddress, val && !Config.AutodetectAddress && cbOverrideAddress.Checked);
SetControlEnabled(cbDeviceType, val);
SetControlEnabled(cbUseTVMenuLanguage, val);
SetControlEnabled(cbActivateSource, val);
@@ -413,7 +414,7 @@ namespace CecConfigGui
public void SetPhysicalAddress(ushort physicalAddress)
{
- if (!SuppressUpdates && ActiveProcess == null)
+ if (!SuppressUpdates && ActiveProcess == null && cbOverrideAddress.Checked)
{
SetControlsEnabled(false);
SetControlText(cbPortNumber, string.Empty);
@@ -481,9 +482,15 @@ namespace CecConfigGui
#endregion
#region Configuration tab
+ private void cbOverrideAddress_CheckedChanged(object sender, EventArgs e)
+ {
+ SetControlEnabled(tbPhysicalAddress, ((CheckBox)sender).Checked);
+ }
+
private void tbPhysicalAddress_TextChanged(object sender, EventArgs e)
{
- if (tbPhysicalAddress.Text.Length != 4)
+ if (tbPhysicalAddress.Text.Length != 4 ||
+ cbOverrideAddress.Checked)
return;
ushort physicalAddress = 0;
if (!ushort.TryParse(tbPhysicalAddress.Text, NumberStyles.AllowHexSpecifier, null, out physicalAddress))
@@ -583,20 +590,24 @@ namespace CecConfigGui
// only supported by 1.5.0+ clients
output.AppendLine("");
output.AppendLine("");
- output.AppendLine("");
+ output.AppendLine("");
output.AppendLine("");
output.AppendLine("");
output.Append("");
output.Append("");
output.AppendLine("");