Commit 1b18a656 authored by John Sullivan's avatar John Sullivan
Browse files

Fixed bug 1247 ("Edit Novice Settings" menu item

	needs to be handled better)

	Now this menu item is enabled, and choosing it explains
	that you can't edited the Novice settings but offers
	to switch to Intermediate and let you edit those
	settings.

	* libnautilus-extensions/nautilus-user-level-manager.c,
	* libnautilus-extensions/nautilus-user-level-manager.h:
	Made the #defines for the user level ints public, so
	code elsewhere could use them rather than hardwiring
	a bunch of 0s, 1s, and 2s.

	* libnautilus-extensions/nautilus-caption-table.h:
	* libnautilus-extensions/nautilus-caption.h:
	* libnautilus-extensions/nautilus-font-picker.h:
	* libnautilus-extensions/nautilus-global-preferences.h:
	* libnautilus-extensions/nautilus-password-dialog.h:
	* libnautilus-extensions/nautilus-preference.h:
	* libnautilus-extensions/nautilus-preferences-box.h:
	* libnautilus-extensions/nautilus-preferences-dialog.h:
	* libnautilus-extensions/nautilus-preferences-group.h:
	* libnautilus-extensions/nautilus-preferences-item.h:
	* libnautilus-extensions/nautilus-preferences-pane.h:
	* libnautilus-extensions/nautilus-preferences-private.h:
	* libnautilus-extensions/nautilus-preferences.h:
	* libnautilus-extensions/nautilus-radio-button-group.h:
	* libnautilus-extensions/nautilus-string-picker.h:
	* libnautilus-extensions/nautilus-text-caption.h:
	Changed the closing BEGIN_GNOME_DECLS in these header files
	to END_GNOME_DECLS.

	* src/nautilus-window-menus.c:
	(get_user_level_string_for_display): New function, extracted
	from get_customize_user_level_string. Returns the user level
	string to be put into user messages or menu item names.
	(get_customize_user_level_string): Now calls
	get_user_level_string_for_display
	(switch_and_show_intermediate_settings_callback): New function,
	switches to intermediate level and displays the user level
	settings dialog.
	(user_level_customize_callback): If the current user level is
	NAUTILUS_USER_LEVEL_NOVICE, puts up a dialog telling the user
	that the Novice settings can't be changed, and asking them if
	they want to switch to Intermediate and edit those settings.
	(get_user_level_image), (user_level_changed_callback),
	(nautilus_window_initialize_menus),
	(convert_menu_path_to_user_level),
	(convert_user_level_to_menu_path):
	Use #defines for user levels instead of hardwiring integers.
	(switch_to_user_level): New function, extracted from
	user_level_menu_item_callback. Switches to a specified user
	level and updates menu items & title image appropriately.
	(user_level_menu_item_callback): Now calls switch_to_user_level.
	(update_user_level_menu_items): Don't desensitize the Edit
	Settings item at Novice user level anymore.
