+ private void SetControlsEnabled(bool val)
+ {
+ SetControlEnabled(cbPortNumber, val && !Config.AutodetectAddress);
+ SetControlEnabled(cbConnectedDevice, cbConnectedDevice.Items.Count > 1 && !Config.AutodetectAddress ? val : false);
+ SetControlEnabled(cbOverrideAddress, val);
+ SetControlEnabled(tbPhysicalAddress, val && !Config.AutodetectAddress && cbOverrideAddress.Checked);
+ SetControlEnabled(cbDeviceType, val);
+ SetControlEnabled(cbUseTVMenuLanguage, val);
+ SetControlEnabled(cbActivateSource, val);
+ SetControlEnabled(cbPowerOffScreensaver, val);
+ SetControlEnabled(cbPowerOffOnStandby, val);
+ SetControlEnabled(cbWakeDevices, val);
+ SetControlEnabled(cbPowerOffDevices, val);
+ SetControlEnabled(cbVendorOverride, val);
+ SetControlEnabled(cbVendorId, val && cbVendorOverride.Checked);
+ SetControlEnabled(bClose, val);
+ SetControlEnabled(bSaveConfig, val);
+ SetControlEnabled(bReloadConfig, val);
+ SetControlEnabled(bRescanDevices, val);
+
+ SetControlEnabled(bSendImageViewOn, val);
+ SetControlEnabled(bStandby, val);
+ SetControlEnabled(bActivateSource, val);
+ SetControlEnabled(bScan, val);
+
+ bool enableVolumeButtons = (GetTargetDevice() == CecLogicalAddress.AudioSystem) && val;
+ SetControlEnabled(bVolUp, enableVolumeButtons);
+ SetControlEnabled(bVolDown, enableVolumeButtons);
+ SetControlEnabled(bMute, enableVolumeButtons);
+ }
+
+ private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ switch (tabControl1.SelectedIndex)
+ {
+ case 0:
+ SelectedTab = ConfigTab.Configuration;
+ break;
+ case 1:
+ SelectedTab = ConfigTab.KeyConfiguration;
+ break;
+ case 2:
+ SelectedTab = ConfigTab.Tester;
+ break;
+ case 3:
+ SelectedTab = ConfigTab.Log;
+ UpdateLog();
+ break;
+ default:
+ SelectedTab = ConfigTab.Configuration;
+ break;
+ }
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ Lib.DisableCallbacks();
+ Lib.StandbyDevices(CecLogicalAddress.Broadcast);
+ Lib.Close();
+ }
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Actions
+ public void ReloadXMLConfiguration()
+ {
+ LoadXMLConfiguration(ref Config);
+ Lib.SetConfiguration(Config);
+ ConfigurationChanged(Config);
+ }
+
+ public void UpdateInfoPanel(DeviceInformation panel)