*** empty log message ***
authorgc <gc>
Sat, 1 Mar 2008 00:17:19 +0000 (00:17 +0000)
committergc <gc>
Sat, 1 Mar 2008 00:17:19 +0000 (00:17 +0000)
bin/booh
bin/booh-classifier

index 4127984f497345fa0e92d1b0b0fac09ab8d4c6a8..9376cc2956f789bbeb474c0e5b8200d26bd7810f 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -4305,52 +4305,6 @@ end
 handle_options
 
 
-#- rexml sanity check (bugs in ruby 1.8.4, ruby 1.8.6)
-xmldoc = Document.new("<test/>")
-xmldoc << XMLDecl.new(XMLDecl::DEFAULT_VERSION, "UTF-8")
-content = ['61c3a927223c3e26'].pack("H*")  #- is some UTF-8 text but just to make sure my editor won't magically convert..
-xmldoc.root.add_attribute('attr', content)
-out = []
-xmldoc.write(out, 0)
-
-xmldoc = REXML::Document.new(out.join)
-sanity1 = xmldoc.root.attributes['attr']
-out = []
-xmldoc.write(out, 0)
-
-xmldoc = REXML::Document.new(out.join)
-sanity2 = xmldoc.root.attributes['attr']
-out = []
-xmldoc.write(out, 0)
-
-msg 3, "REXML sanity outcome: sanity1=#{sanity1}, sanity2=#{sanity2}"
-
-if sanity1 != sanity2
-    puts _("REXML sanity check failed (this is normal with unpatched ruby-1.8.4 or ruby-1.8.6, which ship a broken REXML). For safeness, won't proceed.")
-    exit 1
-end
-
-
-#- rexml sanity check again (bug in ruby 1.8.6-p111)
-xmldoc = Document.new "<booh/>"
-xmldoc << XMLDecl.new(XMLDecl::DEFAULT_VERSION, 'UTF-8')
-elem = xmldoc.root.add_element('elem')
-elem.add_text('cdata')
-tmp = Tempfile.new("sanitytemp")
-tmp.close!
-ios = File.open(sanity_filename = tmp.path, File::RDWR|File::CREAT|File::EXCL)
-xmldoc.write(ios, 0)
-ios.close
-
-xmldoc = Document.new(File.new(sanity_filename))
-File.delete(sanity_filename)
-if xmldoc.root.elements['elem'].get_text.value != 'cdata'
-    puts _("REXML sanity check failed (this is normal with unpatched ruby-1.8.6-p111, which ships a broken REXML). For safeness, won't proceed.")
-    puts "Notice for bug reporting: REXML has version: #{REXML::VERSION} at date: #{REXML::DATE}."
-    exit 1
-end
-
-
 Thread.abort_on_exception = true
 
 read_config
index 715912cbb9d7f9a5028b3abc1e439edb60cb1198..ee7ca7b0cb28e065ce080502edfac24c8e71132a 100644 (file)
@@ -900,6 +900,7 @@ def thumbnail_keypressed(entry, event)
                             label = Label.new(text)
                             label.color = color
                             $labels[char] = label
+                            $ordered_labels << label
                             lbl = Gtk::Label.new.set_markup('<b>(' + char + ')</b>' + text[1..-1]).set_justify(Gtk::Justification::CENTER)
                             $labels_vbox.pack_start(label.button = Gtk::CheckButton.new.add(evt = Gtk::EventBox.new.add(lbl)).show_all)
                             label.button.active = true
@@ -1150,6 +1151,8 @@ def execute
     label = Gtk::Label.new.set_markup(utf8(_("You're about to <b>execute</b> actions on the marked images.\nPlease confirm below the actions. You cannot undo this operation!")))
     vb1.pack_start(label, false, false)
 
+    lastpath = $workingdir
+
     table = Gtk::Table.new(0, 0, false)
     table.set_row_spacings(5)
     table.set_column_spacings(5)
@@ -1209,7 +1212,6 @@ def execute
 
         if normal
             pathbutton = Gtk::Button.new.add(pathlabel = Gtk::Label.new.set_markup(utf8(_("<i>(unset)</i>"))))
-            lastpath = $workingdir
             pathbutton.signal_connect('clicked') {
                 fc = Gtk::FileChooserDialog.new(utf8(_("Specify the directory where to move the pictures to")),
                                                 nil,
@@ -1220,6 +1222,7 @@ def execute
                 fc.current_folder = lastpath
                 if fc.run == Gtk::Dialog::RESPONSE_ACCEPT
                     pathlabel.text = fc.filename
+                    pathlabel.set_alignment(0, 0.5)
                 end
                 lastpath = fc.filename
                 fc.destroy
@@ -1239,7 +1242,7 @@ def execute
     }
     stuff = {}
     stuff['toremove'] = add_row.call(1, utf8(_("<i>to remove</i>")), $color_red, proc { |entry| entry.removed }, false)
-    $labels.values.each_with_index { |label, row| stuff[label] = add_row.call(row + 2, label.name, label.color, proc { |entry| entry.labeled == label }, true) }
+    $ordered_labels.each_with_index { |label, row| stuff[label] = add_row.call(row + 2, label.name, label.color, proc { |entry| entry.labeled == label }, true) }
     vb1.pack_start(sw = Gtk::ScrolledWindow.new(nil, nil).add_with_viewport(table).set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC), true, true)
 
     toremove_amount = $allentries.find_all { |entry| entry.removed }.size
@@ -1597,6 +1600,7 @@ def reset_labels
     end
     $labels_vbox.pack_start(Gtk::Label.new(utf8(_("Labels list:"))).set_justify(Gtk::Justification::CENTER), false, false).show_all
     $labels = {}
+    $ordered_labels = []
     lbl = Gtk::Label.new.set_markup(utf8(_("<i>unlabelled</i>")))
     $labels_vbox.pack_start($unlabelled_button = Gtk::CheckButton.new.add(Gtk::EventBox.new.add(lbl)).show_all)
     $unlabelled_button.active = true