tooltips.set_tip(optimize432, utf8(_("Resize images with optimized sizes for 3/2 aspect ratio rather than 4/3 (typical aspect ratio of pictures from non digital cameras are 3/2 when pictures from digital cameras are 4/3)")), nil)
vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("Number of thumbnails per row: "))), false, false, 0).
pack_start(nperrowradios = Gtk::HBox.new, false, false, 0))
+ vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("'Return to your website' link on pages bottom: "))), false, false, 0).
+ pack_start(indexlinkentry = Gtk::Entry.new, true, true, 0))
+ tooltips.set_tip(indexlinkentry, utf8(_("Optional HTML markup to use on pages bottom for a small link returning to wherever you see fit in your website (or somewhere else)")), nil)
vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("'Made with' markup on pages bottom: "))), false, false, 0).
pack_start(madewithentry = Gtk::Entry.new.set_text('made with <a href=%booh>booh</a>!'), true, true, 0))
tooltips.set_tip(madewithentry, utf8(_("Optional HTML markup to use on pages bottom for a small 'made with' label; %booh is replaced by the website of booh;\nfor example: made with <a href=%booh>booh</a>!")), nil)
nperrow = nperrows.find { |e| e[:widget].active? }[:value]
opt432 = optimize432.active?
madewith = madewithentry.text
+ indexlink = indexlinkentry.text
end
if src_nb_thread
Thread.kill(src_nb_thread)
if ok
call_backend("booh-backend --source '#{srcdir}' --destination '#{destdir}' --config-skel '#{configskel}' --for-gui " +
"--verbose-level #{$verbose_level} --theme #{theme} --sizes #{sizes} --thumbnails-per-row #{nperrow} " +
- "#{opt432 ? '--optimize-for-32' : ''} --made-with '#{madewith}' #{additional_booh_options}",
+ "#{opt432 ? '--optimize-for-32' : ''} --made-with '#{madewith}' --index-link '#{indexlink}' #{additional_booh_options}",
utf8(_("Please wait while scanning source directory...")),
'full scan',
{ :closure_after => proc { open_file_user(configskel) } })
limit_sizes = limit_sizes.split(/,/)
end
madewith = $xmldoc.root.attributes['made-with']
+ indexlink = $xmldoc.root.attributes['index-link']
tooltips = Gtk::Tooltips.new
frame1 = Gtk::Frame.new(utf8(_("Locations"))).add(tbl = Gtk::Table.new(0, 0, false))
tooltips.set_tip(optimize432, utf8(_("Resize images with optimized sizes for 3/2 aspect ratio rather than 4/3 (typical aspect ratio of pictures from non digital cameras are 3/2 when pictures from digital cameras are 4/3)")), nil)
vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("Number of thumbnails per row: "))), false, false, 0).
pack_start(nperrowradios = Gtk::HBox.new, false, false, 0))
+
+ vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("'Return to your website' link on pages bottom: "))), false, false, 0).
+ pack_start(indexlinkentry = Gtk::Entry.new, true, true, 0))
+ if indexlink
+ indexlinkentry.text = indexlink
+ end
+ tooltips.set_tip(indexlinkentry, utf8(_("Optional HTML markup to use on pages bottom for a small link returning to wherever you see fit in your website (or somewhere else)")), nil)
vb.add(Gtk::HBox.new(false, 3).pack_start(Gtk::Label.new(utf8(_("'Made with' markup on pages bottom: "))), false, false, 0).
pack_start(madewithentry = Gtk::Entry.new, true, true, 0))
if madewith
save_opt432 = optimize432.active?
save_nperrow = nperrows.find { |e| e[:widget].active? }[:value]
save_madewith = madewithentry.text
+ save_indexlink = indexlinkentry.text
dialog.destroy
- if ok && (save_theme != theme || save_limit_sizes != limit_sizes || save_opt432 != opt432 || save_nperrow != nperrow || save_madewith != madewith)
+ if ok && (save_theme != theme || save_limit_sizes != limit_sizes || save_opt432 != opt432 || save_nperrow != nperrow || save_madewith != madewith || save_indexlink != indexlinkentry)
mark_document_as_dirty
save_current_file
call_backend("booh-backend --use-config '#{$filename}' --for-gui --verbose-level #{$verbose_level} " +
"--thumbnails-per-row #{save_nperrow} --theme #{save_theme} --sizes #{save_limit_sizes.join(',')} " +
- "#{save_opt432 ? '--optimize-for-32' : ''} --made-with '#{save_madewith}' #{additional_booh_options}",
+ "#{save_opt432 ? '--optimize-for-32' : ''} --made-with '#{save_madewith}' --index-link '#{save_indexlink}' #{additional_booh_options}",
utf8(_("Please wait while scanning source directory...")),
'full scan',
{ :closure_after => proc {
[ '--sizes', '-S', GetoptLong::REQUIRED_ARGUMENT, _("Specify the list of images sizes to use instead of all specified in the theme (this is a comma-separated list)") ],
[ '--thumbnails-per-row', '-T', GetoptLong::REQUIRED_ARGUMENT, _("Specify the amount of thumbnails per row in the thumbnails page (if applicable in theme)") ],
[ '--optimize-for-32', '-o', GetoptLong::NO_ARGUMENT, _("Resize images with optimized sizes for 3/2 aspect ratio rather than 4/3 (typical aspect ratio of pictures from non digital cameras are 3/2 when pictures from digital cameras are 4/3)") ],
- [ '--made-with', '-n', GetoptLong::REQUIRED_ARGUMENT, _("Specify the HTML markup to use on the bottom of pages") ],
+ [ '--index-link', '-l', GetoptLong::REQUIRED_ARGUMENT, _("Specify the HTML markup to use on the bottom of pages for a small link returning to wherever you see fit in your website (or somewhere else)") ],
+ [ '--made-with', '-n', GetoptLong::REQUIRED_ARGUMENT, _("Specify the HTML markup to use on the bottom of pages for a small 'made with' message") ],
[ '--comments-format','-c', GetoptLong::REQUIRED_ARGUMENT, _("Specify comments format to use for images instead of only filename when creating new albums; use ImageMagick's format") ],
[ '--mproc', '-m', GetoptLong::REQUIRED_ARGUMENT, _("Specify the number of processors for multi-processors machines") ],
when '--made-with'
$madewith = arg
+ when '--index-link'
+ $indexlink = arg
+
when '--comments-format'
$commentsformat = arg
$optimize_for_32 = !$xmldoc.root.attributes['optimize-for-32'].nil?
$N_per_row = $xmldoc.root.attributes['thumbnails-per-row']
$madewith = $xmldoc.root.attributes['made-with']
+ $indexlink = $xmldoc.root.attributes['index-link']
end
end
if $madewith
additional_params += " made-with='#{$madewith}'"
end
+ if $indexlink
+ additional_params += " index-link='#{$indexlink}'"
+ end
$xmldoc = Document.new "<booh version='#{$VERSION}' source='#{utf8($source)}' destination='#{utf8($dest)}' theme='#{$theme}' #{additional_params}/>"
$xmldoc << XMLDecl.new(XMLDecl::DEFAULT_VERSION, $CURRENT_CHARSET)
$mode = 'gen_config'
else
$xmldoc.root.delete_attribute('made-with')
end
+ if $indexlink
+ $xmldoc.root.add_attribute('index-link', $indexlink)
+ else
+ $xmldoc.root.delete_attribute('index-link')
+ end
end
if $madewith
i.gsub!(/~~current_size~~/, sizeobj['name'])
i.gsub!(/~~current_size_js~~/, size2js(sizeobj['name']))
i.gsub!(/~~madewith~~/, $madewith || '')
+ i.gsub!(/~~indexlink~~/, $indexlink || '')
end
ios = File.open("#{dest_dir}/thumbnails-#{size2js(sizeobj['name'])}.html", "w")
ios.write(html)
i.gsub!(/~~theme~~/, $theme)
i.gsub!(/~~current_size~~/, size2js(sizeobj['name']))
i.gsub!(/~~madewith~~/, $madewith || '')
+ i.gsub!(/~~indexlink~~/, $indexlink || '')
substitute_html_sizes(i, sizeobj, 'image')
end
ios = File.open("#{dest_dir}/image-#{size2js(sizeobj['name'])}.html", "w")
for i in html
i.gsub!(/~~thumbnails~~/, html_index)
i.gsub!(/~~madewith~~/, $madewith || '')
+ i.gsub!(/~~indexlink~~/, $indexlink || '')
end
else