can quit during loading
authorgc <gc>
Tue, 1 Apr 2008 21:56:37 +0000 (21:56 +0000)
committergc <gc>
Tue, 1 Apr 2008 21:56:37 +0000 (21:56 +0000)
bin/booh-classifier

index 840e5be..e932df4 100644 (file)
@@ -1056,6 +1056,9 @@ def show_entries(allentries)
         end
         $loading_progressbar.fraction = i.to_f / allentries.size
         $loading_progressbar.text = utf8(_("Loading... %d%") % (100 * $loading_progressbar.fraction))
+        if $quit
+            return
+        end
     end
     if i <= $config['preload-distance'].to_i * 2
         #- not yet preloaded correctly
@@ -1173,6 +1176,7 @@ end
 
 def try_quit(*options)
     Gtk.main_quit
+    $quit = true
 end
 
 def execute
@@ -1472,7 +1476,7 @@ def preferences
                0, 1, table_y, table_y + 1, Gtk::FILL, Gtk::SHRINK, 2, 2)
     tbl.attach(Gtk::Alignment.new(0, 0.5, 1, 0).add(thumbnails_height = Gtk::SpinButton.new(32, 256, 16).set_value($config['thumbnails-height'].to_i)),
                1, 2, table_y, table_y + 1, Gtk::FILL, Gtk::SHRINK, 2, 2)
-    tooltips.set_tip(thumbnails_height, utf8(_("The desired height for the thumbnails line on the bottom")), nil)
+    tooltips.set_tip(thumbnails_height, utf8(_("The desired height of the thumbnails in the thumbnails line of the bottom")), nil)
 
     table_y += 1
     tbl.attach(Gtk::Alignment.new(1, 0.5, 0, 0).add(Gtk::Label.new.set_markup(utf8(_("Preloading distance: ")))),
@@ -1693,7 +1697,7 @@ def create_main_window
     main_vbox.pack_start($imagesline_sw, false, false)
     main_vbox.pack_end($statusbar = Gtk::Statusbar.new, false, false)
 
-    $imagesline.set_size_request(-1, Gtk::Button.new.size_request[1] + Entry.thumbnails_height + 15)
+    $imagesline.set_size_request(-1, Gtk::Button.new.size_request[1] + Entry.thumbnails_height + Entry.thumbnails_height/4)
 
     $main_window = create_window
     $main_window.add(main_vbox)
@@ -1737,7 +1741,10 @@ if ARGV[0]
     if msg = open_dir(*ARGV)
         puts msg
     else
-        show_entries($allentries)
+        Gtk.idle_add {
+            show_entries($allentries)
+            false
+        }
     end
 end
 Gtk.main