parent 18587fcb
2000-09-05 John Sullivan <sullivan@eazel.com>
Fixed bug 1247 ("Edit Novice Settings" menu item
needs to be handled better)
Now this menu item is enabled, and choosing it explains
that you can't edited the Novice settings but offers
to switch to Intermediate and let you edit those
settings.
* libnautilus-extensions/nautilus-user-level-manager.c,
* libnautilus-extensions/nautilus-user-level-manager.h:
Made the #defines for the user level ints public, so
code elsewhere could use them rather than hardwiring
a bunch of 0s, 1s, and 2s.
* libnautilus-extensions/nautilus-caption-table.h:
* libnautilus-extensions/nautilus-caption.h:
* libnautilus-extensions/nautilus-font-picker.h:
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-password-dialog.h:
* libnautilus-extensions/nautilus-preference.h:
* libnautilus-extensions/nautilus-preferences-box.h:
* libnautilus-extensions/nautilus-preferences-dialog.h:
* libnautilus-extensions/nautilus-preferences-group.h:
* libnautilus-extensions/nautilus-preferences-item.h:
* libnautilus-extensions/nautilus-preferences-pane.h:
* libnautilus-extensions/nautilus-preferences-private.h:
* libnautilus-extensions/nautilus-preferences.h:
* libnautilus-extensions/nautilus-radio-button-group.h:
* libnautilus-extensions/nautilus-string-picker.h:
* libnautilus-extensions/nautilus-text-caption.h:
Changed the closing BEGIN_GNOME_DECLS in these header files
to END_GNOME_DECLS.
* src/nautilus-window-menus.c:
(get_user_level_string_for_display): New function, extracted
from get_customize_user_level_string. Returns the user level
string to be put into user messages or menu item names.
(get_customize_user_level_string): Now calls
get_user_level_string_for_display
(switch_and_show_intermediate_settings_callback): New function,
switches to intermediate level and displays the user level
settings dialog.
(user_level_customize_callback): If the current user level is
NAUTILUS_USER_LEVEL_NOVICE, puts up a dialog telling the user
that the Novice settings can't be changed, and asking them if
they want to switch to Intermediate and edit those settings.
(get_user_level_image), (user_level_changed_callback),
(nautilus_window_initialize_menus),
(convert_menu_path_to_user_level),
(convert_user_level_to_menu_path):
Use #defines for user levels instead of hardwiring integers.
(switch_to_user_level): New function, extracted from
user_level_menu_item_callback. Switches to a specified user
level and updates menu items & title image appropriately.
(user_level_menu_item_callback): Now calls switch_to_user_level.
(update_user_level_menu_items): Don't desensitize the Edit
Settings item at Novice user level anymore.
2000-09-05 Andy Hertzfeld <andy@eazel.com>
* src/nautilus-shell.c: (display_caveat):
......
......@@ -82,7 +82,7 @@ guint nautilus_caption_table_get_num_rows (NautilusCaptionTable *capt
void nautilus_caption_table_resize (NautilusCaptionTable *caption_table,
guint num_rows);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_CAPTION_TABLE_H */
......
......@@ -79,7 +79,7 @@ char * nautilus_caption_get_title_label (const NautilusCaption *caption);
void nautilus_caption_set_child (NautilusCaption *caption,
GtkWidget *child);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_CAPTION_H */
......
......@@ -73,7 +73,7 @@ char * nautilus_font_picker_get_selected_weight (const NautilusFontPicker
char * nautilus_font_picker_get_selected_slant (const NautilusFontPicker *font_picker);
char * nautilus_font_picker_get_selected_set_width (const NautilusFontPicker *font_picker);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_FONT_PICKER_H */
......
......@@ -131,7 +131,7 @@ GList *nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (
GList *nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFS_GLOBAL_H */
......
......@@ -77,6 +77,6 @@ char * nautilus_password_dialog_get_username (NautilusPasswordDialo
char * nautilus_password_dialog_get_password (NautilusPasswordDialog *password_dialog);
gboolean nautilus_password_dialog_get_remember (NautilusPasswordDialog *password_dialog);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PASSWORD_DIALOG_H */
......@@ -107,6 +107,6 @@ void nautilus_preference_enum_add_entry_by_name (const char
void nautilus_preference_shutdown (void);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFERENCE_H */
......@@ -63,7 +63,7 @@ GtkWidget* nautilus_preferences_box_add_pane (NautilusPreferencesBox *prefs_box,
const gchar *pane_title,
const gchar *pane_description);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFERENCES_BOX_H */
......
......@@ -61,7 +61,7 @@ GtkType nautilus_preferences_dialog_get_type (void);
GtkWidget* nautilus_preferences_dialog_new (const gchar *dialog_title);
GtkWidget* nautilus_preferences_dialog_get_prefs_box (NautilusPreferencesDialog *prefs_dialog);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFERENCES_DIALOG_H */
......
......@@ -63,7 +63,7 @@ GtkWidget* nautilus_preferences_group_add_item (NautilusPreferencesGroup *gro
const char *preference_name,
NautilusPreferencesItemType item_type);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFERENCES_GROUP_H */
......
......@@ -77,7 +77,7 @@ GtkWidget* nautilus_preferences_item_new (const gchar *pref
NautilusPreferencesItemType item_type);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFERENCES_ITEM_H */
......
......@@ -71,6 +71,6 @@ GtkWidget *nautilus_preferences_pane_add_item_to_nth_group (NautilusPreferencesP
const char *preference_name,
NautilusPreferencesItemType item_type);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFERENCES_PANE_H */
......@@ -34,6 +34,6 @@ BEGIN_GNOME_DECLS
gboolean nautilus_preferences_handle_error (GConfError **error);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFERENCES_PRIVATE_H */
......@@ -92,6 +92,6 @@ char * nautilus_preferences_get (const char
void nautilus_preferences_shutdown (void);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_PREFERENCES_H */
......@@ -94,7 +94,7 @@ void nautilus_radio_button_group_set_entry_description_text (NautilusRadio
guint entry_index,
const char *description);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_RADIO_BUTTON_GROUP_H */
......
......@@ -90,7 +90,7 @@ gboolean nautilus_string_picker_contains (const NautilusSt
const char *string);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_STRING_PICKER_H */
......
......@@ -69,7 +69,7 @@ char *nautilus_text_caption_get_text (NautilusTextCaption *text_capt
void nautilus_text_caption_set_text (NautilusTextCaption *text_caption,
const char *text);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_TEXT_CAPTION_H */
......
......@@ -41,6 +41,11 @@
#define NAUTILUS_IS_USER_LEVEL_MANAGER(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_USER_LEVEL_MANAGER))
#define NAUTILUS_IS_USER_LEVEL_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_USER_LEVEL_MANAGER))
/* FIXME bugzilla.eazel.com 2806:
* These names are used both by gconf paths and for user display.
* We need to maintain both separately, so the user-display ones can
* be capitalized and localized.
*/
static const char *DEFAULT_USER_LEVEL_NAMES[] =
{
"novice",
......@@ -48,12 +53,8 @@ static const char *DEFAULT_USER_LEVEL_NAMES[] =
"hacker"
};
#define USER_LEVEL_NOVICE 0
#define USER_LEVEL_INTERMEDIATE 1
#define USER_LEVEL_HACKER 2
static const guint DEFAULT_NUM_USER_LEVELS = NAUTILUS_N_ELEMENTS (DEFAULT_USER_LEVEL_NAMES);
static const guint DEFAULT_USER_LEVEL = USER_LEVEL_HACKER;
static const guint DEFAULT_USER_LEVEL = NAUTILUS_USER_LEVEL_HACKER;
static const char USER_LEVEL_KEY[] = "/apps/nautilus/user_level";
static const char USER_LEVEL_PATH[] = "/apps/nautilus";
......
......@@ -57,6 +57,15 @@ gboolean nautilus_user_level_manager_compare_preference_between_user_level
guint user_level_a,
guint user_level_b);
BEGIN_GNOME_DECLS
/* Note that there's a function to get the number of user levels, but there's
* a lot of code elsewhere that assumes three levels. Publicizing the numbers
* of these levels lets that other code be coherent and less error-prone.
*/
/* FIXME bugzilla.eazel.com 2805: Maybe we should eliminate the get_num_user_levels call? */
#define NAUTILUS_USER_LEVEL_NOVICE 0
#define NAUTILUS_USER_LEVEL_INTERMEDIATE 1
#define NAUTILUS_USER_LEVEL_HACKER 2
END_GNOME_DECLS
#endif /* NAUTILUS_USER_LEVEL_MANAGER_H */
......@@ -82,7 +82,7 @@ guint nautilus_caption_table_get_num_rows (NautilusCaptionTable *capt
void nautilus_caption_table_resize (NautilusCaptionTable *caption_table,
guint num_rows);
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif /* NAUTILUS_CAPTION_TABLE_H */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment