end
end
+def set_mainwindow_title(progress)
+ filename = $orig_filename || $filename
+ if progress
+ if filename
+ $main_window.title = 'booh [' + (progress * 100).to_i.to_s + '%] - ' + File.basename(filename)
+ else
+ $main_window.title = 'booh [' + (progress * 100).to_i.to_s + '%] '
+ end
+ else
+ if filename
+ $main_window.title = 'booh - ' + File.basename(filename)
+ else
+ $main_window.title = 'booh'
+ end
+ end
+end
+
def backend_wait_message(parent, msg, infopipe_path, mode)
w = create_window
w.set_transient_for(parent)
b.image = Gtk::Image.new("#{$FPATH}/images/stock-close-24.png")
vb.pack_end(bottom, false, false)
+ directories = nil
+ update_progression_title_pb1 = proc {
+ if mode != 'web-album'
+ set_mainwindow_title(pb1_2.fraction + pb1_1.fraction / directories)
+ else
+ set_mainwindow_title((pb1_2.fraction + pb1_1.fraction / directories) * 9 / 10)
+ end
+ }
+
infopipe = File.open(infopipe_path, File::RDONLY | File::NONBLOCK)
refresh_thread = Thread.new {
directories_counter = 0
newtext = '/' if newtext == ''
gtk_thread_protect { pb1_2.text = newtext }
directories_counter += 1
- gtk_thread_protect { pb1_2.fraction = directories_counter / directories }
+ gtk_thread_protect {
+ pb1_2.fraction = directories_counter / directories
+ update_progression_title_pb1.call
+ }
end
elsif line =~ /^processing element$/
element_counter += 1
- gtk_thread_protect { pb1_1.fraction = element_counter / elements }
+ gtk_thread_protect {
+ pb1_1.fraction = element_counter / elements
+ update_progression_title_pb1.call
+ }
elsif line =~ /^processing size$/
element_counter += 1
- gtk_thread_protect { pb1_1.fraction = element_counter / elements }
+ gtk_thread_protect {
+ pb1_1.fraction = element_counter / elements
+ update_progression_title_pb1.call
+ }
elsif line =~ /^finished processing sizes$/
gtk_thread_protect { pb1_1.fraction = 1 }
elsif line =~ /^creating index.html$/
newtext = '/' if newtext == ''
gtk_thread_protect { pb2.text = newtext }
directories_counter += 1
- gtk_thread_protect { pb2.fraction = directories_counter / directories }
+ gtk_thread_protect {
+ pb2.fraction = directories_counter / directories
+ set_mainwindow_title(0.9 + pb2.fraction / 10)
+ }
elsif line =~ /^die: (.*)$/
$diemsg = $1
end
infopipe.close
File.delete(infopipe_path)
end
+ set_mainwindow_title(nil)
}
w.window_position = Gtk::Window::POS_CENTER
w.show_all
select_current_theme
$filename = filename
+ set_mainwindow_title(nil)
$default_size['thumbnails'] =~ /(.*)x(.*)/
$default_thumbnails = { :x => $1.to_i, :y => $2.to_i }
$albums_thumbnail_size =~ /(.*)x(.*)/