do not grab focus if other widgets are provided, since it's
authorGuillaume Cottenceau <gcottenc@gmail.com>
Sat, 14 Feb 2009 13:50:46 +0000 (14:50 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Sat, 14 Feb 2009 13:50:46 +0000 (14:50 +0100)
probable having the focus on them will make it possible to
interact with them

bin/booh-classifier

index 04b4521..b64e803 100755 (executable)
@@ -807,10 +807,16 @@ def show_popup(parent, msg, *options)
         dialog.vbox.add(options[:bottomwidget])
     end
     if options[:okcancel]
-        dialog.add_button(Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL).grab_focus
+        cancel = dialog.add_button(Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL)
+        if ! options[:bottomwidget]
+            cancel.grab_focus
+        end
         dialog.add_button(Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK)
     else
-        dialog.add_button(Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK).grab_focus
+        ok = dialog.add_button(Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK).grab_focus
+        if ! options[:bottomwidget]
+            ok.grab_focus
+        end
     end
 
     if options[:pos_centered]