2008-04-30 Cosimo Cecchi <cosimoc@gnome.org>
[nautilus.git] / src / nautilus-connect-server-dialog-nonmain.c
blob885f6a190780ab7b479e4568a4145635844b9971
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
3 /*
4 * Nautilus
6 * Copyright (C) 2005 Red Hat, Inc.
8 * Nautilus is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * Nautilus is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program; see the file COPYING. If not,
20 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #include <config.h>
25 #include <gio/gio.h>
26 #include "nautilus-connect-server-dialog.h"
27 #include <libnautilus-private/nautilus-global-preferences.h>
29 /* This file contains the glue for the calls from the connect to server dialog
30 * to the main nautilus binary. A different version of this glue is in
31 * nautilus-connect-server-dialog-main.c for the standalone version.
34 void
35 nautilus_connect_server_dialog_present_uri (NautilusApplication *application,
36 GFile *location,
37 GtkWidget *widget)
39 NautilusWindow *window;
41 if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
42 window = nautilus_application_create_navigation_window (application,
43 NULL,
44 gtk_widget_get_screen (widget));
45 nautilus_window_go_to (window, location);
46 } else {
47 nautilus_application_present_spatial_window (application,
48 NULL,
49 NULL,
50 location,
51 gtk_widget_get_screen (widget));
54 gtk_widget_destroy (widget);
55 g_object_unref (location);