Commit 8e29ec7f authored by Ramiro Estrugo's avatar Ramiro Estrugo

Task 518. Support for changing preferecens individually

within each confgurable user level.

* libnautilus-extensions/nautilus-global-preferences.h:
Change all preferences strings to not include the "/nautilus"
prefix.  The prefix is not automatically computed by the prefences
api taking into account the user level.

Add (nautilus_global_preferences_dialog_update) to rebuild the
preferences dialog when the user level changes.

* libnautilus-extensions/nautilus-global-preferences.c:
(global_preferences_get_dialog),
(global_preferences_register_sidebar_panels_preferences_for_ui),
(global_preferences_register_with_defaults),
(global_preferences_register_boolean_with_defaults),
(global_preferences_register_string_with_defaults),
(global_preferences_register_enum_with_defaults),
(global_preferences_register_for_ui),
(global_preferences_initialize_if_needed),
(nautilus_global_preferences_show_dialog),
(nautilus_global_preferences_hide_dialog),
(nautilus_global_preferences_set_dialog_title),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_shutdown):
remove the user level tracking hack.  We now set default values
for each of the user levels.

* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_initialize):
Simplified preference callback api by having a single add_callback
function.  Use it here.

* libnautilus-extensions/nautilus-list.c:
(nautilus_list_initialize):
Simplified preference callback api by having a single add_callback
function.  Use it here.

* src/file-manager/fm-directory-view.c:
(fm_directory_view_initialize):
Simplified preference callback api by having a single add_callback
function.  Use it here.

* nautilus-widgets/nautilus-preference.c:
(preference_initialize_if_needed), (preference_hash_node_alloc),
(preference_hash_node_free_func), (preference_hash_node_free),
(preference_register), (preference_hash_node_lookup),
(preference_hash_node_lookup_with_registration),
(nautilus_preference_shutdown), (nautilus_preference_find_by_name),
(nautilus_preference_set_info_by_name),
(nautilus_preference_enum_add_entry_by_name):
* nautilus-widgets/nautilus-preference.h:
Move the preference description hash table here from
nautilus-preferences.  These are preferences that are expected to
have nice defaults as well as descriptions and possibly extra data
for the preferences widgets to use (like enumeration values)

I moved the tabulation and hashing stuff intactly even though it
contains many turds.  I plan to fix these soon.

* nautilus-widgets/nautilus-preferences-group.c:
(nautilus_preferences_group_add_item):
* nautilus-widgets/nautilus-preferences-item.c:
(preferences_item_construct), (enum_radio_group_changed_callback):
Update for the above.

* nautilus-widgets/nautilus-preferences.c:
(preferences_hash_node_alloc), (preferences_hash_node_free),
(preferences_hash_node_add_callback),
(preferences_hash_node_remove_callback),
(preferences_hash_node_check_changes_func),
(preferneces_callback_node_invoke_func), (preferences_register),
(preferences_hash_node_lookup_with_registration),
(preferences_gconf_callback), (user_level_changed_callback),
(preferences_initialize_if_needed),
(nautilus_preferences_add_callback),
(nautilus_preferences_set_boolean),
(nautilus_preferences_get_boolean),
(nautilus_preferences_set_enum), (nautilus_preferences_get_enum),
(nautilus_preferences_set), (nautilus_preferences_get),
(nautilus_preferences_shutdown):
* nautilus-widgets/nautilus-preferences.h:
Move the tabulation of nice preferences to nautilus-preference.

Install one gconf notification for each user level.  Remove all
the extra unused registration parameters.

Use generated keys that take into account the current user level
to communicato with GConf.

Keep track of user level changes so that we can compare
preferences between user levels and fire callbacks accordingly.
This simplifies the lifes of preferences callers as they can
continue to install one simple callback as before.  They will get
notified when a preference changes for whatever reason.  That
could be the user manaually tweaking it, or a sweeping user level
change.

Again, i tried to keep as much of the original hashing logic
intact.  It needs cleaning up as well.

* nautilus-widgets/nautilus-user-level-manager.c:
(nautilus_user_level_manager_set_default_value_if_needed),
(nautilus_user_level_manager_compare_preference_between_user_levels
):
* nautilus-widgets/nautilus-user-level-manager.h:
Add a public function to determine whether a preference is the
same between 2 user levels.

* nautilus-widgets/test-nautilus-preferences.c:
(register_global_preferences):
Update to reflect api changes.

