cec-config-gui: fixed application exit when the user clicked 'no' when asked to recon...
authorLars Op den Kamp <lars@opdenkamp.eu>
Wed, 14 Mar 2012 10:42:24 +0000 (11:42 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Wed, 14 Mar 2012 10:42:24 +0000 (11:42 +0100)
src/cec-config-gui/CecConfigGUI.cs
src/cec-config-gui/actions/ConnectToDevice.cs
src/cec-config-gui/actions/UpdateEvent.cs

index 94ce2ad5a016212f4897d41c74c4c4457fc13d2e..adc02e86e022648c8d1db34d961c2b8f1afcdee1 100644 (file)
@@ -321,6 +321,12 @@ namespace CecConfigGui
           }
           SetControlVisible(pProgress, false);
           break;
+        case UpdateEventType.ExitApplication:
+          ActiveProcess = null;
+          SetControlsEnabled(false);
+          SetControlVisible(pProgress, false);
+          Application.Exit();
+          break;
       }
     }
 
index fedc31398e700c7721b9bb89f7f91ec77f51424a..8c198f4c60a20f86042aada349c0c0618ca81118 100644 (file)
@@ -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);
index a7e2df6bbb2227e83aea53d9692f87dc1c517941..4a3e701a9099c91fbaa46fc24128593fa8f14231 100644 (file)
@@ -17,7 +17,8 @@ namespace CecConfigGui
     AVRVendorId,
     Configuration,
     MenuLanguage,
-    PollDevices
+    PollDevices,
+    ExitApplication
   }
 
   public class UpdateEvent : EventArgs