[pitivi: 5/65] Don't show duration for image files in the missing files dialog



commit 6c88ff70bc04c7b528e3c91a49b305f7edea4ac0
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Sat Jun 18 18:50:52 2011 -0400

    Don't show duration for image files in the missing files dialog

 pitivi/ui/mainwindow.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index 72446a8..58cc278 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -899,10 +899,17 @@ class PitiviMainWindow(gtk.Window, Loggable):
         dialog.get_content_area().set_spacing(SPACING)
         dialog.set_transient_for(self)
 
-        text = _('The following file has moved: "<b>%s</b>" (duration: %s)\
-                \nPlease specify its new location:' \
-                % (factory_name(factory), beautify_length(factory.duration)))
         # TODO: display the filesize to help the user identify the file
+        if not factory.duration or factory.duration == gst.CLOCK_TIME_NONE:
+            # The file is probably an image, not video or audio.
+            text = _('The following file has moved: "<b>%s</b>"'
+                     '\nPlease specify its new location:'
+                     % factory_name(factory))
+        else:
+            length = beautify_length(factory.duration)
+            text = _('The following file has moved: "<b>%s</b>" (duration: %s)'
+                     '\nPlease specify its new location:'
+                     % (factory_name(factory), length))
 
         label = gtk.Label()
         label.set_markup(text)



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