allow to view the webalbum from the menu as well
authorgc <gc>
Sun, 18 Sep 2005 22:03:20 +0000 (22:03 +0000)
committergc <gc>
Sun, 18 Sep 2005 22:03:20 +0000 (22:03 +0000)
bin/booh
data/booh/images/stock-view-webalbum-16.png [new file with mode: 0644]

index e3485bfc5095c2055e99c732bd03deb7c6ca41d9..ca01c767c66d7a6b0a51c2b3ff1733269d52991d 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -2200,7 +2200,7 @@ def open_file(filename)
 
     populate_subalbums_treeview
 
-    $save.sensitive = $save_as.sensitive = $merge_current.sensitive = $merge.sensitive = $generate.sensitive = $properties.sensitive = $remove_all_captions.sensitive = true
+    $save.sensitive = $save_as.sensitive = $merge_current.sensitive = $merge.sensitive = $generate.sensitive = $view_wa.sensitive = $properties.sensitive = $remove_all_captions.sensitive = true
     return nil
 end
 
@@ -3192,6 +3192,8 @@ def create_menu_and_toolbar
     filesubmenu.append($generate = Gtk::ImageMenuItem.new(utf8(_("Generate web-album"))).set_sensitive(false))
     $generate.image = Gtk::Image.new("#{$FPATH}/images/stock-web-16.png")
     tooltips.set_tip($generate, utf8(_("(Re)generate web-album from latest changes into the destination directory")), nil)
+    filesubmenu.append($view_wa = Gtk::ImageMenuItem.new(utf8(_("View web-album with browser"))).set_sensitive(false))
+    $view_wa.image = Gtk::Image.new("#{$FPATH}/images/stock-view-webalbum-16.png")
     filesubmenu.append(            Gtk::SeparatorMenuItem.new)
     filesubmenu.append($properties = Gtk::ImageMenuItem.new(Gtk::Stock::PROPERTIES).set_sensitive(false))
     tooltips.set_tip($properties, utf8(_("View and modify properties of the web-album")), nil)
@@ -3226,6 +3228,14 @@ Click to view it in your browser:") % $xmldoc.root.attributes['destination']),
                              $generated_outofline = true
                          }})
     }
+    $view_wa.signal_connect('activate') {
+        indexhtml = $xmldoc.root.attributes['destination'] + '/index.html'
+        if File.exists?(indexhtml)
+            open_url(indexhtml)
+        else
+            show_popup($main_window, utf8(_("Seems like you should generate the web-album first.")))
+        end
+    }
     $properties.signal_connect('activate') { properties }
 
     quit.signal_connect('activate') { try_quit }
diff --git a/data/booh/images/stock-view-webalbum-16.png b/data/booh/images/stock-view-webalbum-16.png
new file mode 100644 (file)
index 0000000..90a4995
Binary files /dev/null and b/data/booh/images/stock-view-webalbum-16.png differ