*** empty log message ***
[booh] / bin / booh
index c9f9a9235d7c2d7675281440682e9c9ec2f79f17..c5079a2bda5b44c09cc7908d075b61ef9a4308de 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -384,12 +384,12 @@ def create_editzone(scrolledwindow, pagenum, image)
         if candidate_undo_text && candidate_undo_text != textview.buffer.text
             $modified = true
             save_undo(_("text edit"),
-                      Proc.new { |text|
+                      proc { |text|
                           save_text = textview.buffer.text
                           textview.buffer.text = text
                           textview.grab_focus
                           $notebook.set_page(pagenum)
-                          Proc.new {
+                          proc {
                               textview.buffer.text = save_text
                               textview.grab_focus
                               $notebook.set_page(pagenum)
@@ -455,10 +455,10 @@ def rotate(angle, thumbnail_img, img, xmlelem, attributes_prefix, desired_x, des
     rotate_real(angle, thumbnail_img, img, xmlelem, attributes_prefix, desired_x, desired_y)
 
     save_undo(angle == 90 ? _("rotate clockwise") : angle == -90 ? _("rotate counter-clockwise") : _("flip upside-down"),
-              Proc.new { |angle|
+              proc { |angle|
                   rotate_real(angle, thumbnail_img, img, xmlelem, attributes_prefix, desired_x, desired_y)
                   $notebook.set_page(attributes_prefix != '' ? 0 : 1)
-                  Proc.new {
+                  proc {
                       rotate_real(-angle, thumbnail_img, img, xmlelem, attributes_prefix, desired_x, desired_y)
                       $notebook.set_page(0)
                       $notebook.set_page(attributes_prefix != '' ? 0 : 1)
@@ -708,7 +708,7 @@ def gen_real_thumbnail(type, origfile, destfile, xmldir, size, img, infotype)
 end
 
 def popup_thumbnail_menu(event, optionals, fullpath, type, xmldir, attributes_prefix, possible_actions, closures)
-    distribute_multiple_call = Proc.new { |action, arg|
+    distribute_multiple_call = proc { |action, arg|
         $selected_elements.each_key { |path|
             $name2widgets[path][:img].pixbuf = $selected_elements[path][:pixbuf]
         }
@@ -965,7 +965,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
     #- to be able to find widgets by name
     $name2widgets[filename] = { :textview => textview, :evtbox => evtbox, :vbox => vbox, :img => img, :type => type }
 
-    cleanup_all_thumbnails = Proc.new {
+    cleanup_all_thumbnails = proc {
         #- remove out of sync images
         dest_img_base = build_full_dest_filename(filename).sub(/\.[^\.]+$/, '')
         for sizeobj in $images_size
@@ -974,27 +974,27 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     }
 
-    rotate_and_cleanup = Proc.new { |angle|
+    rotate_and_cleanup = proc { |angle|
         rotate(angle, thumbnail_img, img, $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y])
         cleanup_all_thumbnails.call
     }
 
-    move = Proc.new { |direction|
+    move = proc { |direction|
         do_method = "move_#{direction}"
         undo_method = "move_" + case direction; when 'left'; 'right'; when 'right'; 'left'; when 'up'; 'down'; when 'down'; 'up' end
-        perform = Proc.new {
+        perform = proc {
             done = autotable.method(do_method).call(vbox)
             textview.grab_focus  #- because if moving, focus is stolen
             done
         }
         if perform.call
             save_undo(_("move %s") % direction,
-                      Proc.new {
+                      proc {
                           autotable.method(undo_method).call(vbox)
                           textview.grab_focus  #- because if moving, focus is stolen
                           autoscroll_if_needed($autotable_sw, img, textview)
                           $notebook.set_page(1)
-                          Proc.new {
+                          proc {
                               autotable.method(do_method).call(vbox)
                               textview.grab_focus  #- because if moving, focus is stolen
                               autoscroll_if_needed($autotable_sw, img, textview)
@@ -1004,8 +1004,8 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
         end
     }
 
-    color_swap_and_cleanup = Proc.new {
-        perform_color_swap_and_cleanup = Proc.new {
+    color_swap_and_cleanup = proc {
+        perform_color_swap_and_cleanup = proc {
             color_swap($xmldir.elements["*[@filename='#{filename}']"], '')
             my_gen_real_thumbnail.call
         }
@@ -1014,12 +1014,12 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
         perform_color_swap_and_cleanup.call
 
         save_undo(_("color swap"),
-                  Proc.new {
+                  proc {
                       perform_color_swap_and_cleanup.call
                       textview.grab_focus
                       autoscroll_if_needed($autotable_sw, img, textview)
                       $notebook.set_page(1)
-                      Proc.new {
+                      proc {
                           perform_color_swap_and_cleanup.call
                           textview.grab_focus
                           autoscroll_if_needed($autotable_sw, img, textview)
@@ -1028,20 +1028,20 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
                   })
     }
 
-    change_frame_offset_and_cleanup_real = Proc.new { |values|
-        perform_change_frame_offset_and_cleanup = Proc.new { |val|
+    change_frame_offset_and_cleanup_real = proc { |values|
+        perform_change_frame_offset_and_cleanup = proc { |val|
             change_frame_offset($xmldir.elements["*[@filename='#{filename}']"], '', val)
             my_gen_real_thumbnail.call
         }
         perform_change_frame_offset_and_cleanup.call(values[:new])
         
         save_undo(_("specify frame offset"),
-                  Proc.new {
+                  proc {
                       perform_change_frame_offset_and_cleanup.call(values[:old])
                       textview.grab_focus
                       autoscroll_if_needed($autotable_sw, img, textview)
                       $notebook.set_page(1)
-                      Proc.new {
+                      proc {
                           perform_change_frame_offset_and_cleanup.call(values[:new])
                           textview.grab_focus
                           autoscroll_if_needed($autotable_sw, img, textview)
@@ -1050,25 +1050,25 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
                   })
     }
 
-    change_frame_offset_and_cleanup = Proc.new {
+    change_frame_offset_and_cleanup = proc {
         if values = ask_new_frame_offset($xmldir.elements["*[@filename='#{filename}']"], '')
             change_frame_offset_and_cleanup_real.call(values)
         end
     }
 
-    change_pano_amount_and_cleanup_real = Proc.new { |values|
-        perform_change_pano_amount_and_cleanup = Proc.new { |val|
+    change_pano_amount_and_cleanup_real = proc { |values|
+        perform_change_pano_amount_and_cleanup = proc { |val|
             change_pano_amount($xmldir.elements["*[@filename='#{filename}']"], '', val)
         }
         perform_change_pano_amount_and_cleanup.call(values[:new])
         
         save_undo(_("change panorama amount"),
-                  Proc.new {
+                  proc {
                       perform_change_pano_amount_and_cleanup.call(values[:old])
                       textview.grab_focus
                       autoscroll_if_needed($autotable_sw, img, textview)
                       $notebook.set_page(1)
-                      Proc.new {
+                      proc {
                           perform_change_pano_amount_and_cleanup.call(values[:new])
                           textview.grab_focus
                           autoscroll_if_needed($autotable_sw, img, textview)
@@ -1077,14 +1077,14 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
                   })
     }
 
-    change_pano_amount_and_cleanup = Proc.new {
+    change_pano_amount_and_cleanup = proc {
         if values = ask_new_pano_amount($xmldir.elements["*[@filename='#{filename}']"], '')
             change_pano_amount_and_cleanup_real.call(values)
         end
     }
 
-    whitebalance_and_cleanup_real = Proc.new { |values|
-        perform_change_whitebalance_and_cleanup = Proc.new { |val|
+    whitebalance_and_cleanup_real = proc { |values|
+        perform_change_whitebalance_and_cleanup = proc { |val|
             change_whitebalance($xmldir.elements["*[@filename='#{filename}']"], '', val)
             recalc_whitebalance(val, fullpath, thumbnail_img, img,
                                 $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
@@ -1093,12 +1093,12 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
         perform_change_whitebalance_and_cleanup.call(values[:new])
 
         save_undo(_("fix white balance"),
-                  Proc.new {
+                  proc {
                       perform_change_whitebalance_and_cleanup.call(values[:old])
                       textview.grab_focus
                       autoscroll_if_needed($autotable_sw, img, textview)
                       $notebook.set_page(1)
-                      Proc.new {
+                      proc {
                           perform_change_whitebalance_and_cleanup.call(values[:new])
                           textview.grab_focus
                           autoscroll_if_needed($autotable_sw, img, textview)
@@ -1107,15 +1107,15 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
                   })
     }
 
-    whitebalance_and_cleanup = Proc.new {
+    whitebalance_and_cleanup = proc {
         if values = ask_whitebalance(fullpath, thumbnail_img, img,
                                      $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
             whitebalance_and_cleanup_real.call(values)
         end
     }
 
-    enhance_and_cleanup = Proc.new {
-        perform_enhance_and_cleanup = Proc.new {
+    enhance_and_cleanup = proc {
+        perform_enhance_and_cleanup = proc {
             enhance($xmldir.elements["*[@filename='#{filename}']"], '')
             my_gen_real_thumbnail.call
         }
@@ -1124,12 +1124,12 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
         perform_enhance_and_cleanup.call
 
         save_undo(_("enhance"),
-                  Proc.new {
+                  proc {
                       perform_enhance_and_cleanup.call
                       textview.grab_focus
                       autoscroll_if_needed($autotable_sw, img, textview)
                       $notebook.set_page(1)
-                      Proc.new {
+                      proc {
                           perform_enhance_and_cleanup.call
                           textview.grab_focus
                           autoscroll_if_needed($autotable_sw, img, textview)
@@ -1138,11 +1138,11 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
                   })
     }
 
-    delete = Proc.new { |isacut|
+    delete = proc { |isacut|
         if autotable.current_order.size > 1 || show_popup($main_window, utf8(_("Do you confirm this subalbum needs to be completely removed? This operation cannot be undone.")), { :okcancel => true })
             $modified = true
             after = nil
-            perform_delete = Proc.new {
+            perform_delete = proc {
                 after = autotable.get_next_widget(vbox)
                 if !after
                     after = autotable.get_previous_widget(vbox)
@@ -1165,14 +1165,14 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
                 delete_current_subalbum
             else
                 save_undo(_("delete"),
-                          Proc.new { |pos|
+                          proc { |pos|
                               autotable.reinsert(pos, vbox, filename)
                               $notebook.set_page(1)
                               autotable.queue_draws << proc { textview.grab_focus; autoscroll_if_needed($autotable_sw, img, textview) }
                               $cuts = []
                               msg 3, "removing deletion schedule of: #{fullpath}"
                               $todelete.delete(fullpath)  #- unconditional because deleteondisk option could have been modified
-                              Proc.new {
+                              proc {
                                   perform_delete.call
                                   $notebook.set_page(1)
                               }
@@ -1181,12 +1181,12 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
         end
     }
 
-    cut = Proc.new {
+    cut = proc {
         delete.call(true)
         $cuts << { :vbox => vbox, :filename => filename }
         $statusbar.push(0, utf8(_("%s elements in the clipboard.") % $cuts.size ))
     }
-    paste = Proc.new {
+    paste = proc {
         if $cuts.size > 0
             $cuts.each { |elem|
                 autotable.reinsert(autotable.get_current_number(vbox), elem[:vbox], elem[:filename])
@@ -1197,10 +1197,10 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
                 autoscroll_if_needed($autotable_sw, $vbox2widgets[last[:vbox]][:image], $vbox2widgets[last[:vbox]][:textview])
             }
             save_undo(_("paste"),
-                      Proc.new { |cuts|
+                      proc { |cuts|
                           cuts.each { |elem| autotable.remove(elem[:vbox]) }
                           $notebook.set_page(1)
-                          Proc.new {
+                          proc {
                               cuts.each { |elem|
                                   autotable.reinsert(autotable.get_current_number(vbox), elem[:vbox], elem[:filename])
                               }
@@ -1368,19 +1368,19 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
         if !done
             ctxt.targets.each { |target|
                 if target.name == 'reorder-elements'
-                    move_dnd = Proc.new { |from,to|
+                    move_dnd = proc { |from,to|
                         if from != to
                             $modified = true
                             autotable.move(from, to)
                             save_undo(_("reorder"),
-                                      Proc.new { |from, to|
+                                      proc { |from, to|
                                           if to > from
                                               autotable.move(to - 1, from)
                                           else
                                               autotable.move(to, from + 1)
                                           end
                                           $notebook.set_page(1)
-                                          Proc.new {
+                                          proc {
                                               autotable.move(from, to)
                                               $notebook.set_page(1)
                                           }
@@ -1427,7 +1427,7 @@ def create_auto_table
     #- follows stuff for handling multiple elements selection
     press_x = nil; press_y = nil; pos_x = nil; pos_y = nil; $selected_elements = {}
     gc = nil
-    update_selected = Proc.new {
+    update_selected = proc {
         $autotable.current_order.each { |path|
             w = $name2widgets[path][:evtbox].window
             xm = w.position[0] + w.size[0]/2
@@ -1452,36 +1452,38 @@ def create_auto_table
         gc.function = Gdk::GC::INVERT
         #- autoscroll handling for DND and multiple selections
         Gtk.timeout_add(100) {
-            w, x, y, mask = $autotable.window.pointer
-            if mask & Gdk::Window::BUTTON1_MASK != 0
-                if y < $autotable_sw.vadjustment.value
-                    if pos_x
-                        $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
-                    end
-                    if $button1_pressed_autotable || press_x
-                        scroll_upper($autotable_sw, y)
-                    end
-                    if not press_x.nil?
-                        w, pos_x, pos_y = $autotable.window.pointer
-                        $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
-                        update_selected.call
-                    end
-                end
-                if y > $autotable_sw.vadjustment.value + $autotable_sw.vadjustment.page_size
-                    if pos_x
-                        $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
-                    end
-                    if $button1_pressed_autotable || press_x
-                        scroll_lower($autotable_sw, y)
+            if ! $autotable.window.nil?
+                w, x, y, mask = $autotable.window.pointer
+                if mask & Gdk::Window::BUTTON1_MASK != 0
+                    if y < $autotable_sw.vadjustment.value
+                        if pos_x
+                            $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
+                        end
+                        if $button1_pressed_autotable || press_x
+                            scroll_upper($autotable_sw, y)
+                        end
+                        if not press_x.nil?
+                            w, pos_x, pos_y = $autotable.window.pointer
+                            $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
+                            update_selected.call
+                        end
                     end
-                    if not press_x.nil?
-                        w, pos_x, pos_y = $autotable.window.pointer
-                        $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
-                        update_selected.call
+                    if y > $autotable_sw.vadjustment.value + $autotable_sw.vadjustment.page_size
+                        if pos_x
+                            $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
+                        end
+                        if $button1_pressed_autotable || press_x
+                            scroll_lower($autotable_sw, y)
+                        end
+                        if not press_x.nil?
+                            w, pos_x, pos_y = $autotable.window.pointer
+                            $autotable.window.draw_lines(gc, [[press_x, press_y], [pos_x, press_y], [pos_x, pos_y], [press_x, pos_y], [press_x, press_y]])
+                            update_selected.call
+                        end
                     end
                 end
             end
-            true
+            ! $autotable.window.nil?
         }
     }
 
@@ -1850,7 +1852,7 @@ def save_changes(*forced)
 
     $xmldir.delete_attribute('already-generated')
 
-    propagate_children = Proc.new { |xmldir|
+    propagate_children = proc { |xmldir|
         if xmldir.attributes['subdirs-caption']
             xmldir.delete_attribute('already-generated')
         end
@@ -2002,12 +2004,12 @@ def remove_all_captions
         $name2widgets[File.basename(path)][:textview].buffer.text = ''
     }
     save_undo(_("remove all captions"),
-              Proc.new { |texts|
+              proc { |texts|
                   texts.each_key { |key|
                       $name2widgets[key][:textview].buffer.text = texts[key]
                   }
                   $notebook.set_page(1)
-                  Proc.new {
+                  proc {
                       texts.each_key { |key|
                           $name2widgets[key][:textview].buffer.text = ''
                       }
@@ -2046,7 +2048,7 @@ def change_dir
     subalbums_counter = 0
     subalbums_edits_bypos = {}
 
-    add_subalbum = Proc.new { |xmldir, counter|
+    add_subalbum = proc { |xmldir, counter|
         $subalbums_edits[xmldir.attributes['path']] = { :position => counter }
         subalbums_edits_bypos[counter] = $subalbums_edits[xmldir.attributes['path']]
         if xmldir == $xmldir
@@ -2085,7 +2087,7 @@ def change_dir
         $subalbums.attach(Gtk::Alignment.new(0, 0.5, 0.5, 0).add(frame),
                           1, 2, current_y_sub_albums, current_y_sub_albums + 1, Gtk::FILL, Gtk::FILL, 2, 2)
 
-        change_image = Proc.new {
+        change_image = proc {
             fc = Gtk::FileChooserDialog.new(utf8(_("Select image for caption")),
                                             nil,
                                             Gtk::FileChooser::ACTION_OPEN,
@@ -2116,7 +2118,7 @@ def change_dir
 
                 new_file = fc.filename
                 msg 3, "new captionfile is: #{fc.filename}"
-                perform_changefile = Proc.new {
+                perform_changefile = proc {
                     $subalbums_edits[xmldir.attributes['path']][:captionfile] = captionfile = new_file
                     $modified_pixbufs.delete(thumbnail_file)
                     xmldir.delete_attribute("#{infotype}-rotate")
@@ -2128,7 +2130,7 @@ def change_dir
                 perform_changefile.call
 
                 save_undo(_("change caption file for sub-album"),
-                          Proc.new {
+                          proc {
                               $subalbums_edits[xmldir.attributes['path']][:captionfile] = captionfile = old_file
                               xmldir.add_attribute("#{infotype}-rotate", old_rotate)
                               xmldir.add_attribute("#{infotype}-color-swap", old_color_swap)
@@ -2136,7 +2138,7 @@ def change_dir
                               xmldir.add_attribute("#{infotype}-frame-offset", old_frame_offset)
                               my_gen_real_thumbnail.call
                               $notebook.set_page(0)
-                              Proc.new {
+                              proc {
                                   perform_changefile.call
                                   $notebook.set_page(0)
                               }
@@ -2145,12 +2147,12 @@ def change_dir
             fc.destroy
         }
 
-        rotate_and_cleanup = Proc.new { |angle|
+        rotate_and_cleanup = proc { |angle|
             rotate(angle, thumbnail_file, img, xmldir, "#{infotype}-", $default_albums_thumbnails[:x], $default_albums_thumbnails[:y])
             system("rm -f '#{thumbnail_file}'")
         }
 
-        move = Proc.new { |direction|
+        move = proc { |direction|
             $modified = true
 
             save_changes('forced')
@@ -2195,37 +2197,37 @@ def change_dir
             $albums_tv.selection.select_path(sel[0])
         }
 
-        color_swap_and_cleanup = Proc.new {
-            perform_color_swap_and_cleanup = Proc.new {
+        color_swap_and_cleanup = proc {
+            perform_color_swap_and_cleanup = proc {
                 color_swap(xmldir, "#{infotype}-")
                 my_gen_real_thumbnail.call
             }
             perform_color_swap_and_cleanup.call
 
             save_undo(_("color swap"),
-                      Proc.new {
+                      proc {
                           perform_color_swap_and_cleanup.call
                           $notebook.set_page(0)
-                          Proc.new {
+                          proc {
                               perform_color_swap_and_cleanup.call
                               $notebook.set_page(0)
                           }
                       })
         }
 
-        change_frame_offset_and_cleanup = Proc.new {
+        change_frame_offset_and_cleanup = proc {
             if values = ask_new_frame_offset(xmldir, "#{infotype}-")
-                perform_change_frame_offset_and_cleanup = Proc.new { |val|
+                perform_change_frame_offset_and_cleanup = proc { |val|
                     change_frame_offset(xmldir, "#{infotype}-", val)
                     my_gen_real_thumbnail.call
                 }
                 perform_change_frame_offset_and_cleanup.call(values[:new])
 
                 save_undo(_("specify frame offset"),
-                          Proc.new {
+                          proc {
                               perform_change_frame_offset_and_cleanup.call(values[:old])
                               $notebook.set_page(0)
-                              Proc.new {
+                              proc {
                                   perform_change_frame_offset_and_cleanup.call(values[:new])
                                   $notebook.set_page(0)
                               }
@@ -2233,10 +2235,10 @@ def change_dir
             end
         }
 
-        whitebalance_and_cleanup = Proc.new {
+        whitebalance_and_cleanup = proc {
             if values = ask_whitebalance(captionfile, thumbnail_file, img, xmldir, "#{infotype}-",
                                          $default_albums_thumbnails[:x], $default_albums_thumbnails[:y], infotype)
-                perform_change_whitebalance_and_cleanup = Proc.new { |val|
+                perform_change_whitebalance_and_cleanup = proc { |val|
                     change_whitebalance(xmldir, "#{infotype}-", val)
                     recalc_whitebalance(val, captionfile, thumbnail_file, img, xmldir, "#{infotype}-",
                                         $default_albums_thumbnails[:x], $default_albums_thumbnails[:y], infotype)
@@ -2245,10 +2247,10 @@ def change_dir
                 perform_change_whitebalance_and_cleanup.call(values[:new])
                 
                 save_undo(_("fix white balance"),
-                          Proc.new {
+                          proc {
                               perform_change_whitebalance_and_cleanup.call(values[:old])
                               $notebook.set_page(0)
-                              Proc.new {
+                              proc {
                                   perform_change_whitebalance_and_cleanup.call(values[:new])
                                   $notebook.set_page(0)
                               }
@@ -2256,8 +2258,8 @@ def change_dir
             end
         }
 
-        enhance_and_cleanup = Proc.new {
-            perform_enhance_and_cleanup = Proc.new {
+        enhance_and_cleanup = proc {
+            perform_enhance_and_cleanup = proc {
                 enhance(xmldir, "#{infotype}-")
                 my_gen_real_thumbnail.call
             }
@@ -2265,10 +2267,10 @@ def change_dir
             perform_enhance_and_cleanup.call
             
             save_undo(_("enhance"),
-                      Proc.new {
+                      proc {
                           perform_enhance_and_cleanup.call
                           $notebook.set_page(0)
-                          Proc.new {
+                          proc {
                               perform_enhance_and_cleanup.call
                               $notebook.set_page(0)
                           }
@@ -2423,7 +2425,7 @@ def theme_choose(current)
 end
 
 def show_password_protections
-    examine_dir_elem = Proc.new { |parent_iter, xmldir, already_protected|
+    examine_dir_elem = proc { |parent_iter, xmldir, already_protected|
         child_iter = $albums_iters[xmldir.attributes['path']]
         if xmldir.attributes['password-protect']
             child_iter[2] = pixbuf_or_nil("#{$FPATH}/images/galeon-secure.png")
@@ -2463,7 +2465,7 @@ def populate_subalbums_treeview(select_first)
         return
     end
 
-    append_dir_elem = Proc.new { |parent_iter, xmldir|
+    append_dir_elem = proc { |parent_iter, xmldir|
         child_iter = $albums_ts.append(parent_iter)
         child_iter[0] = File.basename(xmldir.attributes['path'])
         child_iter[1] = xmldir.attributes['path']
@@ -2700,7 +2702,7 @@ def new_album
 
     src_nb_calculated_for = ''
     src_nb_thread = nil
-    process_src_nb = Proc.new {
+    process_src_nb = proc {
         if src.text != src_nb_calculated_for
             src_nb_calculated_for = src.text
             if src_nb_thread
@@ -3735,7 +3737,7 @@ French: Guillaume Cottenceau')),
     $redo_tb.signal_connect('clicked')  { perform_redo }
     $redo_mb.signal_connect('activate') { perform_redo }
 
-    one_click_explain_try = Proc.new {
+    one_click_explain_try = proc {
         if !$config['one-click-explained']
             show_one_click_explanation(_("You have just clicked on a One-Click tool."))
             $config['one-click-explained'] = true
@@ -3939,13 +3941,13 @@ below the Document Root), and specify this location in the password protect dial
                 $xmldir.add_attribute('password-protect', newval)
             end
             save_undo(_("set password protection for %s") % File.basename($current_path),
-                      Proc.new {
+                      proc {
                           if value.nil?
                               $xmldir.delete_attribute('password-protect')
                           else
                               $xmldir.add_attribute('password-protect', value)
                           end
-                          Proc.new {
+                          proc {
                               if newval.nil?
                                   $xmldir.delete_attribute('password-protect')
                               else