Commit d43dc92e authored by Andy Hertzfeld's avatar Andy Hertzfeld

at Bud's request, implemented bug 4127, add a preference to show or hide


	at Bud's request, implemented bug 4127, add a preference to
	show or hide Nautilus' desktop.

	* libnautilus-extensions/nautilus-global-preferences.h:
	define NAUTILUS_PREFERENCES_SHOW_DESKTOP
	* libnautilus-extensions/nautilus-global-preferences.c:
	(global_preferences_create_dialog), (global_preferences_register):
	register the desktop preference and show the checkbox in
	the appearance section of preferences
	* src/nautilus-application.c: (nautilus_application_initialize),
	(nautilus_application_destroy), (check_for_and_run_as_super_user),
	(desktop_changed_callback):
	watch the desktop preference and show or hide the desktop window
	when it changes.
	* src/nautilus-main.c: (main):
	show the desktop at launch if the preference is set and it's not
	overriden by command-line options.
parent b2535f91
2000-10-27 Andy Hertzfeld <andy@eazel.com>
at Bud's request, implemented bug 4127, add a preference to
show or hide Nautilus' desktop.
* libnautilus-extensions/nautilus-global-preferences.h:
define NAUTILUS_PREFERENCES_SHOW_DESKTOP
* libnautilus-extensions/nautilus-global-preferences.c:
(global_preferences_create_dialog), (global_preferences_register):
register the desktop preference and show the checkbox in
the appearance section of preferences
* src/nautilus-application.c: (nautilus_application_initialize),
(nautilus_application_destroy), (check_for_and_run_as_super_user),
(desktop_changed_callback):
watch the desktop preference and show or hide the desktop window
when it changes.
* src/nautilus-main.c: (main):
show the desktop at launch if the preference is set and it's not
overriden by command-line options.
2000-10-27 Darin Adler <darin@eazel.com>
Fixed bugs in file renaming. These changes along with the
......
......@@ -235,6 +235,11 @@ global_preferences_create_dialog (void)
NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), _("Desktop"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane),
3,
NAUTILUS_PREFERENCES_SHOW_DESKTOP,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/*
......@@ -930,6 +935,11 @@ global_preferences_register (void)
TRUE,
TRUE);
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_SHOW_DESKTOP,
_("Use Nautilus to draw the desktop"),
FALSE,
FALSE,
FALSE);
/* search tradeoffs */
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_SEARCH_METHOD,
......
......@@ -43,6 +43,7 @@ BEGIN_GNOME_DECLS
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/apps/nautilus/preferences/sidebar_width"
/* Keep track of the sound playing process */
#define NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE "/apps/nautilus/preferences/sound_state"
/* Show the desktop window or not */
/*
* The following preferences are coupled to the user level.
......@@ -58,6 +59,9 @@ BEGIN_GNOME_DECLS
/* Trash options */
#define NAUTILUS_PREFERENCES_CONFIRM_TRASH "preferences/confirm_trash"
/* Desktop options */
#define NAUTILUS_PREFERENCES_SHOW_DESKTOP "preferences/show_desktop"
/* Display */
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "preferences/show_hidden_files"
#define NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES "preferences/show_backup_files"
......
......@@ -235,6 +235,11 @@ global_preferences_create_dialog (void)
NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), _("Desktop"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane),
3,
NAUTILUS_PREFERENCES_SHOW_DESKTOP,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/*
......@@ -930,6 +935,11 @@ global_preferences_register (void)
TRUE,
TRUE);
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_SHOW_DESKTOP,
_("Use Nautilus to draw the desktop"),
FALSE,
FALSE,
FALSE);
/* search tradeoffs */
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_SEARCH_METHOD,
......
......@@ -43,6 +43,7 @@ BEGIN_GNOME_DECLS
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/apps/nautilus/preferences/sidebar_width"
/* Keep track of the sound playing process */
#define NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE "/apps/nautilus/preferences/sound_state"
/* Show the desktop window or not */
/*
* The following preferences are coupled to the user level.
......@@ -58,6 +59,9 @@ BEGIN_GNOME_DECLS
/* Trash options */
#define NAUTILUS_PREFERENCES_CONFIRM_TRASH "preferences/confirm_trash"
/* Desktop options */
#define NAUTILUS_PREFERENCES_SHOW_DESKTOP "preferences/show_desktop"
/* Display */
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "preferences/show_hidden_files"
#define NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES "preferences/show_backup_files"
......
......@@ -44,6 +44,7 @@
#include <libgnomeui/gnome-messagebox.h>
#include <libgnomeui/gnome-stock.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-gtk-macros.h>
#include <libnautilus-extensions/nautilus-icon-factory.h>
#include <libnautilus-extensions/nautilus-sound.h>
......@@ -71,6 +72,7 @@ static void nautilus_application_destroy (GtkObject
static void nautilus_application_check_user_directories (NautilusApplication *application);
static gboolean check_for_and_run_as_super_user (void);
static gboolean need_to_show_first_time_druid (void);
static void desktop_changed_callback (gpointer user_data);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusApplication, nautilus_application, BONOBO_OBJECT_TYPE)
......@@ -176,6 +178,11 @@ nautilus_application_initialize (NautilusApplication *application)
/* Create an undo manager */
application->undo_manager = nautilus_undo_manager_new ();
/* monitor the desktop preference */
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_DESKTOP,
desktop_changed_callback,
application);
}
NautilusApplication *
......@@ -192,6 +199,10 @@ nautilus_application_destroy (GtkObject *object)
application = NAUTILUS_APPLICATION (object);
nautilus_bookmarks_exiting ();
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_DESKTOP,
desktop_changed_callback,
application);
bonobo_object_unref (BONOBO_OBJECT (application->undo_manager));
......@@ -549,6 +560,20 @@ check_for_and_run_as_super_user (void)
return TRUE;
}
/* callback for showing or hiding the desktop based on the user's preference */
static void
desktop_changed_callback (gpointer user_data)
{
NautilusApplication *application;
application = NAUTILUS_APPLICATION (user_data);
if ( nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_DESKTOP, FALSE)) {
nautilus_application_open_desktop (application);
} else {
nautilus_application_close_desktop ();
}
}
/*
* need_to_show_first_time_druid
*
......
......@@ -239,6 +239,11 @@ main (int argc, char *argv[])
*/
nautilus_global_preferences_initialize ();
/* if desktop flags are not explicitly specified, get it from preferences */
if (!start_desktop && !stop_desktop) {
start_desktop = nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_DESKTOP, FALSE);
}
/* Do either the self-check or the real work. */
if (perform_self_check) {
#ifndef NAUTILUS_OMIT_SELF_CHECK
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment