summaryrefslogtreecommitdiff
path: root/src/caja-connect-server-dialog-nonmain.c
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-27 06:11:08 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:45:51 +0200
commit2218501731180797c5e29ce677f31fd2b2d3ecea (patch)
tree95c65483458db3010cc112ee919e7f6c0c035a99 /src/caja-connect-server-dialog-nonmain.c
parenteade711fe26dc22391a60bc33f423817c39d9f43 (diff)
downloadcaja-2218501731180797c5e29ce677f31fd2b2d3ecea.tar.bz2
caja-2218501731180797c5e29ce677f31fd2b2d3ecea.tar.xz
[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
Diffstat (limited to 'src/caja-connect-server-dialog-nonmain.c')
-rw-r--r--src/caja-connect-server-dialog-nonmain.c76
1 files changed, 58 insertions, 18 deletions
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);
}