From: Lars Op den Kamp Date: Wed, 14 Mar 2012 10:42:24 +0000 (+0100) Subject: cec-config-gui: fixed application exit when the user clicked 'no' when asked to recon... X-Git-Tag: upstream/2.2.0~1^2~31^2~78 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e23f490fdd949351aefebfdbfa981047357e4ac4;p=deb_libcec.git cec-config-gui: fixed application exit when the user clicked 'no' when asked to reconnect. bugzid: 556 --- diff --git a/src/cec-config-gui/CecConfigGUI.cs b/src/cec-config-gui/CecConfigGUI.cs index 94ce2ad..adc02e8 100644 --- a/src/cec-config-gui/CecConfigGUI.cs +++ b/src/cec-config-gui/CecConfigGUI.cs @@ -321,6 +321,12 @@ namespace CecConfigGui } SetControlVisible(pProgress, false); break; + case UpdateEventType.ExitApplication: + ActiveProcess = null; + SetControlsEnabled(false); + SetControlVisible(pProgress, false); + Application.Exit(); + break; } } diff --git a/src/cec-config-gui/actions/ConnectToDevice.cs b/src/cec-config-gui/actions/ConnectToDevice.cs index fedc313..8c198f4 100644 --- a/src/cec-config-gui/actions/ConnectToDevice.cs +++ b/src/cec-config-gui/actions/ConnectToDevice.cs @@ -22,7 +22,10 @@ namespace CecConfigGui.actions { DialogResult result = MessageBox.Show("Could not detect to any CEC adapter. Please check your configuration. Do you want to try again?", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.YesNo); if (result == DialogResult.No) - Application.Exit(); + { + SendEvent(UpdateEventType.ExitApplication); + return; + } else adapters = Lib.FindAdapters(string.Empty); } @@ -31,7 +34,10 @@ namespace CecConfigGui.actions { DialogResult result = MessageBox.Show("Could not connect to any CEC adapter. Please check your configuration. Do you want to try again?", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.YesNo); if (result == DialogResult.No) - Application.Exit(); + { + SendEvent(UpdateEventType.ExitApplication); + return; + } } SendEvent(UpdateEventType.ProgressBar, 20); diff --git a/src/cec-config-gui/actions/UpdateEvent.cs b/src/cec-config-gui/actions/UpdateEvent.cs index a7e2df6..4a3e701 100644 --- a/src/cec-config-gui/actions/UpdateEvent.cs +++ b/src/cec-config-gui/actions/UpdateEvent.cs @@ -17,7 +17,8 @@ namespace CecConfigGui AVRVendorId, Configuration, MenuLanguage, - PollDevices + PollDevices, + ExitApplication } public class UpdateEvent : EventArgs