[pitivi: 3/18] filelisterrordialog.py: some small tweaks to make dialog more generic



commit c3a20c809564063c2b5f3e6bb570792ded1b9ed8
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date:   Fri Dec 4 14:50:40 2009 -0800

    filelisterrordialog.py: some small tweaks to make dialog more generic

 pitivi/ui/filelisterrordialog.py |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/pitivi/ui/filelisterrordialog.py b/pitivi/ui/filelisterrordialog.py
index 1576cc4..47a741b 100644
--- a/pitivi/ui/filelisterrordialog.py
+++ b/pitivi/ui/filelisterrordialog.py
@@ -61,9 +61,14 @@ class FileListErrorDialog(GladeWindow, Signallable, Loggable):
         #self.storemodel.append([str(uri), str(reason)])
 
     def _createFileExpander(self, uri, reason, extra=None):
-        if uri[:7] == "file://":
-            uri = uri[7:]
-        exp = gtk.Expander(uri.split('/')[-1])
+        if uri:
+            if uri.startswith("file://"):
+                uri = uri[7:]
+            uri = uri.split('/')[-1]
+            exp = gtk.Expander(uri)
+        else:
+            exp = gtk.Expander(reason)
+
 
         textbuffer = gtk.TextBuffer()
         table = textbuffer.get_tag_table()
@@ -71,12 +76,12 @@ class FileListErrorDialog(GladeWindow, Signallable, Loggable):
         boldtag.props.weight = pango.WEIGHT_BOLD
         table.add(boldtag)
 
-        # <b>URI :</b> % uri
-        end = textbuffer.get_end_iter()
-        textbuffer.insert_with_tags(end, _("URI:"), boldtag)
-
-        end = textbuffer.get_end_iter()
-        textbuffer.insert(end, "%s\n" % uri)
+        if uri:
+            # <b>URI :</b> % uri
+            end = textbuffer.get_end_iter()
+            textbuffer.insert_with_tags(end, _("URI:"), boldtag)
+            end = textbuffer.get_end_iter()
+            textbuffer.insert(end, "%s\n" % uri)
 
         end = textbuffer.get_end_iter()
         textbuffer.insert_with_tags(end, _("Problem:"), boldtag)



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