summaryrefslogtreecommitdiff
path: root/src/nautilus-preferences-dialog.c
blob: 2fdc5d8bc085275cce9ee207e4730b311481ee6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */

/* nautilus-preferences-dialog.c - Nautilus shell specific preferences things.

   Copyright (C) 1999, 2000, 2001 Eazel, Inc.

   The Gnome Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The Gnome Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.

   Authors: Ramiro Estrugo <ramiro@eazel.com>
*/

#include <config.h>
#include "nautilus-preferences-dialog.h"

#include "libnautilus-private/nautilus-global-preferences.h"
#include "libnautilus-private/nautilus-sidebar-functions.h"
#include "nautilus-theme-selector.h"
#include <eel/eel-debug.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-preferences-box.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkmessagedialog.h>
#include <gtk/gtkstock.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnome/gnome-help.h>
#include <eel/eel-string.h>

/* 
 * This file contains the description of the preferences dialog in
 * Nautilus.  If you would like to add an item to the Nautilus
 * preference dialog, you might want to follow this procedure:
 *
 * 1.  Info Coming Soon.
 *
 */

static void preferences_dialog_populate_sidebar_tabs_group (EelPreferencesGroup *group);
static void preferences_dialog_populate_themes_group       (EelPreferencesGroup *group);

static GtkWidget *preferences_dialog;

static EelPreferencesItemDescription appearance_items[] = {
	{ N_("Themes"),
	  NULL,
	  NULL,
	  0,
	  NULL,
	  0,
	  0,
	  preferences_dialog_populate_themes_group
	},
	{ NULL }
};

