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 584871 - Make it easier for 3rd party programs to call nautilus-connect-server
Make it easier for 3rd party programs to call nautilus-connect-server
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
0.x.x [obsolete]
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-04 20:57 UTC by Michael Terry
Modified: 2010-12-03 14:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (2.11 KB, patch)
2009-06-04 20:57 UTC, Michael Terry
needs-work Details | Review
as print-uri (2.07 KB, patch)
2009-10-11 17:10 UTC, Michael Terry
needs-work Details | Review
Rebased patch (2.52 KB, patch)
2010-11-27 04:41 UTC, Michael Terry
accepted-commit_now Details | Review

Description Michael Terry 2009-06-04 20:57:05 UTC
Hello!  I maintain a program that lets the user backup to a destination, including a remote GIO-supplied URL.  So I use a GtkFileChooserButton and all that jazz.  I also add a 'Connect to Server...' button that launches nautilus-connect-server (rather than writing that UI myself).

There are a couple niceties that would make the integration with nautilus-connect-server much better:

1) Feedback about which URI the user chose (this way, I can set the GtkFileChooserButton rather than relying on the user to choose the same thing he/she just entered in a dialog).

2) An option to not open nautilus after connecting.  The user is interacting with my program, not nautilus.  The popup is distracting.

Attached is a patch to do both those things (prints URI on stdout and adds a command line option to not open nautilus).
Comment 1 Michael Terry 2009-06-04 20:57:42 UTC
Created attachment 135988 [details] [review]
Proposed patch
Comment 2 Cosimo Cecchi 2009-10-07 15:23:38 UTC
Comment on attachment 135988 [details] [review]
Proposed patch

This is a good idea, thanks for the patch.

>+	/* Print URI to console for the benefit of any programs that launched us. */
>+	g_print ("%s\n", uri);

It should probably print the URI only if the file manager wasn't launched, no?

>+		{ "no-open", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &open_in_nautilus, N_("Do not open a nautilus window once connected"), NULL },

I'd turn that into a --print-uri option, with description "Do not open a file manager window once connected, but print the URI".
Comment 3 Michael Terry 2009-10-11 17:10:39 UTC
Created attachment 145248 [details] [review]
as print-uri

Try this!
Comment 4 Cosimo Cecchi 2010-11-26 13:30:56 UTC
Review of attachment 145248 [details] [review]:

Hi Michael, sorry for not getting back at this earlier.
I changed the connect to server dialog some weeks ago to make it more user-friendly and your patch does not apply anymore now. Could you please update it to git master?
Comment 5 Michael Terry 2010-11-27 04:41:32 UTC
Created attachment 175336 [details] [review]
Rebased patch

Here's a new version
Comment 6 Cosimo Cecchi 2010-12-02 02:03:41 UTC
Review of attachment 175336 [details] [review]:

Thanks, looks good!
Do you have a GNOME git account? If so, feel free to push to master, otherwise I'll do it for you.
Comment 7 Michael Terry 2010-12-03 14:08:07 UTC
commit 2a20b38c4dc870d8f3a85dae222c125a77f40229
Author: Michael Terry <mike@mterry.name>
Date:   Fri Nov 26 23:39:58 2010 -0500

    Add --print-uri option