X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FLibCecTray%2Fcontroller%2Factions%2FConnectToDevice.cs;h=e35906a792eaff8645e99eed54c4e4b7cc39642f;hb=103eb041ef46f322b3c374da47feabab6c378004;hp=6a832c5f9096c48b8ce71b1b9181dbfb3cf687a6;hpb=a604c2182886d2ce8e8d930546b36289956e4b4f;p=deb_libcec.git diff --git a/src/LibCecTray/controller/actions/ConnectToDevice.cs b/src/LibCecTray/controller/actions/ConnectToDevice.cs index 6a832c5..e35906a 100644 --- a/src/LibCecTray/controller/actions/ConnectToDevice.cs +++ b/src/LibCecTray/controller/actions/ConnectToDevice.cs @@ -74,9 +74,12 @@ namespace LibCECTray.controller.actions SendEvent(UpdateEventType.StatusText, Resources.action_sending_power_on); _lib.PowerOnDevices(CecLogicalAddress.Broadcast); - SendEvent(UpdateEventType.StatusText, Resources.action_detecting_tv_vendor); - SendEvent(UpdateEventType.ProgressBar, 30); - SendEvent(UpdateEventType.TVVendorId, (int)_lib.GetDeviceVendorId(CecLogicalAddress.Tv)); + if (_lib.IsActiveDevice(CecLogicalAddress.Tv)) + { + SendEvent(UpdateEventType.StatusText, Resources.action_detecting_tv_vendor); + SendEvent(UpdateEventType.ProgressBar, 30); + SendEvent(UpdateEventType.TVVendorId, (int)_lib.GetDeviceVendorId(CecLogicalAddress.Tv)); + } SendEvent(UpdateEventType.ProgressBar, 50); SendEvent(UpdateEventType.StatusText, Resources.action_detecting_avr); @@ -91,7 +94,7 @@ namespace LibCECTray.controller.actions SendEvent(UpdateEventType.AVRVendorId, (int)_lib.GetDeviceVendorId(CecLogicalAddress.AudioSystem)); } - if (!_lib.GetDevicePowerStatus(CecLogicalAddress.Tv).Equals(CecPowerStatus.On)) + if (_lib.IsActiveDevice(CecLogicalAddress.Tv)&& !_lib.GetDevicePowerStatus(CecLogicalAddress.Tv).Equals(CecPowerStatus.On)) { SendEvent(UpdateEventType.ProgressBar, 70); SendEvent(UpdateEventType.StatusText, Resources.action_activating_source); @@ -110,7 +113,7 @@ namespace LibCECTray.controller.actions if (!_lib.IsActiveDevice(CecLogicalAddress.Tv)) { - MessageBox.Show(Resources.alert_tv_poll_failed, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); + MessageBox.Show(Resources.alert_tv_poll_failed, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); } SendEvent(UpdateEventType.ProgressBar, 100);