don't die when File/Open is given an image file. and even provide
authorgc <gc>
Sat, 7 May 2005 22:52:36 +0000 (22:52 +0000)
committergc <gc>
Sat, 7 May 2005 22:52:36 +0000 (22:52 +0000)
a hint for newbies when they try to open an image or video.

bin/booh

index e918a1cd8df299af33acc398bb7fa50af809c018..56388e78cd621c574501b75887488bce42b7fb59 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -1202,12 +1202,16 @@ def open_file(filename)
 
     begin
         $xmldoc = REXML::Document.new File.new(filename)
-    rescue
+    rescue Exception
         $xmldoc = nil
     end
 
     if !$xmldoc || !$xmldoc.root || $xmldoc.root.name != 'booh'
-        return utf8(_("Not a booh file!"))
+        if entry2type(filename).nil?
+            return utf8(_("Not a booh file!"))
+        else
+            return utf8(_("Not a booh file!\n\nHint: you cannot import directly an image or video with File/Open.\nUse File/New to create a new album."))
+        end
     end
 
     if !source = $xmldoc.root.attributes['source']