[longomatch] Contiune parsing files even with errors



commit 7f5e12fef9c3d6cf103431f23069f150eb11a986
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Mar 27 03:23:27 2013 +0100

    Contiune parsing files even with errors

 LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs 
b/LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs
index 523ce82..fb37e37 100644
--- a/LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs
+++ b/LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs
@@ -72,14 +72,22 @@ namespace LongoMatch.Gui.Dialog
                {
                        List<string> paths = GUIToolkit.Instance.OpenFiles (Catalog.GetString("Add file"), 
null,
                                                                            Config.HomeDir(), null, null);
-                       try {
-                               foreach (string path in paths) {
+                       List<string> errors = new List<string>();
+                       foreach (string path in paths) {
+                               try {
                                        MediaFile file = PreviewMediaFile.DiscoverFile(path);
                                        store.AppendValues (file);
                                        Files.Add (file);
+                               } catch (Exception) {
+                                       errors.Add (path);
                                }
-                       } catch (Exception ex) {
-                               GUIToolkit.Instance.ErrorMessage (ex.Message);
+                       }
+                       if (errors.Count != 0) {
+                               string s = Catalog.GetString("Error adding files:");
+                               foreach (string p in errors) {
+                                       s += '\n' + p;
+                               }
+                               GUIToolkit.Instance.ErrorMessage (s);
                        }
                        CheckStatus ();
                }


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