diff options
author | Andy Hertzfeld <andy@src.gnome.org> | 2000-10-26 21:21:05 +0000 |
---|---|---|
committer | Andy Hertzfeld <andy@src.gnome.org> | 2000-10-26 21:21:05 +0000 |
commit | 46c53fcda82b7518f17e143756387fc46710eb4b (patch) | |
tree | 0b0a196d216911928e59c52d291e773177eff69c | |
parent | fc0ee93f44790ee8845eba473a6ed7ac00b45e39 (diff) | |
download | nautilus-46c53fcda82b7518f17e143756387fc46710eb4b.tar.gz |
fixed bug 2814, move "built-in bookmarks" checkbox from the edit bookmarks
fixed bug 2814, move "built-in bookmarks" checkbox from the
edit bookmarks window to preferences/navigation.
* libnautilus-extensions/nautilus-global-preferences.c:
(global_preferences_create_dialog), (global_preferences_register):
added a checkbox to control the "hide built-in bookmarks" preference
* libnautilus-extensions/nautilus-global-preferences.h:
renamed preference path so the built-in bookmarks preference can
be in the preferences window
* src/nautilus-bookmarks-window.c: (create_bookmarks_window),
(repopulate):
removed the built-in bookmarks checkbox from the edit bookmarks
window
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-global-preferences.c | 17 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-global-preferences.h | 5 | ||||
-rw-r--r-- | libnautilus-private/nautilus-global-preferences.c | 17 | ||||
-rw-r--r-- | libnautilus-private/nautilus-global-preferences.h | 5 | ||||
-rw-r--r-- | src/nautilus-bookmarks-window.c | 53 |
6 files changed, 50 insertions, 63 deletions
@@ -1,5 +1,21 @@ 2000-10-26 Andy Hertzfeld <andy@eazel.com> + fixed bug 2814, move "built-in bookmarks" checkbox from the + edit bookmarks window to preferences/navigation. + + * libnautilus-extensions/nautilus-global-preferences.c: + (global_preferences_create_dialog), (global_preferences_register): + added a checkbox to control the "hide built-in bookmarks" preference + * libnautilus-extensions/nautilus-global-preferences.h: + renamed preference path so the built-in bookmarks preference can + be in the preferences window + * src/nautilus-bookmarks-window.c: (create_bookmarks_window), + (repopulate): + removed the built-in bookmarks checkbox from the edit bookmarks + window + +2000-10-26 Andy Hertzfeld <andy@eazel.com> + added a new theme from Susan * configure.in: diff --git a/libnautilus-extensions/nautilus-global-preferences.c b/libnautilus-extensions/nautilus-global-preferences.c index a6b22a3a3..76b9c58a4 100644 --- a/libnautilus-extensions/nautilus-global-preferences.c +++ b/libnautilus-extensions/nautilus-global-preferences.c @@ -325,6 +325,14 @@ global_preferences_create_dialog (void) NAUTILUS_PREFERENCES_HTTP_PROXY_PORT, NAUTILUS_PREFERENCE_ITEM_EDITABLE_STRING); + /* built-in bookmarks */ + nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (navigation_pane), + _("Built-in Bookmarks")); + nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (navigation_pane), + 2, + NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS, + NAUTILUS_PREFERENCE_ITEM_BOOLEAN); + /* all done */ return prefs_dialog; @@ -977,8 +985,13 @@ global_preferences_register (void) _("Can add Content"), FALSE, TRUE, - TRUE); - + TRUE); + /* built-in bookmarks */ + global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS, + _("Don't include the built-in bookmarks"), + FALSE, + FALSE, + FALSE); { char *user_main_directory; diff --git a/libnautilus-extensions/nautilus-global-preferences.h b/libnautilus-extensions/nautilus-global-preferences.h index 4eecaf921..4ca348440 100644 --- a/libnautilus-extensions/nautilus-global-preferences.h +++ b/libnautilus-extensions/nautilus-global-preferences.h @@ -39,8 +39,6 @@ BEGIN_GNOME_DECLS #define NAUTILUS_PREFERENCES_THEME "/apps/nautilus/preferences/theme" /* Which text attributes appear beneath icon names */ #define NAUTILUS_PREFERENCES_ICON_CAPTIONS "/apps/nautilus/icon_view/captions" -/* Are built-in bookmarks showing or not? */ -#define NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS "/apps/nautilus/preferences/hide_built_in_bookmarks" /* How wide the sidebar is (or how wide it will be when expanded) */ #define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/apps/nautilus/preferences/sidebar_width" /* Keep track of the sound playing process */ @@ -65,8 +63,9 @@ BEGIN_GNOME_DECLS #define NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES "preferences/show_backup_files" #define NAUTILUS_PREFERENCES_SHOW_SPECIAL_FLAGS "preferences/show_special_flags" -/* Home URI */ +/* Navigation */ #define NAUTILUS_PREFERENCES_HOME_URI "preferences/home_uri" +#define NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS "preferences/hide_built_in_bookmarks" /* Proxy */ #define NAUTILUS_PREFERENCES_HTTP_PROXY "preferences/http-proxy" diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c index a6b22a3a3..76b9c58a4 100644 --- a/libnautilus-private/nautilus-global-preferences.c +++ b/libnautilus-private/nautilus-global-preferences.c @@ -325,6 +325,14 @@ global_preferences_create_dialog (void) NAUTILUS_PREFERENCES_HTTP_PROXY_PORT, NAUTILUS_PREFERENCE_ITEM_EDITABLE_STRING); + /* built-in bookmarks */ + nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (navigation_pane), + _("Built-in Bookmarks")); + nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (navigation_pane), + 2, + NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS, + NAUTILUS_PREFERENCE_ITEM_BOOLEAN); + /* all done */ return prefs_dialog; @@ -977,8 +985,13 @@ global_preferences_register (void) _("Can add Content"), FALSE, TRUE, - TRUE); - + TRUE); + /* built-in bookmarks */ + global_preferences_register_boolean_with_defaults (NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS, + _("Don't include the built-in bookmarks"), + FALSE, + FALSE, + FALSE); { char *user_main_directory; diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h index 4eecaf921..4ca348440 100644 --- a/libnautilus-private/nautilus-global-preferences.h +++ b/libnautilus-private/nautilus-global-preferences.h @@ -39,8 +39,6 @@ BEGIN_GNOME_DECLS #define NAUTILUS_PREFERENCES_THEME "/apps/nautilus/preferences/theme" /* Which text attributes appear beneath icon names */ #define NAUTILUS_PREFERENCES_ICON_CAPTIONS "/apps/nautilus/icon_view/captions" -/* Are built-in bookmarks showing or not? */ -#define NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS "/apps/nautilus/preferences/hide_built_in_bookmarks" /* How wide the sidebar is (or how wide it will be when expanded) */ #define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH "/apps/nautilus/preferences/sidebar_width" /* Keep track of the sound playing process */ @@ -65,8 +63,9 @@ BEGIN_GNOME_DECLS #define NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES "preferences/show_backup_files" #define NAUTILUS_PREFERENCES_SHOW_SPECIAL_FLAGS "preferences/show_special_flags" -/* Home URI */ +/* Navigation */ #define NAUTILUS_PREFERENCES_HOME_URI "preferences/home_uri" +#define NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS "preferences/hide_built_in_bookmarks" /* Proxy */ #define NAUTILUS_PREFERENCES_HTTP_PROXY "preferences/http-proxy" diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c index 896f3c905..ddbf33132 100644 --- a/src/nautilus-bookmarks-window.c +++ b/src/nautilus-bookmarks-window.c @@ -45,7 +45,6 @@ static GtkWidget *bookmark_list_widget = NULL; /* awkward name to distinguis static GtkWidget *name_field = NULL; static int name_field_changed_signalID; static GtkWidget *remove_button = NULL; -static GtkWidget *show_static_checkbox = NULL; static gboolean text_changed = FALSE; static GtkWidget *uri_field = NULL; static int uri_field_changed_signalID; @@ -82,9 +81,6 @@ static gboolean on_window_delete_event (GtkWidget *, gpointer user_data); static void repopulate (void); -static void update_built_in_bookmarks_checkbox_to_match_preference (gpointer user_data); -static void update_built_in_bookmarks_preference_to_match_checkbox (gpointer user_data); - #define BOOKMARK_LIST_COLUMN_ICON 0 #define BOOKMARK_LIST_COLUMN_NAME 1 #define BOOKMARK_LIST_COLUMN_COUNT 2 @@ -193,19 +189,6 @@ create_bookmarks_window (NautilusBookmarkList *list, GtkObject *undo_manager_sou gtk_widget_show (remove_button); gtk_box_pack_start (GTK_BOX (hbox2), remove_button, TRUE, FALSE, 0); - show_static_checkbox = gtk_check_button_new_with_label (_("Include built-in bookmarks in menu")); - gtk_widget_show (show_static_checkbox); - gtk_box_pack_end (GTK_BOX (right_side), show_static_checkbox, FALSE, FALSE, 0); - - update_built_in_bookmarks_checkbox_to_match_preference (GTK_CHECK_BUTTON (show_static_checkbox)); - nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS, - update_built_in_bookmarks_checkbox_to_match_preference, - show_static_checkbox); - - gtk_signal_connect (GTK_OBJECT (show_static_checkbox), "toggled", - update_built_in_bookmarks_preference_to_match_checkbox, - show_static_checkbox); - bookmark_list_changed_signalID = gtk_signal_connect (GTK_OBJECT(bookmarks), "contents_changed", GTK_SIGNAL_FUNC(on_bookmark_list_changed), @@ -631,39 +614,3 @@ repopulate (void) gtk_clist_thaw (GTK_CLIST (bookmark_list_widget)); } - -static void -synch_built_in_bookmarks_preference_and_checkbox (GtkCheckButton *checkbox, gboolean trust_checkbox) -{ - gboolean preference_setting, checkbox_setting; - - g_assert (GTK_IS_CHECK_BUTTON (checkbox)); - - preference_setting = !nautilus_preferences_get_boolean - (NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS, FALSE); - - checkbox_setting = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)); - - if (preference_setting == checkbox_setting) { - return; - } - - if (trust_checkbox) { - nautilus_preferences_set_boolean - (NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS, !checkbox_setting); - } else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), preference_setting); - } -} - -static void -update_built_in_bookmarks_preference_to_match_checkbox (gpointer user_data) -{ - synch_built_in_bookmarks_preference_and_checkbox (user_data, TRUE); -} - -static void -update_built_in_bookmarks_checkbox_to_match_preference (gpointer user_data) -{ - synch_built_in_bookmarks_preference_and_checkbox (user_data, FALSE); -} |