From a604c2182886d2ce8e8d930546b36289956e4b4f Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Wed, 13 Mar 2013 00:37:10 +0100 Subject: [PATCH] CecTray: display a warning if we can't poll the TV --- src/LibCecTray/Properties/Resources.Designer.cs | 7 ++++++- src/LibCecTray/Properties/Resources.resx | 7 ++++++- src/LibCecTray/controller/CECController.cs | 12 ++++++------ src/LibCecTray/controller/actions/ConnectToDevice.cs | 5 +++++ 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/LibCecTray/Properties/Resources.Designer.cs b/src/LibCecTray/Properties/Resources.Designer.cs index 525ed2d..e43f856 100644 --- a/src/LibCecTray/Properties/Resources.Designer.cs +++ b/src/LibCecTray/Properties/Resources.Designer.cs @@ -340,7 +340,12 @@ namespace LibCECTray.Properties { } /// - /// Looks up a localized string similar to The TV does not respond to polls. This is caused by one of the following: a) the TV does not support CEC, or b) CEC has been disabled in the TV's settings or c) the HDMI cable between the TV and adapter is faulty.. + /// Looks up a localized string similar to The TV does not respond to CEC polls. This is caused by one of the following: + ///a) the TV does not support CEC; + ///b) CEC has been disabled in the TV's settings; + ///c) the HDMI cable between the TV and adapter is faulty. + /// + ///CEC will not work (properly) if the TV does not support CEC, or has CEC disabled in it's settings.. /// internal static string alert_tv_poll_failed { get { diff --git a/src/LibCecTray/Properties/Resources.resx b/src/LibCecTray/Properties/Resources.resx index 6da4722..1daef7c 100644 --- a/src/LibCecTray/Properties/Resources.resx +++ b/src/LibCecTray/Properties/Resources.resx @@ -610,7 +610,12 @@ The device needs servicing. Please download and run the latest firmware upgrade from http://packages.pulse-eight.net/ - The TV does not respond to polls. This is caused by one of the following: a) the TV does not support CEC, or b) CEC has been disabled in the TV's settings or c) the HDMI cable between the TV and adapter is faulty. + The TV does not respond to CEC polls. This is caused by one of the following: +a) the TV does not support CEC; +b) CEC has been disabled in the TV's settings; +c) the HDMI cable between the TV and adapter is faulty. + +CEC will not work (properly) if the TV does not support CEC, or has CEC disabled in it's settings. Warning from libCEC diff --git a/src/LibCecTray/controller/CECController.cs b/src/LibCecTray/controller/CECController.cs index c394c08..6db2267 100644 --- a/src/LibCecTray/controller/CECController.cs +++ b/src/LibCecTray/controller/CECController.cs @@ -372,22 +372,22 @@ namespace LibCECTray.controller switch (alert) { case CecAlert.ServiceDevice: - MessageBox.Show(Resources.alert_service_device, Resources.cec_alert, MessageBoxButtons.OK); + MessageBox.Show(Resources.alert_service_device, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); break; case CecAlert.ConnectionLost: - MessageBox.Show(Resources.alert_connection_lost, Resources.cec_alert, MessageBoxButtons.OK); + MessageBox.Show(Resources.alert_connection_lost, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); break; case CecAlert.PermissionError: - MessageBox.Show(Resources.alert_permission_error, Resources.cec_alert, MessageBoxButtons.OK); + MessageBox.Show(Resources.alert_permission_error, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); break; case CecAlert.PortBusy: - MessageBox.Show(Resources.alert_port_busy, Resources.cec_alert, MessageBoxButtons.OK); + MessageBox.Show(Resources.alert_port_busy, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); break; case CecAlert.PhysicalAddressError: - MessageBox.Show(Resources.alert_physical_address_error, Resources.cec_alert, MessageBoxButtons.OK); + MessageBox.Show(Resources.alert_physical_address_error, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); break; case CecAlert.TVPollFailed: - MessageBox.Show(Resources.alert_tv_poll_failed, Resources.cec_alert, MessageBoxButtons.OK); + MessageBox.Show(Resources.alert_tv_poll_failed, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); break; } return 1; diff --git a/src/LibCecTray/controller/actions/ConnectToDevice.cs b/src/LibCecTray/controller/actions/ConnectToDevice.cs index f2ccfc0..6a832c5 100644 --- a/src/LibCecTray/controller/actions/ConnectToDevice.cs +++ b/src/LibCecTray/controller/actions/ConnectToDevice.cs @@ -108,6 +108,11 @@ namespace LibCECTray.controller.actions SendEvent(UpdateEventType.StatusText, Resources.action_polling_active_devices); SendEvent(UpdateEventType.PollDevices); + if (!_lib.IsActiveDevice(CecLogicalAddress.Tv)) + { + MessageBox.Show(Resources.alert_tv_poll_failed, Resources.cec_alert, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + SendEvent(UpdateEventType.ProgressBar, 100); SendEvent(UpdateEventType.StatusText, Resources.ready); } -- 2.34.1