mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
add preload of the gconf cache, to hopefully avoid a zillion round trips
2002-01-04 Havoc Pennington <hp@pobox.com> * libnautilus-private/nautilus-global-preferences.c (nautilus_global_preferences_init): add preload of the gconf cache, to hopefully avoid a zillion round trips to gconfd on startup. * test/test.c (test_window_new): remove weird gtk_window_set_policy * test/test-nautilus-preferences-display.c: remove user level stuff * test/test-nautilus-preferences-change.c: remove user level stuff * libnautilus-private/nautilus-global-preferences.c: the default click policy was SPEED_TRADEOFF_LOCAL_ONLY, fix * libnautilus-private/nautilus.schemas: add schemas file, incomplete, needs to be finished and installed * libnautilus-private/nautilus-global-preferences.c: strip out user levels * src/nautilus-shell-ui.xml: strip out user level menu * src/nautilus-window-menus.c: strip out user level menu
This commit is contained in:
parent
d84dbfa0dd
commit
e60f2abe9f
27
ChangeLog
27
ChangeLog
|
@ -1,3 +1,30 @@
|
||||||
|
2002-01-04 Havoc Pennington <hp@pobox.com>
|
||||||
|
|
||||||
|
* libnautilus-private/nautilus-global-preferences.c
|
||||||
|
(nautilus_global_preferences_init): add preload of the gconf
|
||||||
|
cache, to hopefully avoid a zillion round trips to gconfd on
|
||||||
|
startup.
|
||||||
|
|
||||||
|
* test/test.c (test_window_new): remove weird gtk_window_set_policy
|
||||||
|
|
||||||
|
* test/test-nautilus-preferences-display.c: remove user level
|
||||||
|
stuff
|
||||||
|
|
||||||
|
* test/test-nautilus-preferences-change.c: remove user level stuff
|
||||||
|
|
||||||
|
* libnautilus-private/nautilus-global-preferences.c: the default
|
||||||
|
click policy was SPEED_TRADEOFF_LOCAL_ONLY, fix
|
||||||
|
|
||||||
|
* libnautilus-private/nautilus.schemas: add schemas file,
|
||||||
|
incomplete, needs to be finished and installed
|
||||||
|
|
||||||
|
* libnautilus-private/nautilus-global-preferences.c: strip out
|
||||||
|
user levels
|
||||||
|
|
||||||
|
* src/nautilus-shell-ui.xml: strip out user level menu
|
||||||
|
|
||||||
|
* src/nautilus-window-menus.c: strip out user level menu
|
||||||
|
|
||||||
2002-01-04 Darin Adler <darin@bentspoon.com>
|
2002-01-04 Darin Adler <darin@bentspoon.com>
|
||||||
|
|
||||||
* libnautilus-private/nautilus-icon-container.c:
|
* libnautilus-private/nautilus-icon-container.c:
|
||||||
|
|
|
@ -51,9 +51,9 @@ static const char SYSTEM_GNOME_VFS_PATH[] = "/system/gnome-vfs";
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
static void global_preferences_install_defaults (void);
|
static void global_preferences_install_defaults (void);
|
||||||
static void global_preferences_register_enumerations (void);
|
static void global_preferences_register_enumerations (void);
|
||||||
static gpointer default_font_callback (int user_level);
|
static gpointer default_font_callback (void);
|
||||||
static gpointer default_home_location_callback (int user_level);
|
static gpointer default_home_location_callback (void);
|
||||||
static gpointer default_default_folder_viewer_callback (int user_level);
|
static gpointer default_default_folder_viewer_callback (void);
|
||||||
|
|
||||||
/* An enumeration used for installing type specific preferences defaults. */
|
/* An enumeration used for installing type specific preferences defaults. */
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -215,31 +215,20 @@ static EelEnumerationInfo enumerations[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A callback which can be used to fetch dynamic default values.
|
* A callback which can be used to fetch dynamic fallback values.
|
||||||
* For example, values that are dependent on the environment (such as user name)
|
* For example, values that are dependent on the environment (such as user name)
|
||||||
* cannot be specified as constants.
|
* cannot be specified as constants.
|
||||||
*/
|
*/
|
||||||
typedef gpointer (*PreferencesDefaultValueCallback) (int user_level);
|
typedef gpointer (*PreferencesDefaultValueCallback) (void);
|
||||||
|
|
||||||
/* A structure that pairs a default value with a specific user level. */
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int user_level;
|
|
||||||
const gpointer value;
|
|
||||||
PreferencesDefaultValueCallback callback;
|
|
||||||
GFreeFunc callback_result_free_function;
|
|
||||||
} PreferenceUserLevelDefault;
|
|
||||||
|
|
||||||
#define USER_LEVEL_NONE -1
|
|
||||||
|
|
||||||
/* A structure that describes a single preference including defaults and visibility. */
|
/* A structure that describes a single preference including defaults and visibility. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
PreferenceType type;
|
PreferenceType type;
|
||||||
int visible_user_level;
|
const gpointer fallback_value;
|
||||||
const PreferenceUserLevelDefault default1;
|
PreferencesDefaultValueCallback fallback_callback;
|
||||||
const PreferenceUserLevelDefault default2;
|
GFreeFunc fallback_callback_result_free_function;
|
||||||
const char *enumeration_id;
|
const char *enumeration_id;
|
||||||
} PreferenceDefault;
|
} PreferenceDefault;
|
||||||
|
|
||||||
|
@ -263,42 +252,14 @@ typedef struct
|
||||||
* PREFERENCE_STRING
|
* PREFERENCE_STRING
|
||||||
* PREFERENCE_STRING_LIST
|
* PREFERENCE_STRING_LIST
|
||||||
*
|
*
|
||||||
* 3. visible_user_level
|
* 3. fallback_value
|
||||||
* The visible user level is the first user level at which the
|
* Emergency fallback value if our gconf schemas are hosed somehow.
|
||||||
* preference is visible. By default all preferences have a visibility of 0.
|
|
||||||
*
|
*
|
||||||
* A preference with a visible_user_level greater than 0, will be "visible"
|
* 4. fallback_callback
|
||||||
* only at that level or higher. Any getters that ask for that preference at
|
* callback to get dynamic fallback
|
||||||
* lower user levels will always receive the default value. Also, if the
|
|
||||||
* preference has an entry in the preferences dialog, it will not be shown
|
|
||||||
* unless the current user level is greater than or equal to the preference's
|
|
||||||
* visible user level.
|
|
||||||
*
|
*
|
||||||
* 4. default1
|
* 5. fallback_callback_result_free_function
|
||||||
* A pair of a user_level and a value (PreferenceUserLevelDefault). For the
|
* free result of fallback_callback
|
||||||
* left hand side user_level, the preference will have the right hand side
|
|
||||||
* default value.
|
|
||||||
*
|
|
||||||
* This pair does not need to be given. It can be { USER_LEVEL_NONE }, in
|
|
||||||
* which case the preference defaults to 0 at all user levels.
|
|
||||||
*
|
|
||||||
* 5. default2
|
|
||||||
* A pair of a user_level and a value (PreferenceUserLevelDefault). For the
|
|
||||||
* left hand side user_level, the preference will have the right hand side
|
|
||||||
* default value.
|
|
||||||
*
|
|
||||||
* This pair does not need to be given. It can be { USER_LEVEL_NONE }, in
|
|
||||||
* which case the preference defaults to 0 at all user levels.
|
|
||||||
*
|
|
||||||
* Notes:
|
|
||||||
*
|
|
||||||
* Define defaults only for preferences that need something other than 0 (integer)
|
|
||||||
* FALSE (boolean) or "" (string) as their defaults.
|
|
||||||
*
|
|
||||||
* Its possible to have different defaults for different user levels Its not
|
|
||||||
* required to have defaults for EACH user level. If there is no default
|
|
||||||
* installed for a high user level, the next lowest user level with a valid
|
|
||||||
* default is used.
|
|
||||||
*
|
*
|
||||||
* 6. enumeration_id
|
* 6. enumeration_id
|
||||||
* An an enumeration id is a unique string that identifies an enumeration.
|
* An an enumeration id is a unique string that identifies an enumeration.
|
||||||
|
@ -306,396 +267,304 @@ typedef struct
|
||||||
* The preferences dialog widgetry will use this enumeration id to find out
|
* The preferences dialog widgetry will use this enumeration id to find out
|
||||||
* what choices and descriptions of choices to present to the user.
|
* what choices and descriptions of choices to present to the user.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* NOTE THAT THE FALLBACKS HERE ARE NOT SUPPOSED TO BE USED -
|
||||||
|
* YOU SHOULD EDIT THE SCHEMAS FILE TO CHANGE DEFAULTS.
|
||||||
|
*/
|
||||||
static const PreferenceDefault preference_defaults[] = {
|
static const PreferenceDefault preference_defaults[] = {
|
||||||
{ NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
|
{ NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
|
{ NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_CONFIRM_TRASH,
|
{ NAUTILUS_PREFERENCES_CONFIRM_TRASH,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_ADVANCED,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ENABLE_DELETE,
|
{ NAUTILUS_PREFERENCES_ENABLE_DELETE,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_ADVANCED,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SHOW_TEXT_IN_ICONS,
|
{ NAUTILUS_PREFERENCES_SHOW_TEXT_IN_ICONS,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"speed_tradeoff"
|
"speed_tradeoff"
|
||||||
},
|
},
|
||||||
/* Don't show remote directory item counts for Beginner users because computing them
|
/* Don't show remote directory item counts by default
|
||||||
* can be annoyingly slow, especially for FTP. If we make this fast enough for FTP in
|
* because computing them can be annoyingly slow, especially
|
||||||
* particular, we should change this default to ALWAYS.
|
* for FTP. If we make this fast enough for FTP in particular,
|
||||||
|
* we should change this default to ALWAYS.
|
||||||
*/
|
*/
|
||||||
{ NAUTILUS_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
|
{ NAUTILUS_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY) },
|
NULL, NULL,
|
||||||
{ EEL_USER_LEVEL_INTERMEDIATE, GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_ALWAYS) },
|
|
||||||
"speed_tradeoff"
|
"speed_tradeoff"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_CLICK_POLICY,
|
{ NAUTILUS_PREFERENCES_CLICK_POLICY,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (NAUTILUS_CLICK_POLICY_DOUBLE),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"click_policy"
|
"click_policy"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION,
|
{ NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_ADVANCED,
|
GINT_TO_POINTER (NAUTILUS_EXECUTABLE_TEXT_ASK),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_EXECUTABLE_TEXT_ASK) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"executable_text_activation"
|
"executable_text_activation"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_THEME,
|
{ NAUTILUS_PREFERENCES_THEME,
|
||||||
PREFERENCE_STRING,
|
PREFERENCE_STRING,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
"default"
|
||||||
{ EEL_USER_LEVEL_NOVICE, "default" },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
|
{ NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"speed_tradeoff"
|
"speed_tradeoff"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_IMAGE_FILE_THUMBNAIL_LIMIT,
|
{ NAUTILUS_PREFERENCES_IMAGE_FILE_THUMBNAIL_LIMIT,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_ADVANCED,
|
GINT_TO_POINTER (3145728),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (3145728) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"file_size"
|
"file_size"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_USE_PUBLIC_METADATA,
|
{ NAUTILUS_PREFERENCES_USE_PUBLIC_METADATA,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_ADVANCED,
|
GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"speed_tradeoff"
|
"speed_tradeoff"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SMOOTH_GRAPHICS_MODE,
|
{ NAUTILUS_PREFERENCES_SMOOTH_GRAPHICS_MODE,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_PREVIEW_SOUND,
|
{ NAUTILUS_PREFERENCES_PREVIEW_SOUND,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"speed_tradeoff"
|
"speed_tradeoff"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SHOW_SPECIAL_FLAGS,
|
{ NAUTILUS_PREFERENCES_SHOW_SPECIAL_FLAGS,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_ADVANCED,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ EEL_USER_LEVEL_ADVANCED, GINT_TO_POINTER (TRUE) }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST,
|
{ NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SHOW_DESKTOP,
|
{ NAUTILUS_PREFERENCES_SHOW_DESKTOP,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR,
|
{ NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_ADVANCED,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_CAN_ADD_CONTENT,
|
{ NAUTILUS_PREFERENCES_CAN_ADD_CONTENT,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ EEL_USER_LEVEL_INTERMEDIATE, GINT_TO_POINTER (TRUE) }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SEARCH_BAR_TYPE,
|
{ NAUTILUS_PREFERENCES_SEARCH_BAR_TYPE,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (NAUTILUS_SIMPLE_SEARCH_BAR),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_SIMPLE_SEARCH_BAR) },
|
NULL, NULL,
|
||||||
{ EEL_USER_LEVEL_INTERMEDIATE, GINT_TO_POINTER (NAUTILUS_COMPLEX_SEARCH_BAR) },
|
|
||||||
"search_bar_type"
|
"search_bar_type"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
|
{ NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS,
|
||||||
PREFERENCE_STRING_LIST,
|
PREFERENCE_STRING_LIST,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
"size,date_modified,type",
|
||||||
{ EEL_USER_LEVEL_NOVICE, "size,date_modified,type", },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"icon_captions"
|
"icon_captions"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS,
|
{ NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
|
{ NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_ADVANCED,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
/* FIXME bugzilla.gnome.org 41245: Saved in pixels instead of in %? */
|
/* FIXME bugzilla.gnome.org 41245: Saved in pixels instead of in %? */
|
||||||
{ NAUTILUS_PREFERENCES_SIDEBAR_WIDTH,
|
{ NAUTILUS_PREFERENCES_SIDEBAR_WIDTH,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (148)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (148) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_SEARCH_WEB_URI,
|
{ NAUTILUS_PREFERENCES_SEARCH_WEB_URI,
|
||||||
PREFERENCE_STRING,
|
PREFERENCE_STRING,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
"http://www.google.com"
|
||||||
{ EEL_USER_LEVEL_NOVICE, "http://www.google.com" },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_START_WITH_TOOLBAR,
|
{ NAUTILUS_PREFERENCES_START_WITH_TOOLBAR,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR,
|
{ NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR,
|
{ NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
|
{ NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
|
{ NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Proxy defaults */
|
/* Proxy defaults */
|
||||||
{ NAUTILUS_PREFERENCES_HTTP_USE_PROXY,
|
{ NAUTILUS_PREFERENCES_HTTP_USE_PROXY,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_HTTP_PROXY_PORT,
|
{ NAUTILUS_PREFERENCES_HTTP_PROXY_PORT,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (8080)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (8080) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_HTTP_PROXY_USE_AUTH,
|
{ NAUTILUS_PREFERENCES_HTTP_PROXY_USE_AUTH,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Home URI */
|
/* Home URI */
|
||||||
{ NAUTILUS_PREFERENCES_HOME_URI,
|
{ NAUTILUS_PREFERENCES_HOME_URI,
|
||||||
PREFERENCE_STRING,
|
PREFERENCE_STRING,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
NULL, default_home_location_callback, g_free
|
||||||
{ EEL_USER_LEVEL_NOVICE, NULL, default_home_location_callback, g_free },
|
|
||||||
{ EEL_USER_LEVEL_INTERMEDIATE, NULL, default_home_location_callback, g_free },
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Default fonts */
|
/* Default fonts */
|
||||||
{ NAUTILUS_PREFERENCES_DEFAULT_FONT,
|
{ NAUTILUS_PREFERENCES_DEFAULT_FONT,
|
||||||
PREFERENCE_STRING,
|
PREFERENCE_STRING,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
NULL, default_font_callback, g_free
|
||||||
{ EEL_USER_LEVEL_NOVICE, NULL, default_font_callback, g_free },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_DEFAULT_FONT_SIZE,
|
{ NAUTILUS_PREFERENCES_DEFAULT_FONT_SIZE,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (12),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (12) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"standard_font_size"
|
"standard_font_size"
|
||||||
},
|
},
|
||||||
|
|
||||||
/* View Preferences */
|
/* View Preferences */
|
||||||
{ NAUTILUS_PREFERENCES_DEFAULT_FOLDER_VIEWER,
|
{ NAUTILUS_PREFERENCES_DEFAULT_FOLDER_VIEWER,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
NULL, default_default_folder_viewer_callback, NULL,
|
||||||
{ EEL_USER_LEVEL_NOVICE, NULL, default_default_folder_viewer_callback, NULL },
|
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"default_folder_viewer"
|
"default_folder_viewer"
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Icon View Default Preferences */
|
/* Icon View Default Preferences */
|
||||||
|
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_FONT,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_FONT,
|
||||||
PREFERENCE_STRING,
|
PREFERENCE_STRING,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
NULL, default_font_callback, g_free
|
||||||
{ EEL_USER_LEVEL_NOVICE, NULL, default_font_callback, g_free },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL_FONT_SIZE,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL_FONT_SIZE,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (12),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (12) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"standard_font_size"
|
"standard_font_size"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"default_icon_view_sort_order"
|
"default_icon_view_sort_order"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"default_icon_view_sort_order"
|
"default_icon_view_sort_order"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
|
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (NAUTILUS_ZOOM_LEVEL_STANDARD),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_ZOOM_LEVEL_STANDARD) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"default_zoom_level"
|
"default_zoom_level"
|
||||||
},
|
},
|
||||||
|
|
||||||
/* List View Default Preferences */
|
/* List View Default Preferences */
|
||||||
{ NAUTILUS_PREFERENCES_LIST_VIEW_FONT,
|
{ NAUTILUS_PREFERENCES_LIST_VIEW_FONT,
|
||||||
PREFERENCE_STRING,
|
PREFERENCE_STRING,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
NULL, default_font_callback, g_free
|
||||||
{ EEL_USER_LEVEL_NOVICE, NULL, default_font_callback, g_free },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL_FONT_SIZE,
|
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL_FONT_SIZE,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (12),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (12) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"standard_font_size"
|
"standard_font_size"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER,
|
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"default_list_view_sort_order"
|
"default_list_view_sort_order"
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
|
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
|
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (NAUTILUS_ZOOM_LEVEL_SMALLER),
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_ZOOM_LEVEL_SMALLER) },
|
NULL, NULL,
|
||||||
{ USER_LEVEL_NONE },
|
|
||||||
"default_zoom_level"
|
"default_zoom_level"
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Sidebar panel default */
|
/* Sidebar panel default */
|
||||||
{ nautilus_sidebar_news_enabled_preference_name,
|
{ nautilus_sidebar_news_enabled_preference_name,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ nautilus_sidebar_notes_enabled_preference_name,
|
{ nautilus_sidebar_notes_enabled_preference_name,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ nautilus_sidebar_history_enabled_preference_name,
|
{ nautilus_sidebar_history_enabled_preference_name,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ nautilus_sidebar_tree_enabled_preference_name,
|
{ nautilus_sidebar_tree_enabled_preference_name,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_INTERMEDIATE,
|
GINT_TO_POINTER (FALSE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
|
|
||||||
{ EEL_USER_LEVEL_INTERMEDIATE, GINT_TO_POINTER (TRUE) }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* news panel preferences */
|
/* news panel preferences */
|
||||||
{ NAUTILUS_PREFERENCES_NEWS_MAX_ITEMS,
|
{ NAUTILUS_PREFERENCES_NEWS_MAX_ITEMS,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (6)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (6) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
{ NAUTILUS_PREFERENCES_NEWS_UPDATE_INTERVAL,
|
{ NAUTILUS_PREFERENCES_NEWS_UPDATE_INTERVAL,
|
||||||
PREFERENCE_INTEGER,
|
PREFERENCE_INTEGER,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (5)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (5) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* non-visible preferences */
|
/* non-visible preferences */
|
||||||
{ NAUTILUS_PREFERENCES_ADD_TO_SESSION,
|
{ NAUTILUS_PREFERENCES_ADD_TO_SESSION,
|
||||||
PREFERENCE_BOOLEAN,
|
PREFERENCE_BOOLEAN,
|
||||||
EEL_USER_LEVEL_NOVICE,
|
GINT_TO_POINTER (TRUE)
|
||||||
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
|
|
||||||
{ USER_LEVEL_NONE }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{ NULL }
|
{ NULL }
|
||||||
|
@ -732,53 +601,46 @@ global_preferences_register_enumerations (void)
|
||||||
static void
|
static void
|
||||||
global_preferences_install_one_default (const char *preference_name,
|
global_preferences_install_one_default (const char *preference_name,
|
||||||
PreferenceType preference_type,
|
PreferenceType preference_type,
|
||||||
const PreferenceUserLevelDefault *user_level_default)
|
const PreferenceDefault *preference_default)
|
||||||
{
|
{
|
||||||
gpointer value = NULL;
|
gpointer value = NULL;
|
||||||
EelStringList *string_list_value;
|
EelStringList *string_list_value;
|
||||||
|
|
||||||
g_return_if_fail (preference_name != NULL);
|
g_return_if_fail (preference_name != NULL);
|
||||||
g_return_if_fail (preference_type >= PREFERENCE_BOOLEAN);
|
g_return_if_fail (preference_type >= PREFERENCE_BOOLEAN);
|
||||||
g_return_if_fail (preference_type <= PREFERENCE_STRING_LIST);
|
g_return_if_fail (preference_type <= PREFERENCE_STRING_LIST);
|
||||||
g_return_if_fail (user_level_default != NULL);
|
g_return_if_fail (preference_default != NULL);
|
||||||
|
|
||||||
if (user_level_default->user_level == USER_LEVEL_NONE) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If a callback is given, use that to fetch the default value */
|
/* If a callback is given, use that to fetch the default value */
|
||||||
if (user_level_default->callback != NULL) {
|
if (preference_default->fallback_callback != NULL) {
|
||||||
value = (* user_level_default->callback) (user_level_default->user_level);
|
value = (* preference_default->fallback_callback) ();
|
||||||
} else {
|
} else {
|
||||||
value = user_level_default->value;
|
value = preference_default->fallback_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (preference_type) {
|
switch (preference_type) {
|
||||||
case PREFERENCE_BOOLEAN:
|
case PREFERENCE_BOOLEAN:
|
||||||
eel_preferences_default_set_boolean (preference_name,
|
eel_preferences_set_emergency_fallback_boolean (preference_name,
|
||||||
user_level_default->user_level,
|
GPOINTER_TO_INT (value));
|
||||||
GPOINTER_TO_INT (value));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PREFERENCE_INTEGER:
|
case PREFERENCE_INTEGER:
|
||||||
eel_preferences_default_set_integer (preference_name,
|
eel_preferences_set_emergency_fallback_integer (preference_name,
|
||||||
user_level_default->user_level,
|
|
||||||
GPOINTER_TO_INT (value));
|
GPOINTER_TO_INT (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PREFERENCE_STRING:
|
case PREFERENCE_STRING:
|
||||||
eel_preferences_default_set_string (preference_name,
|
eel_preferences_set_emergency_fallback_string (preference_name,
|
||||||
user_level_default->user_level,
|
value);
|
||||||
value);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PREFERENCE_STRING_LIST:
|
case PREFERENCE_STRING_LIST:
|
||||||
string_list_value = eel_string_list_new_from_tokens (value,
|
string_list_value = eel_string_list_new_from_tokens (value,
|
||||||
STRING_LIST_DEFAULT_TOKENS_DELIMETER,
|
STRING_LIST_DEFAULT_TOKENS_DELIMETER,
|
||||||
TRUE);
|
TRUE);
|
||||||
eel_preferences_default_set_string_list (preference_name,
|
eel_preferences_set_emergency_fallback_string_list (preference_name,
|
||||||
user_level_default->user_level,
|
string_list_value);
|
||||||
string_list_value);
|
|
||||||
eel_string_list_free (string_list_value);
|
eel_string_list_free (string_list_value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -787,9 +649,9 @@ global_preferences_install_one_default (const char *preference_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the dynamic default value if needed */
|
/* Free the dynamic default value if needed */
|
||||||
if (user_level_default->callback != NULL
|
if (preference_default->fallback_callback != NULL
|
||||||
&& user_level_default->callback_result_free_function != NULL) {
|
&& preference_default->fallback_callback_result_free_function != NULL) {
|
||||||
(* user_level_default->callback_result_free_function) (value);
|
(* preference_default->fallback_callback_result_free_function) (value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,22 +673,13 @@ global_preferences_install_defaults (void)
|
||||||
for (i = 0; preference_defaults[i].name != NULL; i++) {
|
for (i = 0; preference_defaults[i].name != NULL; i++) {
|
||||||
global_preferences_install_one_default (preference_defaults[i].name,
|
global_preferences_install_one_default (preference_defaults[i].name,
|
||||||
preference_defaults[i].type,
|
preference_defaults[i].type,
|
||||||
&preference_defaults[i].default1);
|
&preference_defaults[i]);
|
||||||
|
|
||||||
global_preferences_install_one_default (preference_defaults[i].name,
|
|
||||||
preference_defaults[i].type,
|
|
||||||
&preference_defaults[i].default2);
|
|
||||||
|
|
||||||
eel_preferences_set_visible_user_level (preference_defaults[i].name,
|
|
||||||
preference_defaults[i].visible_user_level);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
default_font_callback (int user_level)
|
default_font_callback (void)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (eel_preferences_user_level_is_valid (user_level), NULL);
|
|
||||||
|
|
||||||
if (eel_dumb_down_for_multi_byte_locale_hack ()) {
|
if (eel_dumb_down_for_multi_byte_locale_hack ()) {
|
||||||
return g_strdup ("fixed");
|
return g_strdup ("fixed");
|
||||||
}
|
}
|
||||||
|
@ -849,7 +702,7 @@ get_default_folder_viewer_preference_from_iid (const char *iid)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
default_default_folder_viewer_callback (int user_level)
|
default_default_folder_viewer_callback (void)
|
||||||
{
|
{
|
||||||
Bonobo_ServerInfo *bonobo_activation_info;
|
Bonobo_ServerInfo *bonobo_activation_info;
|
||||||
int result;
|
int result;
|
||||||
|
@ -869,9 +722,8 @@ default_default_folder_viewer_callback (int user_level)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
default_home_location_callback (int user_level)
|
default_home_location_callback (void)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (eel_preferences_user_level_is_valid (user_level), NULL);
|
|
||||||
return gnome_vfs_get_uri_from_local_path (g_get_home_dir ());
|
return gnome_vfs_get_uri_from_local_path (g_get_home_dir ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -985,8 +837,8 @@ nautilus_global_preferences_init (void)
|
||||||
/* Install defaults */
|
/* Install defaults */
|
||||||
global_preferences_install_defaults ();
|
global_preferences_install_defaults ();
|
||||||
|
|
||||||
global_preferences_register_enumerations ();
|
global_preferences_register_enumerations ();
|
||||||
|
|
||||||
/* Add the gnome-vfs path to the list of monitored directories - for proxy settings */
|
/* Add the gnome-vfs path to the list of monitored directories - for proxy settings */
|
||||||
eel_preferences_monitor_directory (SYSTEM_GNOME_VFS_PATH);
|
eel_preferences_monitor_directory (SYSTEM_GNOME_VFS_PATH);
|
||||||
|
|
||||||
|
@ -1007,4 +859,9 @@ nautilus_global_preferences_init (void)
|
||||||
* widget machinery.
|
* widget machinery.
|
||||||
*/
|
*/
|
||||||
smooth_graphics_mode_changed_callback (NULL);
|
smooth_graphics_mode_changed_callback (NULL);
|
||||||
|
|
||||||
|
/* Preload everything in a big batch */
|
||||||
|
eel_gconf_preload_cache ("/apps/nautilus/preferences",
|
||||||
|
GCONF_CLIENT_PRELOAD_ONELEVEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
242
libnautilus-private/nautilus.schemas
Normal file
242
libnautilus-private/nautilus.schemas
Normal file
|
@ -0,0 +1,242 @@
|
||||||
|
<gconfschemafile>
|
||||||
|
<schemalist>
|
||||||
|
|
||||||
|
<!-- Keep the defaults in sync with the emergency fallbacks
|
||||||
|
in nautilus-global-preferences.c -->
|
||||||
|
|
||||||
|
<!-- General preferences -->
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/show_hidden_files</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/show_hidden_files</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>bool</type>
|
||||||
|
<default>false</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Whether to show dotfiles</short>
|
||||||
|
<long>
|
||||||
|
If set to true, then hidden files (dotfiles) are shown in
|
||||||
|
the file manager.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/show_backup_files</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/show_backup_files</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>bool</type>
|
||||||
|
<default>false</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Whether to show backup files</short>
|
||||||
|
<long>
|
||||||
|
If set to true, then backup files such as those created
|
||||||
|
by Emacs are displayed. Currently, only files ending in
|
||||||
|
a tilde (~) are considered backup files.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/confirm_trash</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/confirm_trash</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>bool</type>
|
||||||
|
<default>true</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Whether to ask for confirmation when moving files to trash</short>
|
||||||
|
<long>
|
||||||
|
If set to true, then Nautilus will ask for confirmation when
|
||||||
|
you attempt to put files in the trash.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/enable_delete</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/enable_delete</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>bool</type>
|
||||||
|
<default>false</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Whether to enable immediate deletion</short>
|
||||||
|
<long>
|
||||||
|
If set to true, then Nautilus will have a feature allowing
|
||||||
|
you to delete a file immediately and in-place, instead of moving it
|
||||||
|
to the trash. This feature can be dangerous, so use caution.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/show_icon_text</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/show_icon_text</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>string</type>
|
||||||
|
<default>local_only</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>When to show preview text in icons</short>
|
||||||
|
<long>
|
||||||
|
Speed tradeoff for when to show a preview of text file contents
|
||||||
|
in the file's icon.
|
||||||
|
If set to "always" then always show previews,
|
||||||
|
even if the directory is on a remote server.
|
||||||
|
If set to "local_only" then only show previews for local filesystems.
|
||||||
|
If set to "never" then never bother to read preview data.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/show_directory_item_counts</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/show_directory_item_counts</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>string</type>
|
||||||
|
<default>local_only</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>When to show number of items in a directory</short>
|
||||||
|
<long>
|
||||||
|
Speed tradeoff for when to show the number of items in a
|
||||||
|
directory. If set to "always" then always show item counts,
|
||||||
|
even if the directory is on a remote server.
|
||||||
|
If set to "local_only" then only show counts for local filesystems.
|
||||||
|
If set to "never" then never bother to compute item counts.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/click_policy</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/click_policy</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>string</type>
|
||||||
|
<default>double</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Type of click used to launch/open files</short>
|
||||||
|
<long>
|
||||||
|
Possible values are "single" to launch files on a single click,
|
||||||
|
or "double" to launch them on a double click.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/executable_text_activation</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/executable_text_activation</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>string</type>
|
||||||
|
<default>ask</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>What to do with executable text files when activated</short>
|
||||||
|
<long>
|
||||||
|
What to do with executable text files when they are activated
|
||||||
|
(single or double clicked).
|
||||||
|
Possible values are "launch" to launch them as programs,
|
||||||
|
"ask" to ask what to do via a dialog, and "display" to display
|
||||||
|
them as text files.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/theme</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/theme</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>string</type>
|
||||||
|
<default>default</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Current Nautilus theme</short>
|
||||||
|
<long>
|
||||||
|
Name of the Nautilus theme to use.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/show_image_thumbnails</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/show_image_thumbnails</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>string</type>
|
||||||
|
<default>local_only</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>When to show thumbnails of image files</short>
|
||||||
|
<long>
|
||||||
|
Speed tradeoff for when to show a image files as a thumbnail.
|
||||||
|
If set to "always" then always thumbnail,
|
||||||
|
even if the directory is on a remote server.
|
||||||
|
If set to "local_only" then only show thumbnails for local filesystems.
|
||||||
|
If set to "never" then never bother to thumbnail images,
|
||||||
|
just use a generic icon.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/thumbnail_limit</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/thumbnail_limit</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>int</type>
|
||||||
|
<default>3145728</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Maximum image size for thumbnailing</short>
|
||||||
|
<long>
|
||||||
|
Images over this size (in bytes) won't be
|
||||||
|
thumbnailed. The purpose of this setting is to
|
||||||
|
avoid thumbnailing large images that may
|
||||||
|
take a long time to load or use lots of memory.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/use_public_metadata</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/use_public_metadata</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>string</type>
|
||||||
|
<default>local_only</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Whether to store metadata in each directory, or in a single global location</short>
|
||||||
|
<long>
|
||||||
|
Nautilus records information about each directory you visit, such
|
||||||
|
as its background color, emblems, zoom level, and so on.
|
||||||
|
This information can be stored in one location in your home
|
||||||
|
directory, or it can be stored in each directory in hidden files.
|
||||||
|
The advantages of storing per-directory are that it's more robust
|
||||||
|
(can't be deleted in one go) and that for folders used by
|
||||||
|
multiple users, the metadata will be shared. So for example
|
||||||
|
all users can see emblems applied to files.
|
||||||
|
|
||||||
|
If this setting is "local_only", for local filesystems metadata
|
||||||
|
will be stored per-directory, and for remote connections
|
||||||
|
it will be stored in the user's home directory. If it's "never"
|
||||||
|
then all metadata will go in the user's home directory; if it's
|
||||||
|
"always" then all metadata will go in the directory being described.
|
||||||
|
(However, for read-only directories, metadata always goes in the
|
||||||
|
user's home directory.)
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/nautilus/preferences/smooth_graphics_mode</key>
|
||||||
|
<applyto>/apps/nautilus/preferences/smooth_graphics_mode</applyto>
|
||||||
|
<owner>nautilus</owner>
|
||||||
|
<type>bool</type>
|
||||||
|
<default>true</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>Whether to use smooth (antialiased) graphics</short>
|
||||||
|
<long>
|
||||||
|
If toggled on, smooth out jagged graphics, possibly
|
||||||
|
using more resources.
|
||||||
|
</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
|
||||||
|
</schemalist>
|
||||||
|
</gconfschemafile>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,13 +119,6 @@ static void schedule_refresh_bookmarks_menu (Naut
|
||||||
static void edit_bookmarks (NautilusWindow *window);
|
static void edit_bookmarks (NautilusWindow *window);
|
||||||
static void add_bookmark_for_current_location (NautilusWindow *window);
|
static void add_bookmark_for_current_location (NautilusWindow *window);
|
||||||
|
|
||||||
/* User level things */
|
|
||||||
static guint convert_verb_to_user_level (const char *verb);
|
|
||||||
static const char * convert_user_level_to_path (guint user_level);
|
|
||||||
static void switch_to_user_level (NautilusWindow *window,
|
|
||||||
int new_user_level);
|
|
||||||
|
|
||||||
|
|
||||||
#define NAUTILUS_MENU_PATH_NOVICE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Beginner Level"
|
#define NAUTILUS_MENU_PATH_NOVICE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Beginner Level"
|
||||||
#define NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Intermediate Level"
|
#define NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Intermediate Level"
|
||||||
#define NAUTILUS_MENU_PATH_EXPERT_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Advanced Level"
|
#define NAUTILUS_MENU_PATH_EXPERT_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Advanced Level"
|
||||||
|
@ -694,89 +687,6 @@ help_menu_nautilus_feedback_callback (BonoboUIComponent *component,
|
||||||
CUSTOMER_FEEDBACK_URI);
|
CUSTOMER_FEEDBACK_URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* utility routine to return an image corresponding to the passed-in user level */
|
|
||||||
|
|
||||||
static char *
|
|
||||||
get_user_level_icon_name (int user_level, gboolean is_selected)
|
|
||||||
{
|
|
||||||
const char *image_name;
|
|
||||||
char *full_image_name;
|
|
||||||
|
|
||||||
switch (user_level) {
|
|
||||||
case EEL_USER_LEVEL_NOVICE:
|
|
||||||
image_name = "novice";
|
|
||||||
break;
|
|
||||||
case EEL_USER_LEVEL_ADVANCED:
|
|
||||||
image_name = "expert";
|
|
||||||
break;
|
|
||||||
case EEL_USER_LEVEL_INTERMEDIATE:
|
|
||||||
default:
|
|
||||||
image_name = "intermediate";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_selected) {
|
|
||||||
full_image_name = g_strdup_printf ("nautilus/%s-selected.png", image_name);
|
|
||||||
} else {
|
|
||||||
full_image_name = g_strdup_printf ("nautilus/%s.png", image_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
return full_image_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* handle user level changes */
|
|
||||||
static void
|
|
||||||
switch_to_user_level (NautilusWindow *window, int new_user_level)
|
|
||||||
{
|
|
||||||
char *old_user_level_icon_name;
|
|
||||||
int old_user_level;
|
|
||||||
char *new_user_level_icon_name_selected;
|
|
||||||
|
|
||||||
if (window->details->shell_ui == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
old_user_level = eel_preferences_get_user_level ();
|
|
||||||
if (new_user_level == old_user_level) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
eel_preferences_set_user_level (new_user_level);
|
|
||||||
|
|
||||||
nautilus_window_ui_freeze (window);
|
|
||||||
|
|
||||||
bonobo_ui_component_freeze (window->details->shell_ui, NULL);
|
|
||||||
|
|
||||||
/* change the item icons to reflect the new user level */
|
|
||||||
old_user_level_icon_name = get_user_level_icon_name (old_user_level, FALSE);
|
|
||||||
nautilus_bonobo_set_icon (window->details->shell_ui,
|
|
||||||
convert_user_level_to_path (old_user_level),
|
|
||||||
old_user_level_icon_name);
|
|
||||||
g_free (old_user_level_icon_name);
|
|
||||||
|
|
||||||
new_user_level_icon_name_selected = get_user_level_icon_name (new_user_level, TRUE);
|
|
||||||
nautilus_bonobo_set_icon (window->details->shell_ui,
|
|
||||||
convert_user_level_to_path (new_user_level),
|
|
||||||
new_user_level_icon_name_selected);
|
|
||||||
g_free (new_user_level_icon_name_selected);
|
|
||||||
|
|
||||||
bonobo_ui_component_thaw (window->details->shell_ui, NULL);
|
|
||||||
|
|
||||||
nautilus_window_ui_thaw (window);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
user_level_menu_item_callback (BonoboUIComponent *component,
|
|
||||||
gpointer user_data,
|
|
||||||
const char *verb)
|
|
||||||
{
|
|
||||||
NautilusWindow *window;
|
|
||||||
|
|
||||||
window = NAUTILUS_WINDOW (user_data);
|
|
||||||
|
|
||||||
switch_to_user_level (window, convert_verb_to_user_level (verb));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callback_data)
|
remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callback_data)
|
||||||
{
|
{
|
||||||
|
@ -1203,54 +1113,6 @@ nautilus_window_initialize_go_menu (NautilusWindow *window)
|
||||||
GTK_OBJECT (window));
|
GTK_OBJECT (window));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
update_user_level_menu_item (NautilusWindow *window,
|
|
||||||
const char *menu_path,
|
|
||||||
guint item_user_level)
|
|
||||||
{
|
|
||||||
|
|
||||||
guint current_user_level;
|
|
||||||
char *icon_name;
|
|
||||||
|
|
||||||
if (window->details->shell_ui == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
current_user_level = eel_preferences_get_user_level ();
|
|
||||||
|
|
||||||
icon_name = get_user_level_icon_name (item_user_level, current_user_level == item_user_level);
|
|
||||||
|
|
||||||
nautilus_window_ui_freeze (window);
|
|
||||||
|
|
||||||
nautilus_bonobo_set_icon (window->details->shell_ui,
|
|
||||||
menu_path,
|
|
||||||
icon_name);
|
|
||||||
|
|
||||||
g_free (icon_name);
|
|
||||||
|
|
||||||
nautilus_window_ui_thaw (window);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
user_level_changed_callback (gpointer callback_data)
|
|
||||||
{
|
|
||||||
NautilusWindow *window;
|
|
||||||
|
|
||||||
g_return_if_fail (NAUTILUS_IS_WINDOW (callback_data));
|
|
||||||
|
|
||||||
window = NAUTILUS_WINDOW (callback_data);
|
|
||||||
|
|
||||||
update_user_level_menu_item (window,
|
|
||||||
NAUTILUS_MENU_PATH_NOVICE_ITEM,
|
|
||||||
EEL_USER_LEVEL_NOVICE);
|
|
||||||
update_user_level_menu_item (window,
|
|
||||||
NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM,
|
|
||||||
EEL_USER_LEVEL_INTERMEDIATE);
|
|
||||||
update_user_level_menu_item (window,
|
|
||||||
NAUTILUS_MENU_PATH_EXPERT_ITEM,
|
|
||||||
EEL_USER_LEVEL_ADVANCED);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nautilus_window_initialize_menus
|
* nautilus_window_initialize_menus
|
||||||
*
|
*
|
||||||
|
@ -1302,12 +1164,7 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
|
||||||
BONOBO_UI_VERB ("Nautilus Quick Reference", help_menu_nautilus_quick_reference_callback),
|
BONOBO_UI_VERB ("Nautilus Quick Reference", help_menu_nautilus_quick_reference_callback),
|
||||||
BONOBO_UI_VERB ("Nautilus Release Notes", help_menu_nautilus_release_notes_callback),
|
BONOBO_UI_VERB ("Nautilus Release Notes", help_menu_nautilus_release_notes_callback),
|
||||||
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
|
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
|
||||||
|
|
||||||
BONOBO_UI_VERB ("Switch to Beginner Level", user_level_menu_item_callback),
|
|
||||||
BONOBO_UI_VERB ("Switch to Intermediate Level", user_level_menu_item_callback),
|
|
||||||
BONOBO_UI_VERB ("Switch to Advanced Level", user_level_menu_item_callback),
|
|
||||||
BONOBO_UI_VERB ("User Level Customization", user_level_customize_callback),
|
BONOBO_UI_VERB ("User Level Customization", user_level_customize_callback),
|
||||||
|
|
||||||
BONOBO_UI_VERB ("Stop", stop_button_callback),
|
BONOBO_UI_VERB ("Stop", stop_button_callback),
|
||||||
|
|
||||||
BONOBO_UI_VERB_END
|
BONOBO_UI_VERB_END
|
||||||
|
@ -1321,14 +1178,6 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
|
||||||
|
|
||||||
nautilus_window_update_show_hide_menu_items (window);
|
nautilus_window_update_show_hide_menu_items (window);
|
||||||
|
|
||||||
/* Keep track of user level changes to update the user level menu item icons */
|
|
||||||
eel_preferences_add_callback_while_alive ("user_level",
|
|
||||||
user_level_changed_callback,
|
|
||||||
window,
|
|
||||||
G_OBJECT (window));
|
|
||||||
/* Update the user level menu items for the first time */
|
|
||||||
user_level_changed_callback (window);
|
|
||||||
|
|
||||||
/* Register to catch Bonobo UI events so we can notice View As changes */
|
/* Register to catch Bonobo UI events so we can notice View As changes */
|
||||||
g_signal_connect (window->details->shell_ui, "ui_event",
|
g_signal_connect (window->details->shell_ui, "ui_event",
|
||||||
G_CALLBACK (nautilus_window_handle_ui_event_callback), window);
|
G_CALLBACK (nautilus_window_handle_ui_event_callback), window);
|
||||||
|
@ -1520,35 +1369,3 @@ schedule_refresh_go_menu (NautilusWindow *window)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static guint
|
|
||||||
convert_verb_to_user_level (const char *verb)
|
|
||||||
{
|
|
||||||
g_assert (verb != NULL);
|
|
||||||
|
|
||||||
if (strcmp (verb, SWITCH_TO_BEGINNER_VERB) == 0) {
|
|
||||||
return EEL_USER_LEVEL_NOVICE;
|
|
||||||
} else if (strcmp (verb, SWITCH_TO_INTERMEDIATE_VERB) == 0) {
|
|
||||||
return EEL_USER_LEVEL_INTERMEDIATE;
|
|
||||||
} else if (strcmp (verb, SWITCH_TO_ADVANCED_VERB) == 0) {
|
|
||||||
return EEL_USER_LEVEL_ADVANCED;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_assert_not_reached ();
|
|
||||||
return EEL_USER_LEVEL_NOVICE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *
|
|
||||||
convert_user_level_to_path (guint user_level)
|
|
||||||
{
|
|
||||||
switch (user_level) {
|
|
||||||
case EEL_USER_LEVEL_NOVICE:
|
|
||||||
return NAUTILUS_MENU_PATH_NOVICE_ITEM;
|
|
||||||
case EEL_USER_LEVEL_INTERMEDIATE:
|
|
||||||
return NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM;
|
|
||||||
case EEL_USER_LEVEL_ADVANCED:
|
|
||||||
return NAUTILUS_MENU_PATH_EXPERT_ITEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_assert_not_reached ();
|
|
||||||
return NAUTILUS_MENU_PATH_NOVICE_ITEM;
|
|
||||||
}
|
|
||||||
|
|
|
@ -124,6 +124,11 @@
|
||||||
|
|
||||||
<separator/>
|
<separator/>
|
||||||
|
|
||||||
|
<menuitem name="User Level Customization"
|
||||||
|
_label="P_references..."
|
||||||
|
_tip="Edit Nautilus preferences"
|
||||||
|
verb="User Level Customization"/>
|
||||||
|
|
||||||
<menuitem name="Customize"
|
<menuitem name="Customize"
|
||||||
_label="_Backgrounds and Emblems..."
|
_label="_Backgrounds and Emblems..."
|
||||||
_tip="Display patterns, colors, and emblems that can be used to customize appearance"
|
_tip="Display patterns, colors, and emblems that can be used to customize appearance"
|
||||||
|
@ -253,29 +258,6 @@
|
||||||
verb="Report Profiling"/>
|
verb="Report Profiling"/>
|
||||||
</submenu>
|
</submenu>
|
||||||
|
|
||||||
<submenu name="Preferences" _label="_Preferences">
|
|
||||||
|
|
||||||
<placeholder name="User Levels Placeholder" delimit="none">
|
|
||||||
<menuitem name="Switch to Beginner Level"
|
|
||||||
_label=" _Beginner"
|
|
||||||
_tip="Use preferences appropriate for beginners"
|
|
||||||
verb="" pixtype="filename"/>
|
|
||||||
<menuitem name="Switch to Intermediate Level"
|
|
||||||
_label=" _Intermediate"
|
|
||||||
_tip="Use preferences appropriate for most people"
|
|
||||||
verb="" pixtype="filename"/>
|
|
||||||
<menuitem name="Switch to Advanced Level"
|
|
||||||
_label=" _Advanced"
|
|
||||||
_tip="Use preferences appropriate for experts"
|
|
||||||
verb="" pixtype="filename"/>
|
|
||||||
</placeholder>
|
|
||||||
<separator/>
|
|
||||||
<menuitem name="User Level Customization"
|
|
||||||
_label="_Edit Preferences..."
|
|
||||||
_tip="Edit various Nautilus preferences"
|
|
||||||
verb="User Level Customization"/>
|
|
||||||
</submenu>
|
|
||||||
|
|
||||||
<submenu name="Help" _label="_Help">
|
<submenu name="Help" _label="_Help">
|
||||||
<menuitem name="Nautilus Manual"
|
<menuitem name="Nautilus Manual"
|
||||||
_label="Nautilus User _Manual"
|
_label="Nautilus User _Manual"
|
||||||
|
|
|
@ -119,13 +119,6 @@ static void schedule_refresh_bookmarks_menu (Naut
|
||||||
static void edit_bookmarks (NautilusWindow *window);
|
static void edit_bookmarks (NautilusWindow *window);
|
||||||
static void add_bookmark_for_current_location (NautilusWindow *window);
|
static void add_bookmark_for_current_location (NautilusWindow *window);
|
||||||
|
|
||||||
/* User level things */
|
|
||||||
static guint convert_verb_to_user_level (const char *verb);
|
|
||||||
static const char * convert_user_level_to_path (guint user_level);
|
|
||||||
static void switch_to_user_level (NautilusWindow *window,
|
|
||||||
int new_user_level);
|
|
||||||
|
|
||||||
|
|
||||||
#define NAUTILUS_MENU_PATH_NOVICE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Beginner Level"
|
#define NAUTILUS_MENU_PATH_NOVICE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Beginner Level"
|
||||||
#define NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Intermediate Level"
|
#define NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Intermediate Level"
|
||||||
#define NAUTILUS_MENU_PATH_EXPERT_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Advanced Level"
|
#define NAUTILUS_MENU_PATH_EXPERT_ITEM "/menu/Preferences/User Levels Placeholder/Switch to Advanced Level"
|
||||||
|
@ -694,89 +687,6 @@ help_menu_nautilus_feedback_callback (BonoboUIComponent *component,
|
||||||
CUSTOMER_FEEDBACK_URI);
|
CUSTOMER_FEEDBACK_URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* utility routine to return an image corresponding to the passed-in user level */
|
|
||||||
|
|
||||||
static char *
|
|
||||||
get_user_level_icon_name (int user_level, gboolean is_selected)
|
|
||||||
{
|
|
||||||
const char *image_name;
|
|
||||||
char *full_image_name;
|
|
||||||
|
|
||||||
switch (user_level) {
|
|
||||||
case EEL_USER_LEVEL_NOVICE:
|
|
||||||
image_name = "novice";
|
|
||||||
break;
|
|
||||||
case EEL_USER_LEVEL_ADVANCED:
|
|
||||||
image_name = "expert";
|
|
||||||
break;
|
|
||||||
case EEL_USER_LEVEL_INTERMEDIATE:
|
|
||||||
default:
|
|
||||||
image_name = "intermediate";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_selected) {
|
|
||||||
full_image_name = g_strdup_printf ("nautilus/%s-selected.png", image_name);
|
|
||||||
} else {
|
|
||||||
full_image_name = g_strdup_printf ("nautilus/%s.png", image_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
return full_image_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* handle user level changes */
|
|
||||||
static void
|
|
||||||
switch_to_user_level (NautilusWindow *window, int new_user_level)
|
|
||||||
{
|
|
||||||
char *old_user_level_icon_name;
|
|
||||||
int old_user_level;
|
|
||||||
char *new_user_level_icon_name_selected;
|
|
||||||
|
|
||||||
if (window->details->shell_ui == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
old_user_level = eel_preferences_get_user_level ();
|
|
||||||
if (new_user_level == old_user_level) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
eel_preferences_set_user_level (new_user_level);
|
|
||||||
|
|
||||||
nautilus_window_ui_freeze (window);
|
|
||||||
|
|
||||||
bonobo_ui_component_freeze (window->details->shell_ui, NULL);
|
|
||||||
|
|
||||||
/* change the item icons to reflect the new user level */
|
|
||||||
old_user_level_icon_name = get_user_level_icon_name (old_user_level, FALSE);
|
|
||||||
nautilus_bonobo_set_icon (window->details->shell_ui,
|
|
||||||
convert_user_level_to_path (old_user_level),
|
|
||||||
old_user_level_icon_name);
|
|
||||||
g_free (old_user_level_icon_name);
|
|
||||||
|
|
||||||
new_user_level_icon_name_selected = get_user_level_icon_name (new_user_level, TRUE);
|
|
||||||
nautilus_bonobo_set_icon (window->details->shell_ui,
|
|
||||||
convert_user_level_to_path (new_user_level),
|
|
||||||
new_user_level_icon_name_selected);
|
|
||||||
g_free (new_user_level_icon_name_selected);
|
|
||||||
|
|
||||||
bonobo_ui_component_thaw (window->details->shell_ui, NULL);
|
|
||||||
|
|
||||||
nautilus_window_ui_thaw (window);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
user_level_menu_item_callback (BonoboUIComponent *component,
|
|
||||||
gpointer user_data,
|
|
||||||
const char *verb)
|
|
||||||
{
|
|
||||||
NautilusWindow *window;
|
|
||||||
|
|
||||||
window = NAUTILUS_WINDOW (user_data);
|
|
||||||
|
|
||||||
switch_to_user_level (window, convert_verb_to_user_level (verb));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callback_data)
|
remove_bookmarks_for_uri_if_yes (GtkDialog *dialog, int response, gpointer callback_data)
|
||||||
{
|
{
|
||||||
|
@ -1203,54 +1113,6 @@ nautilus_window_initialize_go_menu (NautilusWindow *window)
|
||||||
GTK_OBJECT (window));
|
GTK_OBJECT (window));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
update_user_level_menu_item (NautilusWindow *window,
|
|
||||||
const char *menu_path,
|
|
||||||
guint item_user_level)
|
|
||||||
{
|
|
||||||
|
|
||||||
guint current_user_level;
|
|
||||||
char *icon_name;
|
|
||||||
|
|
||||||
if (window->details->shell_ui == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
current_user_level = eel_preferences_get_user_level ();
|
|
||||||
|
|
||||||
icon_name = get_user_level_icon_name (item_user_level, current_user_level == item_user_level);
|
|
||||||
|
|
||||||
nautilus_window_ui_freeze (window);
|
|
||||||
|
|
||||||
nautilus_bonobo_set_icon (window->details->shell_ui,
|
|
||||||
menu_path,
|
|
||||||
icon_name);
|
|
||||||
|
|
||||||
g_free (icon_name);
|
|
||||||
|
|
||||||
nautilus_window_ui_thaw (window);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
user_level_changed_callback (gpointer callback_data)
|
|
||||||
{
|
|
||||||
NautilusWindow *window;
|
|
||||||
|
|
||||||
g_return_if_fail (NAUTILUS_IS_WINDOW (callback_data));
|
|
||||||
|
|
||||||
window = NAUTILUS_WINDOW (callback_data);
|
|
||||||
|
|
||||||
update_user_level_menu_item (window,
|
|
||||||
NAUTILUS_MENU_PATH_NOVICE_ITEM,
|
|
||||||
EEL_USER_LEVEL_NOVICE);
|
|
||||||
update_user_level_menu_item (window,
|
|
||||||
NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM,
|
|
||||||
EEL_USER_LEVEL_INTERMEDIATE);
|
|
||||||
update_user_level_menu_item (window,
|
|
||||||
NAUTILUS_MENU_PATH_EXPERT_ITEM,
|
|
||||||
EEL_USER_LEVEL_ADVANCED);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nautilus_window_initialize_menus
|
* nautilus_window_initialize_menus
|
||||||
*
|
*
|
||||||
|
@ -1302,12 +1164,7 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
|
||||||
BONOBO_UI_VERB ("Nautilus Quick Reference", help_menu_nautilus_quick_reference_callback),
|
BONOBO_UI_VERB ("Nautilus Quick Reference", help_menu_nautilus_quick_reference_callback),
|
||||||
BONOBO_UI_VERB ("Nautilus Release Notes", help_menu_nautilus_release_notes_callback),
|
BONOBO_UI_VERB ("Nautilus Release Notes", help_menu_nautilus_release_notes_callback),
|
||||||
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
|
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
|
||||||
|
|
||||||
BONOBO_UI_VERB ("Switch to Beginner Level", user_level_menu_item_callback),
|
|
||||||
BONOBO_UI_VERB ("Switch to Intermediate Level", user_level_menu_item_callback),
|
|
||||||
BONOBO_UI_VERB ("Switch to Advanced Level", user_level_menu_item_callback),
|
|
||||||
BONOBO_UI_VERB ("User Level Customization", user_level_customize_callback),
|
BONOBO_UI_VERB ("User Level Customization", user_level_customize_callback),
|
||||||
|
|
||||||
BONOBO_UI_VERB ("Stop", stop_button_callback),
|
BONOBO_UI_VERB ("Stop", stop_button_callback),
|
||||||
|
|
||||||
BONOBO_UI_VERB_END
|
BONOBO_UI_VERB_END
|
||||||
|
@ -1321,14 +1178,6 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
|
||||||
|
|
||||||
nautilus_window_update_show_hide_menu_items (window);
|
nautilus_window_update_show_hide_menu_items (window);
|
||||||
|
|
||||||
/* Keep track of user level changes to update the user level menu item icons */
|
|
||||||
eel_preferences_add_callback_while_alive ("user_level",
|
|
||||||
user_level_changed_callback,
|
|
||||||
window,
|
|
||||||
G_OBJECT (window));
|
|
||||||
/* Update the user level menu items for the first time */
|
|
||||||
user_level_changed_callback (window);
|
|
||||||
|
|
||||||
/* Register to catch Bonobo UI events so we can notice View As changes */
|
/* Register to catch Bonobo UI events so we can notice View As changes */
|
||||||
g_signal_connect (window->details->shell_ui, "ui_event",
|
g_signal_connect (window->details->shell_ui, "ui_event",
|
||||||
G_CALLBACK (nautilus_window_handle_ui_event_callback), window);
|
G_CALLBACK (nautilus_window_handle_ui_event_callback), window);
|
||||||
|
@ -1520,35 +1369,3 @@ schedule_refresh_go_menu (NautilusWindow *window)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static guint
|
|
||||||
convert_verb_to_user_level (const char *verb)
|
|
||||||
{
|
|
||||||
g_assert (verb != NULL);
|
|
||||||
|
|
||||||
if (strcmp (verb, SWITCH_TO_BEGINNER_VERB) == 0) {
|
|
||||||
return EEL_USER_LEVEL_NOVICE;
|
|
||||||
} else if (strcmp (verb, SWITCH_TO_INTERMEDIATE_VERB) == 0) {
|
|
||||||
return EEL_USER_LEVEL_INTERMEDIATE;
|
|
||||||
} else if (strcmp (verb, SWITCH_TO_ADVANCED_VERB) == 0) {
|
|
||||||
return EEL_USER_LEVEL_ADVANCED;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_assert_not_reached ();
|
|
||||||
return EEL_USER_LEVEL_NOVICE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *
|
|
||||||
convert_user_level_to_path (guint user_level)
|
|
||||||
{
|
|
||||||
switch (user_level) {
|
|
||||||
case EEL_USER_LEVEL_NOVICE:
|
|
||||||
return NAUTILUS_MENU_PATH_NOVICE_ITEM;
|
|
||||||
case EEL_USER_LEVEL_INTERMEDIATE:
|
|
||||||
return NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM;
|
|
||||||
case EEL_USER_LEVEL_ADVANCED:
|
|
||||||
return NAUTILUS_MENU_PATH_EXPERT_ITEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_assert_not_reached ();
|
|
||||||
return NAUTILUS_MENU_PATH_NOVICE_ITEM;
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,39 +6,6 @@
|
||||||
#include <libnautilus-private/nautilus-global-preferences.h>
|
#include <libnautilus-private/nautilus-global-preferences.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static void
|
|
||||||
user_level_changed_callback (gpointer callback_data)
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
int user_level;
|
|
||||||
int visible_user_level;
|
|
||||||
|
|
||||||
g_return_if_fail (EEL_IS_STRING_PICKER (callback_data));
|
|
||||||
|
|
||||||
|
|
||||||
name = eel_caption_get_title_label (EEL_CAPTION (callback_data));
|
|
||||||
|
|
||||||
user_level = eel_preferences_get_user_level ();
|
|
||||||
visible_user_level = eel_preferences_get_visible_user_level (name);
|
|
||||||
|
|
||||||
if (visible_user_level <= user_level) {
|
|
||||||
gtk_widget_show (GTK_WIDGET (callback_data));
|
|
||||||
} else {
|
|
||||||
gtk_widget_hide (GTK_WIDGET (callback_data));
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
g_print ("%s(data=%s) user_level = %d, visible_user_level = %d, action = %s\n",
|
|
||||||
__FUNCTION__,
|
|
||||||
name,
|
|
||||||
user_level,
|
|
||||||
visible_user_level,
|
|
||||||
(visible_user_level <= user_level) ? "show" : "hide");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_free (name);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fruits_changed_callback (gpointer callback_data)
|
fruits_changed_callback (gpointer callback_data)
|
||||||
{
|
{
|
||||||
|
@ -64,25 +31,6 @@ int_picker_changed_callback (EelStringPicker *string_picker,
|
||||||
g_free (selected_string);
|
g_free (selected_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
user_level_picker_changed_callback (EelStringPicker *string_picker,
|
|
||||||
gpointer callback_data)
|
|
||||||
{
|
|
||||||
char *selected_string;
|
|
||||||
int new_user_level;
|
|
||||||
|
|
||||||
g_return_if_fail (EEL_IS_STRING_PICKER (string_picker));
|
|
||||||
g_return_if_fail (callback_data != NULL);
|
|
||||||
|
|
||||||
selected_string = eel_string_picker_get_selected_string (string_picker);
|
|
||||||
|
|
||||||
new_user_level = eel_string_picker_get_index_for_string (string_picker, selected_string);
|
|
||||||
|
|
||||||
eel_preferences_set_user_level (new_user_level);
|
|
||||||
|
|
||||||
g_free (selected_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
picker_new (const char *name,
|
picker_new (const char *name,
|
||||||
const EelStringList *entries)
|
const EelStringList *entries)
|
||||||
|
@ -100,33 +48,6 @@ picker_new (const char *name,
|
||||||
eel_string_picker_set_string_list (EEL_STRING_PICKER (string_picker), entries);
|
eel_string_picker_set_string_list (EEL_STRING_PICKER (string_picker), entries);
|
||||||
eel_string_picker_set_selected_string_index (EEL_STRING_PICKER (string_picker),
|
eel_string_picker_set_selected_string_index (EEL_STRING_PICKER (string_picker),
|
||||||
eel_preferences_get_integer (name));
|
eel_preferences_get_integer (name));
|
||||||
|
|
||||||
eel_preferences_add_callback ("user_level", user_level_changed_callback, string_picker);
|
|
||||||
user_level_changed_callback (string_picker);
|
|
||||||
|
|
||||||
return string_picker;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
|
||||||
user_level_picker_new (const char *name,
|
|
||||||
const EelStringList *entries)
|
|
||||||
{
|
|
||||||
GtkWidget *string_picker;
|
|
||||||
|
|
||||||
g_return_val_if_fail (name != NULL, NULL);
|
|
||||||
g_return_val_if_fail (entries != NULL, NULL);
|
|
||||||
|
|
||||||
string_picker = eel_string_picker_new ();
|
|
||||||
eel_caption_set_title_label (EEL_CAPTION (string_picker), name);
|
|
||||||
g_signal_connect (string_picker, "changed", G_CALLBACK (user_level_picker_changed_callback),
|
|
||||||
(gpointer) name);
|
|
||||||
|
|
||||||
eel_string_picker_set_string_list (EEL_STRING_PICKER (string_picker), entries);
|
|
||||||
eel_string_picker_set_selected_string_index (EEL_STRING_PICKER (string_picker),
|
|
||||||
eel_preferences_get_user_level ());
|
|
||||||
|
|
||||||
eel_preferences_add_callback ("user_level", user_level_changed_callback, string_picker);
|
|
||||||
user_level_changed_callback (string_picker);
|
|
||||||
|
|
||||||
return string_picker;
|
return string_picker;
|
||||||
}
|
}
|
||||||
|
@ -135,8 +56,6 @@ int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GtkWidget *window;
|
GtkWidget *window;
|
||||||
|
|
||||||
GtkWidget *user_level_picker;
|
|
||||||
GtkWidget *green_picker;
|
GtkWidget *green_picker;
|
||||||
GtkWidget *yellow_picker;
|
GtkWidget *yellow_picker;
|
||||||
GtkWidget *red_picker;
|
GtkWidget *red_picker;
|
||||||
|
@ -157,36 +76,16 @@ main (int argc, char *argv[])
|
||||||
user_level_entries = eel_string_list_new_from_tokens ("Beginner,Intermediate,Advanced", ",", TRUE);
|
user_level_entries = eel_string_list_new_from_tokens ("Beginner,Intermediate,Advanced", ",", TRUE);
|
||||||
color_entries = eel_string_list_new_from_tokens ("0,1,2,3,4,5,6,7,8,9,10", ",", TRUE);
|
color_entries = eel_string_list_new_from_tokens ("0,1,2,3,4,5,6,7,8,9,10", ",", TRUE);
|
||||||
fruits_entries = eel_string_list_new_from_tokens ("0,1,2,3", ",", TRUE);
|
fruits_entries = eel_string_list_new_from_tokens ("0,1,2,3", ",", TRUE);
|
||||||
|
|
||||||
eel_preferences_default_set_string ("user_level",
|
|
||||||
EEL_USER_LEVEL_NOVICE,
|
|
||||||
"advanced");
|
|
||||||
|
|
||||||
eel_preferences_default_set_integer ("green",
|
eel_preferences_set_emergency_fallback_integer ("green", 3);
|
||||||
EEL_USER_LEVEL_NOVICE,
|
|
||||||
3);
|
|
||||||
|
|
||||||
eel_preferences_default_set_integer ("yellow",
|
eel_preferences_set_emergency_fallback_integer ("yellow", 9);
|
||||||
EEL_USER_LEVEL_NOVICE,
|
|
||||||
9);
|
|
||||||
|
|
||||||
eel_preferences_default_set_integer ("red",
|
eel_preferences_set_emergency_fallback_integer ("red", 7);
|
||||||
EEL_USER_LEVEL_NOVICE,
|
|
||||||
7);
|
|
||||||
|
|
||||||
eel_preferences_default_set_integer ("fruits/apple",
|
eel_preferences_set_emergency_fallback_integer ("fruits/apple", 1);
|
||||||
EEL_USER_LEVEL_NOVICE,
|
eel_preferences_set_emergency_fallback_integer ("fruits/orange", 2);
|
||||||
1);
|
eel_preferences_set_emergency_fallback_integer ("fruits/pear", 3);
|
||||||
eel_preferences_default_set_integer ("fruits/orange",
|
|
||||||
EEL_USER_LEVEL_NOVICE,
|
|
||||||
2);
|
|
||||||
eel_preferences_default_set_integer ("fruits/pear",
|
|
||||||
EEL_USER_LEVEL_NOVICE,
|
|
||||||
3);
|
|
||||||
|
|
||||||
eel_preferences_set_visible_user_level ("yellow", 1);
|
|
||||||
eel_preferences_set_visible_user_level ("green", 0);
|
|
||||||
eel_preferences_set_visible_user_level ("red", 2);
|
|
||||||
|
|
||||||
//sleep (10);
|
//sleep (10);
|
||||||
|
|
||||||
|
@ -195,16 +94,14 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 2);
|
vbox = gtk_vbox_new (FALSE, 2);
|
||||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||||
|
|
||||||
user_level_picker = user_level_picker_new ("user_level", user_level_entries);
|
|
||||||
green_picker = picker_new ("green", color_entries);
|
green_picker = picker_new ("green", color_entries);
|
||||||
yellow_picker = picker_new ("yellow", color_entries);
|
yellow_picker = picker_new ("yellow", color_entries);
|
||||||
red_picker = picker_new ("red", color_entries);
|
red_picker = picker_new ("red", color_entries);
|
||||||
fruits_apple_picker = picker_new ("fruits/apple", fruits_entries);
|
fruits_apple_picker = picker_new ("fruits/apple", fruits_entries);
|
||||||
fruits_orange_picker = picker_new ("fruits/orange", fruits_entries);
|
fruits_orange_picker = picker_new ("fruits/orange", fruits_entries);
|
||||||
fruits_pear_picker = picker_new ("fruits/pear", fruits_entries);
|
fruits_pear_picker = picker_new ("fruits/pear", fruits_entries);
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), user_level_picker, FALSE, FALSE, 0);
|
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), green_picker, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), green_picker, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), yellow_picker, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), yellow_picker, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), red_picker, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), red_picker, FALSE, FALSE, 0);
|
||||||
|
@ -218,12 +115,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
eel_preferences_add_callback ("fruits", fruits_changed_callback, NULL);
|
eel_preferences_add_callback ("fruits", fruits_changed_callback, NULL);
|
||||||
|
|
||||||
gtk_widget_show (vbox);
|
gtk_widget_show_all (window);
|
||||||
gtk_widget_show (window);
|
|
||||||
|
|
||||||
// user_level_changed_callback (green_picker);
|
|
||||||
// user_level_changed_callback (yellow_picker);
|
|
||||||
// user_level_changed_callback (red_picker);
|
|
||||||
|
|
||||||
gtk_main ();
|
gtk_main ();
|
||||||
|
|
||||||
|
|
|
@ -20,33 +20,6 @@ text_caption_update (EelTextCaption *text_caption,
|
||||||
test_text_caption_set_text_for_int_preferences (text_caption, name);
|
test_text_caption_set_text_for_int_preferences (text_caption, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
user_level_caption_update (EelTextCaption *text_caption)
|
|
||||||
{
|
|
||||||
char *old_text;
|
|
||||||
char *new_text;
|
|
||||||
|
|
||||||
g_return_if_fail (EEL_IS_TEXT_CAPTION (text_caption));
|
|
||||||
|
|
||||||
old_text = eel_text_caption_get_text (text_caption);
|
|
||||||
new_text = eel_preferences_get ("user_level");
|
|
||||||
|
|
||||||
g_print ("'%s' changed from '%s' to '%s'\n",
|
|
||||||
"user_level",
|
|
||||||
old_text, new_text);
|
|
||||||
|
|
||||||
g_free (old_text);
|
|
||||||
g_free (new_text);
|
|
||||||
|
|
||||||
test_text_caption_set_text_for_string_preferences (text_caption, "user_level");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
user_level_changed_callback (gpointer callback_data)
|
|
||||||
{
|
|
||||||
user_level_caption_update (EEL_TEXT_CAPTION (callback_data));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
green_changed_callback (gpointer callback_data)
|
green_changed_callback (gpointer callback_data)
|
||||||
{
|
{
|
||||||
|
@ -113,28 +86,6 @@ entry_new (const char *name,
|
||||||
return hbox;
|
return hbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
|
||||||
user_level_frame_new (void)
|
|
||||||
{
|
|
||||||
GtkWidget *user_level_caption;
|
|
||||||
GtkWidget *user_level_default_caption;
|
|
||||||
GtkWidget *user_level_hbox;
|
|
||||||
GtkWidget *frame;
|
|
||||||
|
|
||||||
frame = gtk_frame_new ("user_level");
|
|
||||||
|
|
||||||
user_level_hbox = entry_new ("user_level", &user_level_caption, &user_level_default_caption);
|
|
||||||
test_text_caption_set_text_for_string_preferences (EEL_TEXT_CAPTION (user_level_caption), "user_level");
|
|
||||||
test_text_caption_set_text_for_default_string_preferences (EEL_TEXT_CAPTION (user_level_default_caption), "user_level");
|
|
||||||
eel_preferences_add_callback ("user_level", user_level_changed_callback, user_level_caption);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (frame), user_level_hbox);
|
|
||||||
|
|
||||||
gtk_widget_show_all (frame);
|
|
||||||
|
|
||||||
return frame;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
colors_frame_new (void)
|
colors_frame_new (void)
|
||||||
{
|
{
|
||||||
|
@ -237,7 +188,6 @@ main (int argc, char *argv[])
|
||||||
GtkWidget *window;
|
GtkWidget *window;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
|
|
||||||
GtkWidget *user_level_frame;
|
|
||||||
GtkWidget *colors_frame;
|
GtkWidget *colors_frame;
|
||||||
GtkWidget *fruits_frame;
|
GtkWidget *fruits_frame;
|
||||||
|
|
||||||
|
@ -251,11 +201,9 @@ main (int argc, char *argv[])
|
||||||
vbox = gtk_vbox_new (FALSE, 2);
|
vbox = gtk_vbox_new (FALSE, 2);
|
||||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||||
|
|
||||||
user_level_frame = user_level_frame_new ();
|
|
||||||
colors_frame = colors_frame_new ();
|
colors_frame = colors_frame_new ();
|
||||||
fruits_frame = fruits_frame_new ();
|
fruits_frame = fruits_frame_new ();
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), user_level_frame, TRUE, TRUE, 0);
|
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), colors_frame, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), colors_frame, TRUE, TRUE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), fruits_frame, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), fruits_frame, TRUE, TRUE, 0);
|
||||||
|
|
||||||
|
|
|
@ -46,11 +46,10 @@ test_window_new (const char *title, guint border_width)
|
||||||
}
|
}
|
||||||
|
|
||||||
g_signal_connect (window,
|
g_signal_connect (window,
|
||||||
"delete_event",
|
"delete_event",
|
||||||
G_CALLBACK (test_delete_event),
|
G_CALLBACK (test_delete_event),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
|
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (window), border_width);
|
gtk_container_set_border_width (GTK_CONTAINER (window), border_width);
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
|
|
Loading…
Reference in a new issue