After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 521032 - No password dialog when mounting from file chooser
No password dialog when mounting from file chooser
Status: RESOLVED OBSOLETE
Product: libgnomeui
Classification: Deprecated
Component: gio-file-chooser
CVS HEAD
Other Linux
: Normal normal
: future
Assigned To: Carlos Garnacho
Carlos Garnacho
Depends on:
Blocks:
 
 
Reported: 2008-03-07 17:23 UTC by Michael Monreal
Modified: 2009-05-03 14:54 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Screenshot (24.80 KB, image/png)
2008-03-07 17:24 UTC, Michael Monreal
  Details
gio-filechooser-dialog-support.patch (5.99 KB, patch)
2008-03-28 15:59 UTC, Tomas Bzatek
none Details | Review
gio-filechooser-dialog-support.diff (6.92 KB, patch)
2008-04-09 16:16 UTC, Tomas Bzatek
none Details | Review
gtk-filechooser-cancel-mount-support.diff (447 bytes, patch)
2008-04-09 16:18 UTC, Tomas Bzatek
none Details | Review
gio-filechooser-dialog-support-2.diff (7.24 KB, patch)
2008-04-09 16:29 UTC, Tomas Bzatek
none Details | Review

Description Michael Monreal 2008-03-07 17:23:53 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.
Comment 1 Michael Monreal 2008-03-07 17:24:42 UTC
Created attachment 106797 [details]
Screenshot
Comment 2 Tomas Bzatek 2008-03-28 15:59:28 UTC
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.
Comment 3 Tomas Bzatek 2008-04-09 16:16:45 UTC
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.
Comment 4 Tomas Bzatek 2008-04-09 16:18:26 UTC
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.
Comment 5 Tomas Bzatek 2008-04-09 16:29:20 UTC
Created attachment 108937 [details] [review]
gio-filechooser-dialog-support-2.diff

Fix wrong unref in gtk_file_system_gio_volume_mount()
Comment 6 Kjartan Maraas 2008-04-23 08:14:02 UTC
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? :-)
Comment 7 Kjartan Maraas 2008-08-28 08:54:55 UTC
Federico, is this ok to commit?
Comment 8 Kjartan Maraas 2008-08-28 09:11:43 UTC
Thomas, is the gtk+ part still relevant? I think the code in this area has changed since you posted the patch.
Comment 9 Kjartan Maraas 2009-05-03 14:54:06 UTC
No comments in ages and file chooser was moved out of libgnomeui. Closing.