cec-config-gui: open the connection in the background thread
[deb_libcec.git] / src / cec-config-gui / CecConfigGUI.cs
index 943ca2e75fc14ef2bb19aa9706d9178b660fa629..b2b6c557038bd60a531073155863e55370363e2a 100644 (file)
@@ -39,14 +39,6 @@ namespace CecConfigGui
       InitializeComponent();
       LoadButtonConfiguration();
 
-      //TODO read the com port setting from the configuration
-      CecAdapter[] adapters = Lib.FindAdapters(string.Empty);
-      if (adapters.Length == 0 || !Lib.Open(adapters[0].ComPort, 10000))
-      {
-        MessageBox.Show("Could not connect to any CEC adapter. Please check your configuration and try again.", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK);
-        Application.Exit();
-      }
-
       ActiveProcess = new ConnectToDevice(ref Lib, Config);
       ActiveProcess.EventHandler += new EventHandler<UpdateEvent>(ProcessEventHandler);
       (new Thread(new ThreadStart(ActiveProcess.Run))).Start();
@@ -993,7 +985,7 @@ namespace CecConfigGui
     protected LibCecSharp Lib;
     private CecCallbackWrapper Callbacks;
     private UpdateProcess ActiveProcess = null;
-    private bool SuppressUpdates = false;
+    private bool SuppressUpdates = true;
     private ConfigTab SelectedTab = ConfigTab.Configuration;
     private string Log = string.Empty;
     #endregion