file chooser dialog for file/open and execute/move by default on working dir; execute...
authorgc <gc>
Sat, 14 Jul 2007 14:17:19 +0000 (14:17 +0000)
committergc <gc>
Sat, 14 Jul 2007 14:17:19 +0000 (14:17 +0000)
bin/booh-classifier

index fddab2722c7fbbc6bbabe67edb8d06b623ad733d..5f5415a8959e5a3a5fab4e451dcd89f9e78beb1d 100644 (file)
@@ -757,6 +757,7 @@ def open_dir(path)
             end
         }
     }
+    $workingdir = path
     show_entries
     $execute.sensitive = true
     return nil
@@ -769,6 +770,9 @@ def open_dir_popup
                                     nil,
                                     [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT], [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL])
     fc.transient_for = $main_window
+    if $workingdir
+        fc.current_folder = $workingdir
+    end
     ok = false
     while !ok
         if fc.run == Gtk::Dialog::RESPONSE_ACCEPT
@@ -865,6 +869,7 @@ 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,
@@ -872,9 +877,11 @@ def execute
                                                 nil,
                                                 [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT], [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL])
                 fc.transient_for = dialog
+                fc.current_folder = lastpath
                 if fc.run == Gtk::Dialog::RESPONSE_ACCEPT
                     pathlabel.text = fc.filename
-                end    
+                end
+                lastpath = fc.filename
                 fc.destroy
             }
             combo.signal_connect('changed') {