}
end
-def popup_thumbnail_menu(event, optionals, type, xmldir, attributes_prefix, possible_actions, closures)
+def popup_thumbnail_menu(event, optionals, fullpath, type, xmldir, attributes_prefix, possible_actions, closures)
distribute_multiple_call = Proc.new { |action, arg|
$selected_elements.each_key { |path|
$name2widgets[path][:img].pixbuf = $selected_elements[path][:pixbuf]
menu.append(view = Gtk::ImageMenuItem.new(utf8(_("View larger"))))
view.image = Gtk::Image.new("#{$FPATH}/images/stock-view-16.png")
view.signal_connect('activate') { closures[:view].call }
- menu.append( Gtk::SeparatorMenuItem.new)
else
menu.append(view = Gtk::ImageMenuItem.new(utf8(_("Play video"))))
view.image = Gtk::Image.new("#{$FPATH}/images/stock-video-16.png")
menu.append( Gtk::SeparatorMenuItem.new)
end
end
+ if type == 'image'
+ menu.append(exif = Gtk::ImageMenuItem.new(utf8(_("View EXIF data"))))
+ exif.image = Gtk::Image.new("#{$FPATH}/images/stock-list-16.png")
+ exif.signal_connect('activate') { show_popup($main_window,
+ utf8(`identify -format "%[EXIF:*]" #{fullpath}`.sub(/MakerNote.*\n/, '')),
+ { :title => utf8(_("EXIF data of %s") % File.basename(fullpath)), :nomarkup => true, :scrolled => true }) }
+ menu.append( Gtk::SeparatorMenuItem.new)
+ end
menu.append(r90 = Gtk::ImageMenuItem.new(utf8(_("Rotate clockwise"))))
r90.image = Gtk::Image.new("#{$FPATH}/images/stock-rotate-90-16.png")
r90.signal_connect('activate') { distribute_multiple_call.call(:rotate, 90) }
if !$ignore_next_release
x, y = autotable.get_current_pos(vbox)
next_ = autotable.get_next_widget(vbox)
- popup_thumbnail_menu(event, ['delete'], type, $xmldir.elements["*[@filename='#{filename}']"], '',
+ popup_thumbnail_menu(event, ['delete'], fullpath, type, $xmldir.elements["*[@filename='#{filename}']"], '',
{ :can_left => x > 0, :can_right => next_ && autotable.get_current_pos(next_)[0] > x,
:can_up => y > 0, :can_down => y < autotable.get_max_y, :can_multiple => true, :can_panorama => true },
{ :rotate => rotate_and_cleanup, :move => move, :color_swap => color_swap_and_cleanup, :enhance => enhance_and_cleanup,
def show_popup(parent, msg, *options)
dialog = Gtk::Dialog.new
- dialog.title = utf8(_("Booh message"))
+ if options[0] && options[0][:title]
+ dialog.title = options[0][:title]
+ else
+ dialog.title = utf8(_("Booh message"))
+ end
lbl = Gtk::Label.new
- lbl.markup = msg
+ if options[0] && options[0][:nomarkup]
+ lbl.text = msg
+ else
+ lbl.markup = msg
+ end
if options[0] && options[0][:centered]
lbl.set_justify(Gtk::Justification::CENTER)
end
if options[0] && options[0][:topwidget]
dialog.vbox.add(options[0][:topwidget])
end
- dialog.vbox.add(lbl)
+ if options[0] && options[0][:scrolled]
+ sw = Gtk::ScrolledWindow.new(nil, nil)
+ sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
+ sw.add_with_viewport(lbl)
+ dialog.vbox.add(sw)
+ dialog.set_default_size(400, 500)
+ else
+ dialog.vbox.add(lbl)
+ dialog.set_default_size(200, 120)
+ end
if options[0] && options[0][:okcancel]
dialog.add_button(Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL)
end
dialog.add_button(Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK)
- dialog.set_default_size(200, 120)
if options[0] && options[0][:pos_centered]
dialog.window_position = Gtk::Window::POS_CENTER
else
end
end
if event.event_type == Gdk::Event::BUTTON_PRESS && event.button == 3
- popup_thumbnail_menu(event, ['change_image'], entry2type(captionfile), xmldir, "#{infotype}-",
+ popup_thumbnail_menu(event, ['change_image'], captionfile, entry2type(captionfile), xmldir, "#{infotype}-",
{ :forbid_left => true, :forbid_right => true,
:can_up => counter > 1, :can_down => counter > 0 && counter < subalbums_counter },
{ :change => change_image, :move => move, :rotate => rotate_and_cleanup, :enhance => enhance_and_cleanup,