GNOME Bugzilla – Bug 695216
GtkFileChooserButton doesn't update properly on combo box changes
Last modified: 2013-05-13 02:47:57 UTC
Currently, when you select a folder from the combo box, GtkFileChooserButton emits current-folder-changed but gtk_file_chooser_get_current_file() does not return the new location. The following python thing demonstrates the problem: #!/usr/bin/env python from gi.repository import Gtk, GLib w = Gtk.Window() fcb = Gtk.FileChooserButton(title="hi", action=Gtk.FileChooserAction.SELECT_FOLDER) w.add(fcb) w.show_all() def changed(fcb): print fcb.get_current_folder_uri() fcb.connect("current-folder-changed", changed) ml = GLib.MainLoop() ml.run() When you select a folder from the combo box, it just prints 'None' rather than the folder selected. I think this is because combo_box_changed_cb updates the internal dialog but not the file chooser button itself. The update methods either update the internal dialog or ensure it will be updated when it becomes active, so I can't see why it would update the internal dialog here.
Created attachment 238133 [details] [review] update the button's state, not the internal dialog's state This makes things work properly for me, and doesn't break any of the tests.
See also bug 696498, which describes a similar (possibly duplicate) problem.
This change has already been made in master