tooltips = Gtk::Tooltips.new
tipname = File.basename(filename).gsub(/-\d+x\d+\.jpg/, '')
- tooltips.set_tip(evtbox, utf8(type == 'video' ? (_("%s (video)") % tipname) : tipname), nil)
+ tooltips.set_tip(evtbox, utf8(type == 'video' ? (_("%s (video - %s KB)") % [tipname, commify(File.size(from_utf8("#{$current_path}/#{name}"))/1024)]) : tipname), nil)
frame2 = Gtk::Frame.new
frame2.add(textview = Gtk::TextView.new.set_wrap_mode(Gtk::TextTag::WRAP_WORD))
end
end
+ #- commify from http://pleac.sourceforge.net/ (pleac rulz)
+ def commify(n)
+ n.to_s =~ /([^\.]*)(\..*)?/
+ int, dec = $1.reverse, $2 ? $2 : ""
+ while int.gsub!(/(,|\.|^)(\d{3})(\d)/, '\1\2' + _(",") + '\3')
+ end
+ int.reverse + dec
+ end
+
def gen_thumbnails(orig, xmldir, allow_background, dests)
if !dests.detect { |dest| !File.exists?(dest['filename']) }
return true