entry.free_pixbuf_thumbnail
$mainview.redraw
entry.image.pixbuf = entry.pixbuf_thumbnail
- if $config['rotate-set-exif'] == 'true'
+ if $config['rotate-set-exif'] == 'true' && entry.type == 'image'
Exif.set_orientation(entry.path, angle_to_exif_orientation(entry.angle))
end
end
def show_entries
sb_msg(_("Loading images..."))
+ $loading_progressbar.fraction = 0
+ $loading_progressbar.text = utf8(_("Loading... %d%") % 0)
+ $loading_progressbar.show
t1 = Time.now
total_loaded_files = 0
total_loaded_size = 0
else
$allentries.delete_at(i)
end
+ $loading_progressbar.fraction = i.to_f / $allentries.size
+ $loading_progressbar.text = utf8(_("Loading... %d%") % (100 * $loading_progressbar.fraction))
end
if i <= $config['preload-distance'].to_i * 2
#- not yet preloaded correctly
run_preloader
end
sb_msg(_("%d images of total %s kB loaded in %3.2f seconds.") % [ total_loaded_files, commify(total_loaded_size / 1024), Time.now - t1 ])
+ $loading_progressbar.hide
+ $execute.sensitive = true
end
def reset_all
- $images_loader and $images_loader.kill
reset_labels
reset_thumbnails
$mainview.set_shown_entry(nil)
sb_msg(nil)
+ $preloader_allowed = false
end
def open_dir(path)
#- remove visual stuff, so that user will see something is happening
reset_all
sb_msg(_("Scanning source directory..."))
+ Gtk.main_iteration while Gtk.events_pending?
path = File.expand_path(path.sub(%r|/$|, ''))
examined_dirs = `find '#{path}' -type d -follow`.sort.collect { |v| v.chomp }
}
}
$workingdir = path
- show_entries
- $execute.sensitive = true
return nil
end
fc.current_folder = $workingdir
end
ok = false
+ load = false
while !ok
if fc.run == Gtk::Dialog::RESPONSE_ACCEPT
msg = open_dir(fc.filename)
ok = false
else
ok = true
+ load = true
end
else
ok = true
end
end
fc.destroy
+ if load
+ show_entries
+ end
end
def try_quit(*options)
main_vbox = Gtk::VBox.new(false, 0)
main_vbox.pack_start(mb, false, false)
mainview_hbox = Gtk::HBox.new
- mainview_hbox.pack_start(Gtk::Alignment.new(0.5, 0, 0, 0).add($labels_vbox = Gtk::VBox.new(false, 5)), false, true)
+ mainview_hbox.pack_start(Gtk::Alignment.new(0.5, 0, 1, 1).add(left_vbox = Gtk::VBox.new(false, 5)), false, true)
+ left_vbox.pack_start(($labels_vbox = Gtk::VBox.new(false, 5)), false, true)
+ $labels_vbox.pack_start(Gtk::Label.new(utf8(_("Labels list:"))).set_justify(Gtk::Justification::CENTER), false, false).show_all
+ left_vbox.pack_end($loading_progressbar = Gtk::ProgressBar.new.set_text(utf8(_("Loading... %d%") % 0)), false, true)
reset_labels
mainview_hbox.pack_start($mainview = MainView.new, true, true)
main_vbox.pack_start(mainview_hbox, true, true)
}
$main_window.show_all
+ $loading_progressbar.hide
end
check_config
if ARGV[0]
- open_dir(ARGV[0])
+ if msg = open_dir(ARGV[0])
+ puts msg
+ else
+ show_entries
+ end
end
Gtk.main