end
def set_mousecursor(what, *widget)
+ cursor = what.nil? ? nil : Gdk::Cursor.new(what)
if widget[0] && widget[0].window
- widget[0].window.set_cursor(Gdk::Cursor.new(what))
+ widget[0].window.cursor = cursor
end
if $main_window.window
- $main_window.window.set_cursor(Gdk::Cursor.new(what))
+ $main_window.window.cursor = cursor
end
$current_cursor = what
end
end
end
def set_mousecursor_normal(*widget)
- gtk_thread_protect { set_mousecursor($save_cursor = Gdk::Cursor::LEFT_PTR, *widget) }
+ gtk_thread_protect { set_mousecursor($save_cursor = nil, *widget) }
end
def push_mousecursor_wait(*widget)
if $current_cursor != Gdk::Cursor::WATCH
end
end
def pop_mousecursor(*widget)
- gtk_thread_protect { set_mousecursor($save_cursor || Gdk::Cursor::LEFT_PTR, *widget) }
+ gtk_thread_protect { set_mousecursor($save_cursor || nil, *widget) }
end
def current_dest_dir
else
dialog.window_position = Gtk::Window::POS_MOUSE
end
+
+ if options[0] && options[0][:linkurl]
+ linkbut = Gtk::Button.new('')
+ linkbut.child.markup = "<span foreground=\"#00000000FFFF\" underline=\"single\">#{options[0][:linkurl]}</span>"
+ linkbut.signal_connect('clicked') { open_url(options[0][:linkurl] + '/index.html' ) }
+ linkbut.relief = Gtk::RELIEF_NONE
+ linkbut.signal_connect('enter-notify-event') { set_mousecursor(Gdk::Cursor::HAND2, linkbut); false }
+ linkbut.signal_connect('leave-notify-event') { set_mousecursor(nil, linkbut); false }
+ dialog.vbox.add(Gtk::Alignment.new(0.5, 0.5, 0, 0).add(linkbut))
+ end
+
dialog.show_all
if !options[0] || !options[0][:not_transient]
gtk_thread_protect { w8.destroy }
if exitstatus == 0
if params[:successmsg]
- gtk_thread_protect { show_popup($main_window, params[:successmsg]) }
+ gtk_thread_protect { show_popup($main_window, params[:successmsg], { :linkurl => params[:successmsg_linkurl] }) }
end
if params[:closure_after]
gtk_thread_protect(¶ms[:closure_after])
fc.destroy
end
+def open_url(url)
+ cmd = $config['browser'].gsub('%f', "'#{url}'") + ' &'
+ msg 2, cmd
+ system(cmd)
+end
+
def additional_booh_options
options = ''
if $config['mproc']
call_backend("booh-backend --config '#{$filename}' --verbose-level #{$verbose_level} #{additional_booh_options}",
utf8(_("Please wait while generating web-album...\nThis may take a while, please be patient.")),
'web-album',
- { :successmsg => utf8(_("Your web-album is now ready in directory `%s'.") % $xmldoc.root.attributes['destination']),
+ { :successmsg => utf8(_("Your web-album is now ready in directory `%s'.
+Click to view it in your browser:") % $xmldoc.root.attributes['destination']),
+ :successmsg_linkurl => $xmldoc.root.attributes['destination'],
:failuremsg => utf8(_("There was something wrong when generating the web-album, sorry.")),
:closure_after => proc {
$xmldoc.elements.each('//dir') { |elem|
about.signal_connect('activate') {
- Gtk::AboutDialog.set_url_hook { |dialog, url|
- cmd = $config['browser'].gsub('%f', "'#{url}'") + ' &'
- msg 2, cmd
- system(cmd)
- }
+ Gtk::AboutDialog.set_url_hook { |dialog, url| open_url(url) }
Gtk::AboutDialog.show($main_window, { :name => 'booh',
:version => $VERSION,
:copyright => 'Copyright (c) 2005 Guillaume Cottenceau',