static EelPreferencesItemDescription windows_items[] = {
	{ N_("New Window Behavior"),
	  NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
	  N_("_Open each file or folder in a new window"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("New Window Display"),
	  NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
	  N_("Display _side pane"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("New Window Display"),
	  NAUTILUS_PREFERENCES_START_WITH_TOOLBAR,
	  N_("Display _toolbar"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("New Window Display"),
	  NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR,
	  N_("Display location _bar"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("New Window Display"),
	  NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR,
	  N_("Display st_atusbar"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ NULL }
};

static EelPreferencesItemDescription desktop_and_trash_items[] = {
	{ N_("Desktop"),
	  NAUTILUS_PREFERENCES_SHOW_DESKTOP,
	  N_("_Use Nautilus to draw the desktop"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
        { N_("Desktop"),
	  NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR,
	  N_("Use your _home folder as the desktop"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("Trash Behavior"),
	  NAUTILUS_PREFERENCES_CONFIRM_TRASH,
	  N_("_Ask before emptying the Trash or deleting files"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("Trash Behavior"),
	  NAUTILUS_PREFERENCES_ENABLE_DELETE,
	  N_("_Include a Delete command that bypasses Trash"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ NULL }
};

static EelPreferencesItemDescription directory_views_items[] = {
	{ N_("Click Behavior"),
	  NAUTILUS_PREFERENCES_CLICK_POLICY,
	  N_("Click Behavior"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_VERTICAL_RADIO
	},
	{ N_("Executable Text Files"),
	  NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION,
	  N_("Executable Text Files"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_VERTICAL_RADIO
	},
	{ N_("Show Options"),
	  NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
	  N_("_Hidden files (filenames starting with \".\")"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("Show Options"),
	  NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
	  N_("_Backup files (filenames ending with \"~\")"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("Show Options"),
	  NAUTILUS_PREFERENCES_SHOW_SPECIAL_FLAGS,
	  N_("Special flags in _Properties dialog"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("Sort"),
	  NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST,
	  N_("Fo_lders before files"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ NULL }
};

static EelPreferencesItemDescription icon_captions_items[] = {
	{ N_("Icon Captions"),
	  NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS,
	  N_("Choose the order for information to appear beneath icon names.\n"
	     "More information appears as you zoom in closer"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_LIST_VERTICAL,
	  NULL,
	  0,
	  0,
	  NULL,
	  "none"
	},
	{ NULL }
};

static EelPreferencesItemDescription view_preferences_items[] = {
	{ N_("Default View"),
	  NAUTILUS_PREFERENCES_DEFAULT_FOLDER_VIEWER,
	  N_("_View new folders using:"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_MENU
	},

	/* Icon View Defaults */
	{ N_("Icon View Defaults"),
	  NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT,
	  N_("_Arrange items:"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_MENU
	},
	{ N_("Icon View Defaults"),
	  NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
	  N_("_Sort in reverse"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("Icon View Defaults"),
	  NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
	  N_("_Default zoom level:"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_MENU,
	  NULL, 0, 1
	},
	{ N_("Icon View Defaults"),
	  NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
	  N_("Use co_mpact layout"),
	  EEL_PREFERENCE_ITEM_BOOLEAN,
	  NULL, 0, 1
	},

	/* List View Defaults */
	{ N_("List View Defaults"),
	  NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER,
	  N_("Arrange _items:"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_MENU
	},
	{ N_("List View Defaults"),
	  NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
	  N_("Sort in _reverse"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ N_("List View Defaults"),
	  NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
	  N_("Default _zoom level:"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_MENU,
	  NULL, 0, 1
	},
	{ N_("List View Defaults"),
	  "dummy-string",
	  NULL,
	  EEL_PREFERENCE_ITEM_PADDING,
	  NULL, 0, 1
	},
	{ NULL }
};

#ifdef HAVE_MEDUSA
static EelPreferencesItemDescription search_items[] = {
	{ N_("Search Complexity Options"),
	  NAUTILUS_PREFERENCES_SEARCH_BAR_TYPE,
	  N_("search type to do by default"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_VERTICAL_RADIO
	},
	{ NULL }
};
#endif

#ifdef WEB_NAVIGATION_ENABLED
static EelPreferencesItemDescription navigation_items[] = {
	{ N_("Home"),
	  NAUTILUS_PREFERENCES_HOME_URI,
	  N_("_Location:"),
	  EEL_PREFERENCE_ITEM_EDITABLE_STRING
	},
	{ N_("Built-in Bookmarks"),
	  NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS,
	  N_("_Don't include the built-in bookmarks in the Bookmarks menu"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ NULL }
};
#endif

static EelPreferencesItemDescription tradeoffs_items[] = {
	{ N_("Show Text in Icons"),
	  NAUTILUS_PREFERENCES_SHOW_TEXT_IN_ICONS,
	  NULL,
	  EEL_PREFERENCE_ITEM_ENUMERATION_HORIZONTAL_RADIO
	},
	{ N_("Show Number of Items in Folders"),
	  NAUTILUS_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
	  NULL,
	  EEL_PREFERENCE_ITEM_ENUMERATION_HORIZONTAL_RADIO
	},
	{ N_("Show Thumbnails for Image Files"),
	  NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
	  NULL,
	  EEL_PREFERENCE_ITEM_ENUMERATION_HORIZONTAL_RADIO
	},
	{ N_("Show Thumbnails for Image Files"),
	  NAUTILUS_PREFERENCES_IMAGE_FILE_THUMBNAIL_LIMIT,
	  N_("_Do not make thumbnails for files larger than:"),
	  EEL_PREFERENCE_ITEM_ENUMERATION_MENU_INTEGER
	},
	{ N_("Preview Sound Files"),
	  NAUTILUS_PREFERENCES_PREVIEW_SOUND,
	  NULL,
	  EEL_PREFERENCE_ITEM_ENUMERATION_HORIZONTAL_RADIO
	},
	{ NULL }
};

static EelPreferencesItemDescription sidebar_items[] = {
	{ N_("Tabs"),
	  NULL,
	  NULL,
	  0,
	  NULL,
	  0,
	  0,
	  preferences_dialog_populate_sidebar_tabs_group,
	},
	{ N_("Tree"),
	  NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
	  N_("_Show folders only"),
	  EEL_PREFERENCE_ITEM_BOOLEAN
	},
	{ NULL }
};

#ifdef NEWS_SIDEBAR_ENABLED
static EelPreferencesItemDescription news_panel_items[] = {
	{ N_("Maximum items per site"),
	  NAUTILUS_PREFERENCES_NEWS_MAX_ITEMS,
	  N_("_Maximum number of items displayed per site"),
	  EEL_PREFERENCE_ITEM_EDITABLE_INTEGER
	},
	{ N_("Update Minutes"),
	  NAUTILUS_PREFERENCES_NEWS_UPDATE_INTERVAL,
	  N_("_Update frequency in minutes"),
	  EEL_PREFERENCE_ITEM_EDITABLE_INTEGER

	},
	{ NULL }
};
#endif


static EelPreferencesPaneDescription panes[] = {
	{ N_("Views"),			  view_preferences_items },
	{ N_("Appearance"),		  appearance_items },
	{ N_("Windows"),	  	  windows_items },
	{ N_("Desktop & Trash"),	  desktop_and_trash_items },
	{ N_("Icon & List Views"),	  directory_views_items },
	{ N_("Icon Captions"),		  icon_captions_items },
	{ N_("Side Panes"),		  sidebar_items },
#ifdef HAVE_MEDUSA
	{ N_("Search"),			  search_items },
#endif
#ifdef WEB_NAVIGATION_ENABLED
	{ N_("Navigation"),		  navigation_items },
#endif
	{ N_("Performance"),		  tradeoffs_items },
#ifdef NEWS_SIDEBAR_ENABLED
	{ N_("News Panel"),		  news_panel_items },
#endif
	{ NULL }
};

static gboolean
dialog_delete_event_callback (GtkWidget   *widget,
			      GdkEventAny *event,
			      gpointer     user_data)
{
	gtk_widget_hide (widget);
	return TRUE;
}

static void
preferences_show_help (GtkWindow *parent,
		       char const *helpfile,
		       char const *sect_id)
{
	GError *error = NULL;
	GtkWidget *dialog;

	g_return_if_fail (helpfile != NULL);
	g_return_if_fail (sect_id != NULL);

	gnome_help_display_desktop (NULL,
				    "user-guide",
				    helpfile, sect_id, &error);

	if (error) {
		dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
						 GTK_DIALOG_DESTROY_WITH_PARENT,
						 GTK_MESSAGE_ERROR,
						 GTK_BUTTONS_CLOSE,
						 _("There was an error displaying help: \n%s"),
						 error->message);

		g_signal_connect (G_OBJECT (dialog),
				  "response", G_CALLBACK (gtk_widget_destroy),
				  NULL);
		gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
		gtk_widget_show (dialog);
		g_error_free (error);
	}
}



static void
dialog_button_response_callback (GtkDialog *dialog,
				 int response_id,
				 gpointer callback_data)
{
	EelPreferencesBox *preferences_box;
	char *active_pane;

	if (response_id == GTK_RESPONSE_HELP) {
		preferences_box = eel_preferences_dialog_get_box (GTK_WINDOW (dialog));
		active_pane = eel_preferences_box_get_active_pane (preferences_box);

		if  (eel_str_is_equal (active_pane, "Views"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-438");
		else if (eel_str_is_equal (active_pane, "Appearance"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-54");
		else if (eel_str_is_equal (active_pane, "Windows"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-55");
		else if (eel_str_is_equal (active_pane, "Desktop & Trash"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-448");
		else if (eel_str_is_equal (active_pane, "Icon & List Views"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-56");
		else if (eel_str_is_equal (active_pane, "Icon Captions"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-439");
		else if (eel_str_is_equal (active_pane, "Side Panes"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-57");
		else if (eel_str_is_equal (active_pane,"Navigation"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-59");
		else if (eel_str_is_equal (active_pane, "Performance"))
			preferences_show_help (GTK_WINDOW (dialog), "wgosnautilus.xml", "gosnautilus-60");

		g_free (active_pane);
	} else {
		gtk_widget_hide (GTK_WIDGET (dialog));
	}
}

static GtkWidget *
preferences_dialog_create (void)
{
	GtkWidget *dialog;

	dialog = eel_preferences_dialog_new (_("Preferences"), panes);
	g_assert (GTK_IS_DIALOG (dialog));

	gtk_window_set_wmclass (GTK_WINDOW (dialog), "nautilus_preferences", "Nautilus");

	gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_HELP,
			       GTK_RESPONSE_HELP);

	g_signal_connect (dialog, "delete_event",
			  G_CALLBACK (dialog_delete_event_callback), dialog);
	g_signal_connect (dialog, "response",
			  G_CALLBACK (dialog_button_response_callback), dialog);

	return dialog;
}

static void
global_preferences_populate_sidebar_panels_callback (const char *name,
						     const char *iid,
						     const char *preference_key,
						     gpointer callback_data) 
{
	g_return_if_fail (name != NULL);
	g_return_if_fail (iid != NULL);
	g_return_if_fail (preference_key != NULL);
	g_return_if_fail (EEL_IS_PREFERENCES_GROUP (callback_data));
	
	eel_preferences_set_description (preference_key, name);

	eel_preferences_group_add_item (EEL_PREFERENCES_GROUP (callback_data),
					preference_key,
					EEL_PREFERENCE_ITEM_BOOLEAN,
					0);
}

static void
preferences_dialog_populate_sidebar_tabs_group (EelPreferencesGroup *group)
{
	g_return_if_fail (EEL_IS_PREFERENCES_GROUP (group));

	nautilus_sidebar_for_each_panel (global_preferences_populate_sidebar_panels_callback, group);
}

/* Callback for when the user chooses a new theme from the list */
static void
theme_changed_callback (NautilusThemeSelector *theme_selector,
			gpointer callback_data)
{
	char *selected_theme;

	g_return_if_fail (NAUTILUS_IS_THEME_SELECTOR (theme_selector));

	selected_theme = nautilus_theme_selector_get_selected_theme (NAUTILUS_THEME_SELECTOR (theme_selector));

	/* We ignore a NULL selected theme, which can happen when the dialog
	   is being destroyed. */
	if (selected_theme == NULL)
		return;

	eel_preferences_set (NAUTILUS_PREFERENCES_THEME, selected_theme);

	g_free (selected_theme);
}

/* PreferenceItem callback for when its time to update the theme chooser
 * with the theme currently stored in preferences
*/
static void
update_theme_selector_displayed_value_callback (EelPreferencesItem *item,
						gpointer callback_data)
{
	char *current_theme_name;

	g_return_if_fail (EEL_IS_PREFERENCES_ITEM (item));
	g_return_if_fail (NAUTILUS_IS_THEME_SELECTOR (callback_data));

	current_theme_name = eel_preferences_get (NAUTILUS_PREFERENCES_THEME);

	nautilus_theme_selector_set_selected_theme (NAUTILUS_THEME_SELECTOR (callback_data),
						    current_theme_name);

	g_free (current_theme_name);
}

static void
preferences_dialog_populate_themes_group (EelPreferencesGroup *group)
{
	GtkWidget *item;
	GtkWidget *child;
	GtkWidget *parent_window;

	g_return_if_fail (EEL_IS_PREFERENCES_GROUP (group));

	child = nautilus_theme_selector_new ();
	gtk_widget_set_size_request (child, -1, 300);

	parent_window = gtk_widget_get_ancestor (GTK_WIDGET (group), GTK_TYPE_WINDOW);

	if (GTK_IS_WINDOW (parent_window)) {
		nautilus_theme_selector_set_parent_window (NAUTILUS_THEME_SELECTOR (child),
							   GTK_WINDOW (parent_window));
	}
	
	item = eel_preferences_group_add_custom_item (group,
						      NAUTILUS_PREFERENCES_THEME,
						      child,
						      "theme_changed",
						      0);
	/* Keep track of theme chooser changes */
	g_signal_connect (child, "theme_changed",
			  G_CALLBACK (theme_changed_callback), NULL);

	/* Have the custom preferences item tell us when its time to update the displayed
	 * with with the one stored in preferences
	 */
	g_signal_connect_object (item, "custom_update_displayed_value",
				 G_CALLBACK (update_theme_selector_displayed_value_callback), child, 0);
	update_theme_selector_displayed_value_callback (EEL_PREFERENCES_ITEM (item), child);
}

static void
preferences_dialog_destroy (void)
{
	if (preferences_dialog == NULL) {
		return;
	}
	
	/* Since it's a top-level window, it's OK to destroy rather than unref'ing. */
	gtk_widget_destroy (preferences_dialog);
	preferences_dialog = NULL;
}

static GtkWidget *
global_preferences_get_dialog (void)
{
	nautilus_global_preferences_init ();
	
	if (preferences_dialog == NULL) {
		preferences_dialog = preferences_dialog_create ();
		eel_debug_call_at_shutdown (preferences_dialog_destroy);
	}

	g_assert (GTK_IS_DIALOG (preferences_dialog));
	return preferences_dialog;
}

void
nautilus_preferences_dialog_show (void)
{
	gtk_window_present (GTK_WINDOW (global_preferences_get_dialog ()));
}