GNOME Bugzilla – Bug 314745
[patch] Choosing "Connect to server" from a 'remote' nautilus window should default to that URI.
Last modified: 2005-09-19 21:22:06 UTC
As a convenience feature, if I'm at a window displaying a remote location (URI) in nautilus, and then choose 'Connect to Server' from the menu, it should fill in the URI that I'm at by default. Note that usability is not be affected (by defaulting to a 'Custom' location) as most users will generally choose 'Connect to Server' from the 'Places' menu or their Home Folder or some such.
Created attachment 51488 [details] [review] Patch to add feature Note that we can't call nautilus_window_get_location because nautilus-window.c is not linked into the nautilus-connect-server binary. So instead I added a "location" property to the NautilusWindow object.
Thanks for your bug report and your efforts! One nitpick: Why don't you simply use nautilus_window_get_location instead of adding a GObject property?
Hmmm, I thought I explained that above. It's a linking problem: > Note that we can't call nautilus_window_get_location because > nautilus-window.c is not linked into the nautilus-connect-server > binary. So instead I added a "location" property to the > NautilusWindow object. Linking in nautilus-window.c would mean linking in a whole big bunch of other fun stuff. But we can go that way if it's required.
Sorry, you're completely right.
Its sort of strange the way you pass the uri via a property. Just add a new argument to nautilus_connect_server_dialog_new() instead. Also, gnome_vfs_uri_is_local() is the wrong call, as it returns FALSE for e.g. nfs shares. Just look for file: uris instead. You should probably filter out more locations, like network:, burn:, fonts:.
Made suggested changes: Changed to use an extra argument when calling nautilus_connect_server_dialog_new(). When looking for non applicable URIs checks: !gnome_vfs_uri_is_local() and not 'file:' URIs. I checked and yes, network:, burn:, fonts: etc.. all return TRUE from gnome_vfs_uri_is_local(). Committed: 2005-09-19 Nate Nielsen <nielsen@memberwebs.com> * nautilus-connect-server-dialog-main.c: (main): * nautilus-connect-server-dialog.h: * nautilus-connect-server-dialog.c: (nautilus_connect_server_dialog_new): * nautilus-window-menus.c: (action_connect_to_server_callback): Autofill "Connect to server" dialog where possible. Fixes #314745