[longomatch] Only fill the devices list once



commit ccba8e33eeef00cbbf058011a6ee81ef9d020b4d
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Apr 23 13:47:38 2015 +0200

    Only fill the devices list once

 LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
index a6f2fb7..43f1f49 100644
--- a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
@@ -504,11 +504,14 @@ namespace LongoMatch.Gui.Panel
                        if (sender == filebutton) {
                                projectType = ProjectType.FileProject;
                        } else if (sender == capturebutton) {
-                               FillDevices (mtoolkit.VideoDevices);
-                               if (videoDevices == null || videoDevices.Count == 0) {
-                                       Config.GUIToolkit.ErrorMessage (Catalog.GetString ("No capture 
devices found in the system"),
-                                               this);
-                                       return;
+                               /* Only fill devices once */
+                               if (videoDevices == null) {
+                                       FillDevices (mtoolkit.VideoDevices);
+                                       if (videoDevices == null || videoDevices.Count == 0) {
+                                               Config.GUIToolkit.ErrorMessage (Catalog.GetString ("No 
capture devices found in the system"),
+                                                       this);
+                                               return;
+                                       }
                                }
                                projectType = ProjectType.CaptureProject;
                        } else if (sender == fakebutton) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]