[pitivi: 1/2] ui/sourcelist: catch the error of addUris(files) if file is already imported into the sourcelist of



commit 0c14c4115fa4451b1769cf54fb3aacd80d7cb6a0
Author: Luis de Bethencourt <luis debethencourt com>
Date:   Wed Sep 22 17:04:43 2010 +0200

    ui/sourcelist: catch the error of addUris(files) if file is already imported into the sourcelist of the project.

 pitivi/ui/sourcelist.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/ui/sourcelist.py b/pitivi/ui/sourcelist.py
index 7c3400f..750de0b 100644
--- a/pitivi/ui/sourcelist.py
+++ b/pitivi/ui/sourcelist.py
@@ -464,7 +464,11 @@ class SourceList(gtk.VBox, Loggable):
 
     def addUris(self, files):
         """ Add files to the list """
-        self.app.current.sources.addUris(files)
+        try:
+            self.app.current.sources.addUris(files)
+        except SourceListError as error:
+            disclaimer, uri = error.args
+            self.error("'%s' is already present in the source list." + uri)
 
     def addFolders(self, folders):
         """ walks the trees of the folders in the list and adds the files it finds """



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