tooltips.set_tip($merge_newsubs, utf8(_("Take into account new subalbums in currently viewed subalbum (and only here)")), nil)
filesubmenu.append($merge = Gtk::ImageMenuItem.new(utf8(_("Scan source directory to merge new subalbums and new/removed images/videos"))).set_sensitive(false))
$merge.image = Gtk::Image.new("#{$FPATH}/images/stock-reset-16.png")
- tooltips.set_tip($merge, utf8(_("Take into account new subalbums (subdirectories) and new/removed images/videos in existing subalbums (anywhere)")), nil)
+ tooltips.set_tip($merge, utf8(_("Take into account new/removed subalbums (subdirectories) and new/removed images/videos in existing subalbums (anywhere)")), nil)
filesubmenu.append( Gtk::SeparatorMenuItem.new)
filesubmenu.append($generate = Gtk::ImageMenuItem.new(utf8(_("Generate web-album"))).set_sensitive(false))
$generate.image = Gtk::Image.new("#{$FPATH}/images/stock-web-16.png")
[ '--theme', '-t', GetoptLong::REQUIRED_ARGUMENT, _("Select HTML theme to use") ],
[ '--config', '-C', GetoptLong::REQUIRED_ARGUMENT, _("File containing config listing images and videos within directories with captions") ],
[ '--config-skel', '-k', GetoptLong::REQUIRED_ARGUMENT, _("Filename where the script will output a config skeleton") ],
- [ '--merge-config', '-M', GetoptLong::REQUIRED_ARGUMENT, _("File containing config listing, where to merge new images/videos from --source, and change theme info") ],
+ [ '--merge-config', '-M', GetoptLong::REQUIRED_ARGUMENT, _("File containing config listing, where to merge new/removed images/videos from --source, and change theme info") ],
[ '--merge-config-onedir', '-O', GetoptLong::REQUIRED_ARGUMENT, _("File containing config listing, for merging the subdir specified with --dir") ],
[ '--merge-config-subdirs', '-U', GetoptLong::REQUIRED_ARGUMENT, _("File containing config listing, for merging the new subdirs down the subdir specified with --dir") ],
[ '--dir', '-D', GetoptLong::REQUIRED_ARGUMENT, _("Directory for merge with --merge-config-onedir or --merge-config-subdirs") ],
elsif $mode == 'merge_config_subdirs'
examined_dirs = `find '#{$onedir}' -type d -follow`.sort.collect { |v| v.chomp }.delete_if { |v| optxpath.has_key?(utf8(v)) }
else
- examined_dirs = `find '#{$source}' -type d -follow`.sort
+ examined_dirs = `find '#{$source}' -type d -follow`.sort.collect { |v| v.chomp }
+ if $mode == 'merge_config'
+ $xmldoc.elements.each('//dir') { |elem|
+ if ! examined_dirs.include?(elem.attributes['path'])
+ msg 2, _("Merging config: removing directory %s from config, isn't on filesystem anymore") % elem.attributes['path']
+ elem.remove
+ end
+ }
+ end
end
info("directories: #{examined_dirs.length}, sizes: #{$images_size.length}")
examined_dirs.each { |dir|
- dir.chomp!
if File.basename(dir) =~ /^\./
msg 1, _("Ignoring directory %s, begins with a dot (indicating a hidden directory)") % dir
next
}
examined_dirs.each { |dir|
- dir.chomp!
info("index.html: #{dir}|#{$source}")
xmldir = optxpath[utf8(dir)]