* src/nautilus-window-menus.c: (nautilus_window_initialize_menus),
(user_level_changed_callback),
(get_customize_user_level_setttings_menu_string),
(update_preferences_dialog_title):
Update the preferences dialog whenever the user level changes.
This is an easy way to have the dialog reflect reallity.

It would be a lot nicer it the contents updated on the fly instead
of rebuilding the whole thing.  I can do that later.
parent 92d5f261
2000-06-02 Ramiro Estrugo <ramiro@eazel.com>
Task 518. Support for changing preferecens individually
within each confgurable user level.
* libnautilus-extensions/nautilus-global-preferences.h:
Change all preferences strings to not include the "/nautilus"
prefix. The prefix is not automatically computed by the prefences
api taking into account the user level.
Add (nautilus_global_preferences_dialog_update) to rebuild the
preferences dialog when the user level changes.
* libnautilus-extensions/nautilus-global-preferences.c:
(global_preferences_get_dialog),
(global_preferences_register_sidebar_panels_preferences_for_ui),
(global_preferences_register_with_defaults),
(global_preferences_register_boolean_with_defaults),
(global_preferences_register_string_with_defaults),
(global_preferences_register_enum_with_defaults),
(global_preferences_register_for_ui),
(global_preferences_initialize_if_needed),
(nautilus_global_preferences_show_dialog),
(nautilus_global_preferences_hide_dialog),
(nautilus_global_preferences_set_dialog_title),
(nautilus_global_preferences_dialog_update),
(nautilus_global_preferences_shutdown):
remove the user level tracking hack. We now set default values
for each of the user levels.
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_initialize):
Simplified preference callback api by having a single add_callback
function. Use it here.
* libnautilus-extensions/nautilus-list.c:
(nautilus_list_initialize):
Simplified preference callback api by having a single add_callback
function. Use it here.
* src/file-manager/fm-directory-view.c:
(fm_directory_view_initialize):
Simplified preference callback api by having a single add_callback
function. Use it here.
* nautilus-widgets/nautilus-preference.c:
(preference_initialize_if_needed), (preference_hash_node_alloc),
(preference_hash_node_free_func), (preference_hash_node_free),
(preference_register), (preference_hash_node_lookup),
(preference_hash_node_lookup_with_registration),
(nautilus_preference_shutdown), (nautilus_preference_find_by_name),
(nautilus_preference_set_info_by_name),
(nautilus_preference_enum_add_entry_by_name):
* nautilus-widgets/nautilus-preference.h:
Move the preference description hash table here from
nautilus-preferences. These are preferences that are expected to
have nice defaults as well as descriptions and possibly extra data
for the preferences widgets to use (like enumeration values)
I moved the tabulation and hashing stuff intactly even though it
contains many turds. I plan to fix these soon.
* nautilus-widgets/nautilus-preferences-group.c:
(nautilus_preferences_group_add_item):
* nautilus-widgets/nautilus-preferences-item.c:
(preferences_item_construct), (enum_radio_group_changed_callback):
Update for the above.
* nautilus-widgets/nautilus-preferences.c:
(preferences_hash_node_alloc), (preferences_hash_node_free),
(preferences_hash_node_add_callback),
(preferences_hash_node_remove_callback),
(preferences_hash_node_check_changes_func),
(preferneces_callback_node_invoke_func), (preferences_register),
(preferences_hash_node_lookup_with_registration),
(preferences_gconf_callback), (user_level_changed_callback),
(preferences_initialize_if_needed),
(nautilus_preferences_add_callback),
(nautilus_preferences_set_boolean),
(nautilus_preferences_get_boolean),
(nautilus_preferences_set_enum), (nautilus_preferences_get_enum),
(nautilus_preferences_set), (nautilus_preferences_get),
(nautilus_preferences_shutdown):
* nautilus-widgets/nautilus-preferences.h:
Move the tabulation of nice preferences to nautilus-preference.
Install one gconf notification for each user level. Remove all
the extra unused registration parameters.
Use generated keys that take into account the current user level
to communicato with GConf.
Keep track of user level changes so that we can compare
preferences between user levels and fire callbacks accordingly.
This simplifies the lifes of preferences callers as they can
continue to install one simple callback as before. They will get
notified when a preference changes for whatever reason. That
could be the user manaually tweaking it, or a sweeping user level
change.
Again, i tried to keep as much of the original hashing logic
intact. It needs cleaning up as well.
* nautilus-widgets/nautilus-user-level-manager.c:
(nautilus_user_level_manager_set_default_value_if_needed),
(nautilus_user_level_manager_compare_preference_between_user_levels
):
* nautilus-widgets/nautilus-user-level-manager.h:
Add a public function to determine whether a preference is the
same between 2 user levels.
* nautilus-widgets/test-nautilus-preferences.c:
(register_global_preferences):
Update to reflect api changes.
* src/nautilus-window-menus.c: (nautilus_window_initialize_menus),
(user_level_changed_callback),
(get_customize_user_level_setttings_menu_string),
(update_preferences_dialog_title):
Update the preferences dialog whenever the user level changes.
This is an easy way to have the dialog reflect reallity.
It would be a lot nicer it the contents updated on the fly instead
of rebuilding the whole thing. I can do that later.
2000-06-02 Pavel Cisler <pavel@eazel.com>
* libnautilus-extensions/nautilus-list.c:
......
......@@ -50,6 +50,29 @@ static GList * global_preferences_get_sidebar_panel_view_identifiers (void);
static gboolean global_preferences_close_dialog_callback (GtkWidget *dialog,
gpointer user_data);
static void global_preferences_initialize_if_needed (void);
static void global_preferences_register_with_defaults (const char *name,
const char *description,
NautilusPreferenceType type,
gconstpointer novice_default,
gconstpointer intermediate_default,
gconstpointer hacker_default);
static void global_preferences_register_boolean_with_defaults (const char *name,
const char *description,
gboolean novice_default,
gboolean intermediate_default,
gboolean hacker_default);
static void global_preferences_register_string_with_defaults (const char *name,
const char *description,
const char *novice_default,
const char *intermediate_default,
const char *hacker_default);
static void global_preferences_register_enum_with_defaults (const char *name,
const char *description,
int novice_default,
int intermediate_default,
int hacker_default);
static GtkWidget *global_prefs_dialog = NULL;
/*
* Private stuff
......@@ -263,8 +286,6 @@ nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void)
static GtkWidget *
global_preferences_get_dialog (void)
{
static GtkWidget * global_prefs_dialog = NULL;
global_preferences_initialize_if_needed ();
if (!global_prefs_dialog)
......@@ -292,12 +313,16 @@ global_preferences_register_sidebar_panels_preferences_for_ui (void)
preference_key = global_preferences_get_sidebar_panel_key (identifier->iid);
g_assert (preference_key != NULL);
nautilus_preferences_set_info (preference_key,
identifier->name,
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) TRUE);
/* FIXME: The actual defaults fed to this function need to be queried
* so that only the appropiate sidebar panels show for a user level.
*/
global_preferences_register_boolean_with_defaults (preference_key,
identifier->name,
TRUE,
TRUE,
TRUE);
g_free (preference_key);
}
......@@ -333,6 +358,72 @@ global_preferences_is_sidebar_panel_enabled (NautilusViewIdentifier *panel_ident
return enabled;
}
static void
global_preferences_register_with_defaults (const char *name,
const char *description,
NautilusPreferenceType type,
gconstpointer novice_default,
gconstpointer intermediate_default,
gconstpointer hacker_default)
{
gconstpointer defaults[3];
defaults[0] = novice_default;
defaults[1] = intermediate_default;
defaults[2] = hacker_default;
nautilus_preference_set_info_by_name (name,
description,
type,
defaults,
3);
}
static void
global_preferences_register_boolean_with_defaults (const char *name,
const char *description,
gboolean novice_default,
gboolean intermediate_default,
gboolean hacker_default)
{
global_preferences_register_with_defaults (name,
description,
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) novice_default,
(gconstpointer) intermediate_default,
(gconstpointer) hacker_default);
}
static void
global_preferences_register_string_with_defaults (const char *name,
const char *description,
const char *novice_default,
const char *intermediate_default,
const char *hacker_default)
{
global_preferences_register_with_defaults (name,
description,
NAUTILUS_PREFERENCE_STRING,
(gconstpointer) novice_default,
(gconstpointer) intermediate_default,
(gconstpointer) hacker_default);
}
static void
global_preferences_register_enum_with_defaults (const char *name,
const char *description,
int novice_default,
int intermediate_default,
int hacker_default)
{
global_preferences_register_with_defaults (name,
description,
NAUTILUS_PREFERENCE_ENUM,
(gconstpointer) novice_default,
(gconstpointer) intermediate_default,
(gconstpointer) hacker_default);
}
static void
global_preferences_register_for_ui (void)
{
......@@ -343,65 +434,119 @@ global_preferences_register_for_ui (void)
preference_for_ui_registered = TRUE;
/*
* In the soon to come star trek future, the following information
* will be fetched using the latest xml techniques.
*/
/* Window create new */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
"Open each item in a new window",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
"Open each item in a new window",
FALSE,
FALSE,
FALSE);
/* Click activation type */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_CLICK_POLICY,
"Click policy",
NAUTILUS_PREFERENCE_ENUM,
(gconstpointer) NAUTILUS_CLICK_POLICY_SINGLE);
nautilus_preferences_enum_add_entry (NAUTILUS_PREFERENCES_CLICK_POLICY,
"single",
"Activate items with a single click",
NAUTILUS_CLICK_POLICY_SINGLE);
nautilus_preferences_enum_add_entry (NAUTILUS_PREFERENCES_CLICK_POLICY,
"double",
"Activate items with a double click",
NAUTILUS_CLICK_POLICY_DOUBLE);
global_preferences_register_enum_with_defaults (NAUTILUS_PREFERENCES_CLICK_POLICY,
"Click policy",
NAUTILUS_CLICK_POLICY_SINGLE,
NAUTILUS_CLICK_POLICY_SINGLE,
NAUTILUS_CLICK_POLICY_SINGLE);
nautilus_preference_enum_add_entry_by_name (NAUTILUS_PREFERENCES_CLICK_POLICY,
"single",
"Activate items with a single click",
NAUTILUS_CLICK_POLICY_SINGLE);
nautilus_preference_enum_add_entry_by_name (NAUTILUS_PREFERENCES_CLICK_POLICY,
"double",
"Activate items with a double click",
NAUTILUS_CLICK_POLICY_DOUBLE);
/* Remote views */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_SHOW_TEXT_IN_REMOTE_ICONS,
"Display text in icons even for remote text files",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_SHOW_TEXT_IN_REMOTE_ICONS,
"Display text in icons even for remote text files",
FALSE,
FALSE,
FALSE);
/* Sidebar panels */
global_preferences_register_sidebar_panels_preferences_for_ui ();
/* Appearance options */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS,
"Use smoother (but slower) graphics",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS,
"Use smoother (but slower) graphics",
FALSE,
FALSE,
FALSE);
/* Directory View */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_DIRECTORY_VIEW_FONT_FAMILY,
"Font familiy used to display file names",
NAUTILUS_PREFERENCE_STRING,
(gconstpointer) "helvetica");
global_preferences_register_string_with_defaults (NAUTILUS_PREFERENCES_DIRECTORY_VIEW_FONT_FAMILY,
"Font familiy used to display file names",
"helvetica",
"helvetica",
"helvetica");
/* toolbar icons */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS,
"Use Eazel's toolbar icons",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS,
"Use Eazel's toolbar icons",
FALSE,
FALSE,
FALSE);
/*
* These dont have a UI (yet ? maybe in the advanced settings ?).
* They do need to have appropiate defaults nontheless.
*/
global_preferences_register_string_with_defaults (NAUTILUS_PREFERENCES_ICON_THEME,
"Show entire filename",
"default",
"default",
"default");
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
"Show entire filename",
FALSE,
FALSE,
TRUE);
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
"Show hidden files",
FALSE,
TRUE,
TRUE);
global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_CAN_ADD_CONTENT,
"Can add Content",
FALSE,
TRUE,
TRUE);
/* Miscellaneous */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
"Show entire file file",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
{
const char *user_main_directory;
char *novice_home_location;
char *intermediate_home_location;
char *hacker_home_location;
/* FIXME bugzilla.eazel.com 715: This call needs to be spanked to conform. Should return a strduped string */
user_main_directory = nautilus_get_user_main_directory ();
novice_home_location = g_strdup_printf ("file://%s", user_main_directory);
intermediate_home_location = g_strdup_printf ("file://%s", g_get_home_dir());
hacker_home_location = g_strdup_printf ("file://%s", g_get_home_dir());
global_preferences_register_string_with_defaults (NAUTILUS_PREFERENCES_HOME_URI,
"Home Location",
novice_home_location,
intermediate_home_location,
hacker_home_location);
g_free (novice_home_location);
g_free (intermediate_home_location);
g_free (hacker_home_location);
}
}
static gboolean
......@@ -413,76 +558,6 @@ global_preferences_close_dialog_callback (GtkWidget *dialog,
return TRUE;
}
#define USER_LEVEL_NOVICE 0
#define USER_LEVEL_INTERMEDIATE 1
#define USER_LEVEL_HACKER 2
static void
user_level_changed_callback (GtkObject *user_level_manager,
gpointer user_data)
{
int new_user_level;
char *home_uri_string;
gboolean show_hidden_files = FALSE;
gboolean use_real_home = TRUE;
gboolean show_real_file_name = FALSE;
gboolean can_add_content = TRUE;
const char *user_main_directory;
new_user_level = nautilus_user_level_manager_get_user_level ();
/* Set some preferences according to the user level */
switch (new_user_level) {
case USER_LEVEL_NOVICE:
show_hidden_files = FALSE;
use_real_home = FALSE;
show_real_file_name = FALSE;
can_add_content = FALSE;
break;
case USER_LEVEL_INTERMEDIATE:
show_hidden_files = FALSE;
use_real_home = TRUE;
show_real_file_name = FALSE;
can_add_content = TRUE;
break;
case USER_LEVEL_HACKER:
default:
show_hidden_files = TRUE;
use_real_home = TRUE;
show_real_file_name = TRUE;
can_add_content = TRUE;
break;
}
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
show_hidden_files);
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,
show_real_file_name);
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_CAN_ADD_CONTENT,
can_add_content);
/* FIXME bugzilla.eazel.com 715: This call needs to be spanked to conform. Should return a strduped string */
user_main_directory = nautilus_get_user_main_directory ();
if (use_real_home)
home_uri_string = g_strdup_printf ("file://%s", g_get_home_dir());
else
home_uri_string = g_strdup_printf ("file://%s", user_main_directory);
g_assert (home_uri_string != NULL);
nautilus_preferences_set (NAUTILUS_PREFERENCES_HOME_URI,
home_uri_string);
g_free (home_uri_string);
}
static void
global_preferences_initialize_if_needed (void)
{
......@@ -493,15 +568,6 @@ global_preferences_initialize_if_needed (void)
}
global_preferences_register_for_ui ();
/* Register to find out about user level changes */
gtk_signal_connect (GTK_OBJECT (nautilus_user_level_manager_get ()),
"user_level_changed",
user_level_changed_callback,
NULL);
/* Invoke the callback once to make sure stuff is properly setup */
user_level_changed_callback (NULL, NULL);
initialized = TRUE;
}
......@@ -512,40 +578,56 @@ global_preferences_initialize_if_needed (void)
void
nautilus_global_preferences_show_dialog (void)
{
GtkWidget * global_prefs_dialog = global_preferences_get_dialog ();
GtkWidget *dialog = global_preferences_get_dialog ();
gtk_widget_show (global_prefs_dialog);
gtk_widget_show (dialog);
}
void
nautilus_global_preferences_hide_dialog (void)
{
GtkWidget * global_prefs_dialog = global_preferences_get_dialog ();
GtkWidget *dialog = global_preferences_get_dialog ();
gtk_widget_hide (global_prefs_dialog);
gtk_widget_hide (dialog);
}
void
nautilus_global_preferences_set_dialog_title (const char *title)
{
GtkWidget *global_prefs_dialog;
GtkWidget *dialog;
g_return_if_fail (title != NULL);
global_prefs_dialog = global_preferences_get_dialog ();
dialog = global_preferences_get_dialog ();
gtk_window_set_title (GTK_WINDOW (global_prefs_dialog), title);
gtk_window_set_title (GTK_WINDOW (dialog), title);
}
void
nautilus_global_preferences_shutdown (void)
nautilus_global_preferences_dialog_update (void)
{
gboolean was_showing = FALSE;
/* Free the dialog first, cause it has refs to preferences */
GtkWidget * global_prefs_dialog = global_preferences_get_dialog ();
gtk_widget_destroy (global_prefs_dialog);
if (global_prefs_dialog != NULL) {
was_showing = GTK_WIDGET_VISIBLE (global_prefs_dialog);
gtk_widget_destroy (global_prefs_dialog);
}
global_prefs_dialog = global_preferences_create_dialog ();
gtk_signal_disconnect_by_func (GTK_OBJECT (nautilus_user_level_manager_get ()),
user_level_changed_callback,
NULL);
if (was_showing) {
nautilus_global_preferences_show_dialog ();
}
}
void
nautilus_global_preferences_shutdown (void)
{
/* Free the dialog first, cause it has refs to preferences */
if (global_prefs_dialog != NULL) {
gtk_widget_destroy (global_prefs_dialog);
}
/* Now free the preferences tables and stuff */
nautilus_preferences_shutdown ();
......
......@@ -31,39 +31,39 @@
BEGIN_GNOME_DECLS
/* Window options */
#define NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW "/nautilus/preferences/window_always_new"
#define NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW "preferences/window_always_new"
/* Show hidden files */
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "/nautilus/preferences/show_hidden_files"
#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "preferences/show_hidden_files"
/* sidebar width */
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/nautilus/preferences/sidebar_width"
#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "preferences/sidebar_width"
/* Home URI */
#define NAUTILUS_PREFERENCES_HOME_URI "/nautilus/preferences/home_uri"
#define NAUTILUS_PREFERENCES_HOME_URI "preferences/home_uri"
/* adding/removing from property browser */
#define NAUTILUS_PREFERENCES_CAN_ADD_CONTENT "/nautilus/preferences/can_add_content"
#define NAUTILUS_PREFERENCES_CAN_ADD_CONTENT "preferences/can_add_content"
/* Preferences not (currently?) displayed in dialog */
#define NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ATTRIBUTE_NAMES "/nautilus/icon_view/text_attribute_names"
#define NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME "/nautilus/preferences/show_real_file_name"
#define NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ATTRIBUTE_NAMES "icon_view/text_attribute_names"
#define NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME "preferences/show_real_file_name"
/* Single/Double click preference */
#define NAUTILUS_PREFERENCES_CLICK_POLICY "/nautilus/preferences/click_policy"
#define NAUTILUS_PREFERENCES_CLICK_POLICY "preferences/click_policy"
/* use anti-aliased canvas */
#define NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS "/nautilus/preferences/anti_aliased_canvas"
#define NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS "preferences/anti_aliased_canvas"
/* Sidebar panels */
#define NAUTILUS_PREFERENCES_SIDEBAR_PANELS_NAMESPACE "/nautilus/sidebar-panels"
#define NAUTILUS_PREFERENCES_SIDEBAR_PANELS_NAMESPACE "sidebar-panels"
/* Directory view */
#define NAUTILUS_PREFERENCES_DIRECTORY_VIEW_FONT_FAMILY "/nautilus/directory-view/font_family"
#define NAUTILUS_PREFERENCES_DIRECTORY_VIEW_FONT_FAMILY "directory-view/font_family"
/* themes */
#define NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS "/nautilus/preferences/eazel_toolbar_icons"
#define NAUTILUS_PREFERENCES_ICON_THEME "/nautilus/preferences/icon_theme"
#define NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS "preferences/eazel_toolbar_icons"
#define NAUTILUS_PREFERENCES_ICON_THEME "preferences/icon_theme"
enum
{
......@@ -71,12 +71,13 @@ enum
NAUTILUS_CLICK_POLICY_DOUBLE
};
#define NAUTILUS_PREFERENCES_SHOW_TEXT_IN_REMOTE_ICONS "/nautilus/preferences/remote_icon_text"
#define NAUTILUS_PREFERENCES_SHOW_TEXT_IN_REMOTE_ICONS "preferences/remote_icon_text"
void nautilus_global_preferences_shutdown (void);
void nautilus_global_preferences_show_dialog (void);
void nautilus_global_preferences_hide_dialog (void);
void nautilus_global_preferences_set_dialog_title (const char *title);
void nautilus_global_preferences_dialog_update (void);
/* Sidebar */
GList *nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void);
......
......@@ -2495,15 +2495,14 @@ nautilus_icon_container_initialize (NautilusIconContainer *container)
mode == NAUTILUS_CLICK_POLICY_SINGLE;
/* Keep track of changes in clicking policy */
nautilus_preferences_add_enum_callback
(NAUTILUS_PREFERENCES_CLICK_POLICY,
click_policy_changed_callback,
container);
/* add callback for preference changes */
nautilus_preferences_add_boolean_callback(NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS,
(NautilusPreferencesCallback) anti_aliased_preferences_changed,
container);
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_CLICK_POLICY,
click_policy_changed_callback,
container);