diff options
author | Vincent Untz <vuntz@gnome.org> | 2008-02-21 14:14:00 +0000 |
---|---|---|
committer | Vincent Untz <vuntz@src.gnome.org> | 2008-02-21 14:14:00 +0000 |
commit | be25fa77ebf1c79f674147607688af80dd7b9157 (patch) | |
tree | e8798fdea28a906312a86d52bf8297b440cbdda8 /src/nautilus-connect-server-dialog-main.c | |
parent | 9a5a936cb7200b245e97f5b4d3652a6a9d43f648 (diff) | |
download | nautilus-be25fa77ebf1c79f674147607688af80dd7b9157.tar.gz |
Bring back the Connect to dialog. It still needs some work, but it's
2008-02-21 Vincent Untz <vuntz@gnome.org>
Bring back the Connect to dialog. It still needs some work, but it's
better than nothing.
* libnautilus-private/nautilus-bookmark.c: (nautilus_bookmark_new):
Actually save the name in the bookmark, instead of forgetting it.
* src/Makefile.am: Updated to build the connect dialog stuff.
* src/nautilus-connect-server-dialog-main.c: (show_uri),
(nautilus_connect_server_dialog_present_uri), (main):
Port to gio. We use g_app_info_launch_default_for_uri() to open the
URI, but it will need some more work because it doesn't automount the
URI.
* src/nautilus-connect-server-dialog-nonmain.c:
(nautilus_connect_server_dialog_present_uri): Trivial update.
* src/nautilus-connect-server-dialog.[ch]: (get_method_description),
(nautilus_connect_server_dialog_finalize), (connect_to_server),
(response_callback), (setup_for_type), (display_server_location),
(nautilus_connect_server_dialog_init),
(nautilus_connect_server_dialog_new): Port to gio. Add bookmark saving
feature, to replace the old gnome-vfs network volumes. Remove the
Browse button, which isn't really needed there. Needs some more polish.
* src/nautilus-shell-ui.xml: Uncomment the "Connect to" action
* src/nautilus-window-menus.c: (action_connect_to_server_callback):
Uncomment code to make use of the dialog
svn path=/trunk/; revision=13797
Diffstat (limited to 'src/nautilus-connect-server-dialog-main.c')
-rw-r--r-- | src/nautilus-connect-server-dialog-main.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/nautilus-connect-server-dialog-main.c b/src/nautilus-connect-server-dialog-main.c index d86cd694d..8b409981b 100644 --- a/src/nautilus-connect-server-dialog-main.c +++ b/src/nautilus-connect-server-dialog-main.c @@ -33,9 +33,9 @@ #include <libgnome/gnome-program.h> #include <libgnomeui/gnome-ui-init.h> -#include <libgnomeui/gnome-url.h> #include <libgnomeui/gnome-authentication-manager.h> +#include <eel/eel-app-launch-context.h> #include <eel/eel-preferences.h> #include <eel/eel-stock-dialogs.h> @@ -61,9 +61,18 @@ show_uri (const char *uri, GtkDialog *error_dialog; GError *error; char *error_message; + EelAppLaunchContext *launch_context; + + launch_context = eel_app_launch_context_new (); + eel_app_launch_context_set_screen (launch_context, screen); error = NULL; - gnome_url_show_on_screen (uri, screen, &error); + /* FIXME: doesn't automount */ + g_app_info_launch_default_for_uri (uri, + G_APP_LAUNCH_CONTEXT (launch_context), + &error); + + g_object_unref (launch_context); if (error) { error_message = g_strdup_printf (_("Can't display location \"%s\""), @@ -87,10 +96,14 @@ show_uri (const char *uri, void nautilus_connect_server_dialog_present_uri (NautilusApplication *application, - const char *uri, + GFile *location, GtkWidget *widget) { + char *uri; + + uri = g_file_get_uri (location); show_uri (uri, gtk_widget_get_screen (widget)); + g_free (uri); } int @@ -100,6 +113,7 @@ main (int argc, char *argv[]) GtkWidget *dialog; GOptionContext *context; const char **args; + GFile *location; const GOptionEntry options[] = { { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &args, NULL, N_("[URI]") }, { NULL } @@ -130,7 +144,16 @@ main (int argc, char *argv[]) /* command line arguments, null terminated array */ - dialog = nautilus_connect_server_dialog_new (NULL, args != NULL ? *args : NULL); + location = NULL; + if (args) { + location = g_file_new_for_commandline_arg (*args); + } + + dialog = nautilus_connect_server_dialog_new (NULL, location); + + if (location) { + g_object_unref (location); + } open_dialogs = 1; g_signal_connect (dialog, "destroy", |