From 2218501731180797c5e29ce677f31fd2b2d3ecea Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 06:11:08 +0200 Subject: [connect-dialog] handle psswds, display warns/errs in info bar, tweak UI details connect-dialog: integrate password handling Also, use the info bar to display warnings/errors, and tweak the UI details. http://git.gnome.org/browse/nautilus/commit/?id=7d004452f333b7b8b804d87de49c858e8743a115 --- src/caja-connect-server-dialog-nonmain.c | 76 ++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 18 deletions(-) (limited to 'src/caja-connect-server-dialog-nonmain.c') diff --git a/src/caja-connect-server-dialog-nonmain.c b/src/caja-connect-server-dialog-nonmain.c index 0f196ca0..78015f3e 100644 --- a/src/caja-connect-server-dialog-nonmain.c +++ b/src/caja-connect-server-dialog-nonmain.c @@ -31,29 +31,69 @@ * caja-connect-server-dialog-main.c for the standalone version. */ +static GSimpleAsyncResult *display_location_res = NULL; + +static void +window_go_to_cb (CajaWindow *window, + GError *error, + gpointer user_data) +{ + CajaConnectServerDialog *self; + + self = user_data; + + if (error != NULL) { + g_simple_async_result_set_from_error (display_location_res, error); + } + + g_simple_async_result_complete (display_location_res); + + g_object_unref (display_location_res); + display_location_res = NULL; +} + +gboolean +caja_connect_server_dialog_display_location_finish (CajaConnectServerDialog *self, + GAsyncResult *res, + GError **error) +{ + if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) { + return FALSE; + } + + return TRUE; +} + void -caja_connect_server_dialog_present_uri (CajaApplication *application, - GFile *location, - GtkWidget *widget) +caja_connect_server_dialog_display_location_async (CajaConnectServerDialog *self, + CajaApplication *application, + GFile *location, + GAsyncReadyCallback callback, + gpointer user_data) { CajaWindow *window; + GtkWidget *widget; + + widget = GTK_WIDGET (self); - if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_ALWAYS_USE_BROWSER)) - { + display_location_res = + g_simple_async_result_new (G_OBJECT (self), + callback, user_data, + caja_connect_server_dialog_display_location_async); + + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_ALWAYS_USE_BROWSER)) { window = caja_application_create_navigation_window (application, - NULL, - gtk_widget_get_screen (widget)); - caja_window_go_to (window, location); - } - else - { - caja_application_present_spatial_window (application, - NULL, - NULL, - location, - gtk_widget_get_screen (widget)); + NULL, + gtk_widget_get_screen (widget)); + } else { + window = caja_application_get_spatial_window (application, + NULL, + NULL, + location, + gtk_widget_get_screen (widget), + NULL); } - gtk_widget_destroy (widget); - g_object_unref (location); + caja_window_go_to_full (window, location, + window_go_to_cb, self); } -- cgit v1.2.1