GNOME Bugzilla – Bug 521032
No password dialog when mounting from file chooser
Last modified: 2009-05-03 14:54:06 UTC
When you access an ftp share from within the file chooser and it is not mounted, you will get an error message because apparently the password dialog is auto-canceled and so no password is supplied.
Created attachment 106797 [details] Screenshot
Created attachment 108183 [details] [review] gio-filechooser-dialog-support.patch First version of the patch adding support for password and question dialogs. Still requires more work to fix double questions plus some polishing.
Created attachment 108933 [details] [review] gio-filechooser-dialog-support.diff Updated patch incorporating threading fixes and adding basic support for avoiding double questions. Since the return values from gio-filechooser are checked in gtk+ part of filechooser and to avoid need for linking libgio just because of the G_IO_ERROR quark, I decided to mask G_IO_ERROR/G_IO_ERROR_PERMISSION_DENIED as glib's G_FILE_ERROR/G_FILE_ERROR_INTR, keeping the original string message. This value is then checked in gtk+ part of filechooser and stops further actions when mount operation is cancelled.
Created attachment 108934 [details] [review] gtk-filechooser-cancel-mount-support.diff This is a patch for gtk+ library. It's optional and not required for correct filechooser operation. It just stops more actions in the filechooser window when authentication dialog was cancelled.
Created attachment 108937 [details] [review] gio-filechooser-dialog-support-2.diff Fix wrong unref in gtk_file_system_gio_volume_mount()
Comment on attachment 108937 [details] [review] gio-filechooser-dialog-support-2.diff >+ /* This is a dirty hack to indicate gtk+ that user has cancelled the password dialog. >+ * Trying to avoid checking G_IO_ERROR values in gtkfilechooserdefault.c directly >+ * which would cause a need to link libgio to gtk lib. */ >+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED)) { >+ error->domain = G_FILE_ERROR; >+ error->code = G_FILE_ERROR_INTR; >+ } >+ What's the problem with linking libgtk to libgio when libgio is in glib? I thought the whole point was to make the higher layers use whatever functionality is in the lower level libs not add hacks like this further up in the dependency chain? Maybe I'm missing something obvious? :-)
Federico, is this ok to commit?
Thomas, is the gtk+ part still relevant? I think the code in this area has changed since you posted the patch.
No comments in ages and file chooser was moved out of libgnomeui. Closing.