X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcec-config-gui%2FCecConfigGUI.cs;h=5004e041024dfa77eac9913bfbc49a6fd09b4482;hb=f916b582a00b685f0c6b29f8567f703492af2f76;hp=e3decec7fe03ef9907b602182cc21f214f52136b;hpb=3efda01ac7b070e09012a5725112eb44c17001b4;p=deb_libcec.git diff --git a/src/cec-config-gui/CecConfigGUI.cs b/src/cec-config-gui/CecConfigGUI.cs index e3decec..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)) @@ -571,7 +578,7 @@ namespace CecConfigGui StringBuilder output = new StringBuilder(); output.AppendLine(""); output.AppendLine(""); - output.AppendLine(""); + output.AppendLine(""); output.AppendLine(""); output.AppendLine(""); output.AppendLine(""); @@ -582,20 +589,25 @@ 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("");