add "merge" to booh-gui
authorgc <gc>
Wed, 4 May 2005 22:38:10 +0000 (22:38 +0000)
committergc <gc>
Wed, 4 May 2005 22:38:10 +0000 (22:38 +0000)
bin/booh-gui
data/booh/images/stock-reset-16.png [new file with mode: 0644]

index 1d80cc5b907bb03ed76a3ac7bdf52954b88a6692..9b9754cfcd84590029497bd3923b285efd66771a 100755 (executable)
@@ -1253,7 +1253,7 @@ def open_file(filename)
 
     $config['last-opens'] ||= []
     $config['last-opens'] << filename
-    $save.sensitive = $save_as.sensitive = $generate.sensitive = $properties.sensitive = true
+    $save.sensitive = $save_as.sensitive = $merge.sensitive = $generate.sensitive = $properties.sensitive = true
     return nil
 end
 
@@ -1606,13 +1606,27 @@ def properties
     dialog.destroy
 
     if ok && (save_theme != theme || save_limit_sizes != limit_sizes)
-        perform_in_background("booh --source #{from_utf8(source)} --destination #{from_utf8(dest)} --merge-config #{$filename} --for-gui " +
+        perform_in_background("booh --merge-config #{$filename} --for-gui " +
                                   "--verbose-level #{$verbose_level} --theme #{theme} --sizes #{save_limit_sizes.join(',')} #{additional_booh_options}",
                               utf8(_("Please wait while scanning source directory...")),
                               { :closure_after => proc { open_file($filename) } })
     end
 end
 
+def merge
+    save_current_file
+
+    theme = $xmldoc.root.attributes['theme']
+    limit_sizes = $xmldoc.root.attributes['limit-sizes']
+    if limit_sizes
+        limit_sizes = "--sizes #{limit_sizes}"
+    end
+    perform_in_background("booh --merge-config #{$filename} --for-gui " +
+                              "--verbose-level #{$verbose_level} --theme #{theme} #{limit_sizes} #{additional_booh_options}",
+                          utf8(_("Please wait while scanning source directory...")),
+                          { :closure_after => proc { open_file($filename) } })
+end
+
 def save_as_do
     fc = Gtk::FileChooserDialog.new(utf8(_("Select a new filename to store this album's properties")),
                                     nil,
@@ -1689,10 +1703,16 @@ def create_menu_and_toolbar
     filesubmenu.append($save     = Gtk::ImageMenuItem.new(Gtk::Stock::SAVE).set_sensitive(false))
     filesubmenu.append($save_as  = Gtk::ImageMenuItem.new(Gtk::Stock::SAVE_AS).set_sensitive(false))
     filesubmenu.append(            Gtk::SeparatorMenuItem.new)
+    filesubmenu.append($merge    = Gtk::ImageMenuItem.new(utf8(_("Merge new images/videos"))).set_sensitive(false))
+    $merge.image = Gtk::Image.new("#{$FPATH}/images/stock-reset-16.png")
+    tooltips = Gtk::Tooltips.new
+    tooltips.set_tip($merge, utf8(_("Take into account new/removed images/videos in the source directory")), nil)
     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(            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)
     filesubmenu.append(            Gtk::SeparatorMenuItem.new)
     filesubmenu.append(quit      = Gtk::ImageMenuItem.new(Gtk::Stock::QUIT))
     filemenu.set_submenu(filesubmenu)
@@ -1702,6 +1722,7 @@ def create_menu_and_toolbar
     open.signal_connect('activate') { open_file_popup }
     $save.signal_connect('activate') { save_current_file }
     $save_as.signal_connect('activate') { save_as_do }
+    $merge.signal_connect('activate') { merge }
     $generate.signal_connect('activate') {
         save_current_file
         perform_in_background("booh --config #{$filename} --verbose-level #{$verbose_level} #{additional_booh_options}",
diff --git a/data/booh/images/stock-reset-16.png b/data/booh/images/stock-reset-16.png
new file mode 100644 (file)
index 0000000..cc277ff
Binary files /dev/null and b/data/booh/images/stock-reset-16.png differ