nautilus-3.6.3/libnautilus-private/nautilus-global-preferences.c

No issues found

 1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 2 
 3 /* nautilus-global-preferences.c - Nautilus specific preference keys and
 4                                    functions.
 5 
 6    Copyright (C) 1999, 2000, 2001 Eazel, Inc.
 7 
 8    The Gnome Library is free software; you can redistribute it and/or
 9    modify it under the terms of the GNU Library 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.
12 
13    The Gnome Library 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    Library General Public License for more details.
17 
18    You should have received a copy of the GNU Library General Public
19    License along with the Gnome Library; see the file COPYING.LIB.  If not,
20    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21    Boston, MA 02111-1307, USA.
22 
23    Authors: Ramiro Estrugo <ramiro@eazel.com>
24 */
25 
26 #include <config.h>
27 #include "nautilus-global-preferences.h"
28 
29 #include "nautilus-file-utilities.h"
30 #include "nautilus-file.h"
31 #include <eel/eel-glib-extensions.h>
32 #include <eel/eel-gtk-extensions.h>
33 #include <eel/eel-stock-dialogs.h>
34 #include <eel/eel-string.h>
35 #include <glib/gi18n.h>
36 
37 /*
38  * Public functions
39  */
40 char *
41 nautilus_global_preferences_get_default_folder_viewer_preference_as_iid (void)
42 {
43 	int preference_value;
44 	const char *viewer_iid;
45 
46 	preference_value =
47 		g_settings_get_enum (nautilus_preferences, NAUTILUS_PREFERENCES_DEFAULT_FOLDER_VIEWER);
48 
49 	if (preference_value == NAUTILUS_DEFAULT_FOLDER_VIEWER_LIST_VIEW) {
50 		viewer_iid = NAUTILUS_LIST_VIEW_IID;
51 	} else {
52 		viewer_iid = NAUTILUS_CANVAS_VIEW_IID;
53 	}
54 
55 	return g_strdup (viewer_iid);
56 }
57 
58 void
59 nautilus_global_preferences_init (void)
60 {
61 	static gboolean initialized = FALSE;
62 
63 	if (initialized) {
64 		return;
65 	}
66 
67 	initialized = TRUE;
68 
69 	nautilus_preferences = g_settings_new("org.gnome.nautilus.preferences");
70 	nautilus_window_state = g_settings_new("org.gnome.nautilus.window-state");
71 	nautilus_icon_view_preferences = g_settings_new("org.gnome.nautilus.icon-view");
72 	nautilus_list_view_preferences = g_settings_new("org.gnome.nautilus.list-view");
73 	nautilus_desktop_preferences = g_settings_new("org.gnome.nautilus.desktop");
74 	gnome_lockdown_preferences = g_settings_new("org.gnome.desktop.lockdown");
75 	gnome_background_preferences = g_settings_new("org.gnome.desktop.background");
76 	gnome_interface_preferences = g_settings_new ("org.gnome.desktop.interface");
77 }