diff options
69 files changed, 1020 insertions, 747 deletions
@@ -1,3 +1,182 @@ +2001-01-30 Darin Adler <darin@eazel.com> + + reviewed by: John Sullivan <sullivan@eazel.com> + + Fix bug 6147 (selected icons flash unselected/selected rapidly): + + * src/nautilus-window-manage-views.c: (change_selection): Don't + send out selection change notices to the view that reported the + selection change. + (change_selection_callback): Pass in view that requested the + change so we can know not to send a selection change to that view. + * src/file-manager/fm-directory-view.c: + (fm_directory_view_send_selection_change): Clear flag that says we + have a selection change for the shell. + (selection_changed_callback): Add code to indicate this selection + change is due to the shell, so we don't tell the shell about + something it just told us. + (done_loading): Set flag so we don't tell the shell about selection + changes that are part of the first load of the directory. + (display_selection_info_idle_callback): Only send a selection change + to the shell if the change was initiated here. Also remove the code + that ref's the NautilusView object -- wasn't helping. + (update_menus_timeout_callback), (display_pending_idle_callback), + (display_pending_timeout_callback): Remove the code that ref's the + NautilusView object -- wasn't helping. + (fm_directory_view_notify_selection_changed): Propagate flag that + tells the idle code we have made the change to the selection and + the shell should be notified. + + Fix bug 6158 (nautilus --quit shouldn't check for + ~/.nautilus/first-time-wizard-flag). + + * src/nautilus-main.c: (main): Don't do the first-time druid check + when the --quit or --restart option is used. + + Fix bug 803 (All metafile tags should be lower case). + + * libnautilus-extensions/nautilus-metadata.h: Use lower-case for + metadata tags. + * libnautilus-extensions/nautilus-directory-metafile.c: + (create_metafile_root), (get_file_node), + (nautilus_directory_rename_file_metadata), + (nautilus_directory_copy_file_metadata), + (nautilus_directory_set_metafile_contents): Change metadata tags + to be lower-case. + * libnautilus-extensions/nautilus-directory.c: + (nautilus_self_check_directory): Use lower-case in metadata + self-test for clarity. + * libnautilus-extensions/nautilus-file.c: + (nautilus_file_get_keywords), (nautilus_file_set_keywords): Change + metadata tags to be lower-case. + + * data/top/.nautilus-metafile.xml + * icons/ardmore/ardmore.xml: + * icons/arlo/arlo.xml: + * icons/arlo/i-directory.xml: + * icons/arlo/i-regular.xml: + * icons/crux_eggplant/crux_eggplant.xml: + * icons/crux_eggplant/i-directory.xml: + * icons/crux_eggplant/i-regular.xml: + * icons/default.xml: + * icons/gnome/gnome.xml: + * icons/i-directory-accept.xml: + * icons/i-directory.xml: + * icons/i-regular.xml: + * icons/villanova/villanova.xml: + Change XML to use lower-case. + + * libnautilus-extensions/nautilus-link-set.c: (create_new_link): + Use lower-case for link XML tags. + * libnautilus-extensions/nautilus-link.c: + (nautilus_link_local_create), (nautilus_link_local_set_link_uri), + (nautilus_link_local_set_type), + (nautilus_link_local_get_link_uri), + (nautilus_link_local_get_link_type), + (nautilus_link_get_link_uri_given_file_contents): Use lower-case + for link XML tags. + + * src/nautilus-sidebar-title.c: + (nautilus_sidebar_title_select_text_color), + (nautilus_sidebar_title_theme_changed): Use lower-case for theme + XML tags. + * components/throbber/nautilus-throbber.c: + (get_bonobo_properties), (nautilus_throbber_initialize), + (nautilus_throbber_load_images), + (nautilus_throbber_button_press_event): Change theme XML tags to be + lower-case. + * libnautilus-extensions/nautilus-icon-container.c: + (start_rubberbanding): Use lower-case for theme XML tags. + (nautilus_icon_container_initialize): Fix comment. + (update_label_color), (nautilus_icon_container_theme_changed): Use + lower-case for theme XML tags. + * libnautilus-extensions/nautilus-icon-factory.c: (set_theme): Use + lower-case for theme XML tags. + (get_themed_icon_file_path): Use lower-case for icon XML file + tags. + (icon_theme_changed_callback): Use lower-case for theme XML tags. + * src/nautilus-sidebar-tabs.c: + (nautilus_sidebar_tabs_load_theme_data), (get_text_offset): Use + lowe-case for theme XML tags. + * src/nautilus-sidebar.c: (nautilus_sidebar_update_appearance): + Use lower-case for theme XML tags. + * src/nautilus-window-toolbars.c: (get_file_name_from_icon_name): + Use lower-case for theme XML tags. + * src/nautilus-zoom-control.c: (draw_number): Use lower-case for + theme XML tags. + + Change code that used GSList when it should use GList. We use + GList so that we can share utility functions. It's arbitrary. We + could have decided to use all GSList instead, but we chose GList + (because of its name, initially). + + * components/tree/nautilus-tree-expansion-state.c: + (expansion_state_load_callback), + (nautilus_tree_expansion_state_load_table_from_gconf), + (hash_table_get_keys_callback), (hash_table_get_keys), + (nautilus_tree_expansion_state_save_table_to_gconf): Update to use + GList instead of GSList. + * libnautilus-extensions/nautilus-gconf-extensions.h: + * libnautilus-extensions/nautilus-gconf-extensions.c: + (nautilus_gconf_handle_error), (nautilus_gconf_set_string_list), + (nautilus_gconf_get_string_list): Change to work with GList + instead of GSList to match the rest of Nautilus, so that the lists + can be manipulated with all the GList utility functions. + * libnautilus-extensions/nautilus-glib-extensions.h: + * libnautilus-extensions/nautilus-glib-extensions.c: + (nautilus_round): Changed name from nautilus_g_round -- "g" for + "gratuitous". + (nautilus_g_list_from_g_slist), (nautilus_g_slist_from_g_list): + Added utility functions to help make GSLists from GLists and vice + versa. Useful when dealing with functions that yield/expect + GSLists. + * libnautilus-extensions/nautilus-icon-text-item.c: (iti_destroy), + (iti_update), (iti_paint_text), (iti_draw), (iti_render), + (iti_event): Use nautilus_round by its new name. + * libnautilus-extensions/nautilus-preferences.h: + * libnautilus-extensions/nautilus-preferences.c: + (nautilus_preferences_set_string_list), + (nautilus_preferences_get_string_list), + (nautilus_preferences_default_set_string_list), + (nautilus_preferences_default_get_string_list): Change to use + GList instead of GSList. + * libnautilus-extensions/nautilus-search-uri.c: + (free_tokenized_uri), (tokenize_uri), (get_translated_criterion), + (get_nth_criterion_prefix), (parse_uri): Change to use GList + instead of GSList. + * src/nautilus-application.h: + * src/nautilus-application.c: + (nautilus_application_get_window_list): Renamed from + nautilus_application_windows and changed to use GList instead of + GSList. + (nautilus_application_destroyed_window), + (nautilus_application_create_window), (volume_unmounted_callback): + Change to use GList instead of GSList. + * src/nautilus-shell.c: (save_window_states), + (restore_window_states): Use GList instead of GSList. + * src/nautilus-window-manage-views.c: (just_one_window): Use GList + instead of GSList. + (open_location_prefer_existing_window_callback): Use GList instead + of GSList. + * src/nautilus-window.c: (nautilus_forget_history): Use GList + instead of GSList and the new name for + nautilus_application_get_window_list. + + Other changes. + + * src/nautilus-shell.c: (display_caveat_first_time): Turn off the + caveat -- we're close enough to 1.0. + + * libnautilus-extensions/nautilus-view-identifier.c: + (nautilus_view_identifier_new_from_oaf_server_info): Use free_deep + call. + + * libnautilus/nautilus-view-standard-main.h: Use + BEGIN/END_GNOME_DECLS. + + * src/file-manager/fm-desktop-icon-view.c: Remove unneeded + include. + 2001-01-30 Maciej Stachowiak <mjs@eazel.com> reviewed by: Gene Z. Ragan <gzr@eazel.com> @@ -144,7 +323,6 @@ Reduced timed-wait initial timeout from 5 seconds to 3 after playing around with the gnome-vfs test-method. - 2001-01-29 Darin Adler <darin@eazel.com> reviewed by: Maciej Stachowiak <mjs@eazel.com> @@ -8092,8 +8270,6 @@ Wed Jan 24 21:21:52 2001 George Lebl <jirka@5z.com> 2000-12-19 Ramiro Estrugo <ramiro@eazel.com> - reviewed by: <delete if not using a buddy> - * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-debug-drawing.h: * libnautilus-extensions/nautilus-debug-drawing.c: diff --git a/components/throbber/nautilus-throbber.c b/components/throbber/nautilus-throbber.c index 83daa1944..bef0fda0a 100644 --- a/components/throbber/nautilus-throbber.c +++ b/components/throbber/nautilus-throbber.c @@ -135,7 +135,7 @@ get_bonobo_properties (BonoboPropertyBag *bag, case LOCATION: { - char *location = nautilus_theme_get_theme_data ("throbber", "URL"); + char *location = nautilus_theme_get_theme_data ("throbber", "url"); if (location != NULL) { BONOBO_ARG_SET_STRING (arg, location); g_free (location); @@ -279,7 +279,7 @@ nautilus_throbber_initialize (NautilusThrobber *throbber) gtk_container_add (GTK_CONTAINER (box), widget); /* set up the delay from the theme */ - delay_str = nautilus_theme_get_theme_data ("throbber", "DELAY"); + delay_str = nautilus_theme_get_theme_data ("throbber", "delay"); if (delay_str) { throbber->details->delay = atoi (delay_str); @@ -548,12 +548,12 @@ nautilus_throbber_load_images (NautilusThrobber *throbber) nautilus_throbber_unload_images (throbber); - image_theme = nautilus_theme_get_theme_data ("throbber", "IMAGE_THEME"); + image_theme = nautilus_theme_get_theme_data ("throbber", "image_theme"); throbber->details->quiescent_pixbuf = load_themed_image ("throbber/rest.png", image_theme, throbber->details->small_mode); /* images are of the form throbber/001.png, 002.png, etc, so load them into a list */ - frames = nautilus_theme_get_theme_data ("throbber", "FRAME_COUNT"); + frames = nautilus_theme_get_theme_data ("throbber", "frame_count"); if (frames != NULL) { throbber->details->max_frame = atoi (frames); g_free (frames); @@ -586,7 +586,7 @@ nautilus_throbber_button_press_event (GtkWidget *widget, GdkEventButton *event) BonoboArg *location_arg; throbber = NAUTILUS_THROBBER (widget); - location = nautilus_theme_get_theme_data ("throbber", "URL"); + location = nautilus_theme_get_theme_data ("throbber", "url"); if (location != NULL) { location_arg = bonobo_arg_new (BONOBO_ARG_STRING); BONOBO_ARG_SET_STRING (location_arg, location); diff --git a/components/tree/nautilus-tree-expansion-state.c b/components/tree/nautilus-tree-expansion-state.c index 2c4f33718..789e5534c 100644 --- a/components/tree/nautilus-tree-expansion-state.c +++ b/components/tree/nautilus-tree-expansion-state.c @@ -26,10 +26,9 @@ #include <config.h> #include "nautilus-tree-expansion-state.h" +#include <libnautilus-extensions/nautilus-glib-extensions.h> #include <libnautilus-extensions/nautilus-gtk-macros.h> #include <libnautilus-extensions/nautilus-preferences.h> -#include <libnautilus-extensions/nautilus-glib-extensions.h> - struct NautilusTreeExpansionStateDetails { @@ -74,59 +73,56 @@ nautilus_tree_expansion_state_initialize_class (gpointer klass) #define NAUTILUS_PREFERENCES_TREE_VIEW_EXPANSION_STATE "tree-sidebar-panel/expansion_state" static void -nautilus_tree_expansion_state_load_foreach_callback (char *uri, - NautilusTreeExpansionState *expansion_state) +expansion_state_load_callback (gpointer node_data, + gpointer callback_data) { - nautilus_tree_expansion_state_expand_node_internal (expansion_state, uri); + nautilus_tree_expansion_state_expand_node_internal + (callback_data, node_data); } static void nautilus_tree_expansion_state_load_table_from_gconf (NautilusTreeExpansionState *expansion_state) { - GSList *uris; + GList *uris; uris = nautilus_preferences_get_string_list (NAUTILUS_PREFERENCES_TREE_VIEW_EXPANSION_STATE); - - g_slist_foreach (uris, (GFunc) nautilus_tree_expansion_state_load_foreach_callback, expansion_state); - - nautilus_g_slist_free_deep (uris); + g_list_foreach (uris, expansion_state_load_callback, expansion_state); + nautilus_g_list_free_deep (uris); } static void -g_hash_table_get_keys_callback (gpointer key, - gpointer value, - gpointer user_data) +hash_table_get_keys_callback (gpointer key, + gpointer value, + gpointer user_data) { - GSList **keys; + GList **keys; - keys = (GSList **) user_data; - *keys = g_slist_prepend (*keys, key); + keys = (GList **) user_data; + *keys = g_list_prepend (*keys, key); } -static GSList * -g_hash_table_get_keys (GHashTable *hash_table) +static GList * +hash_table_get_keys (GHashTable *hash_table) { - GSList *keys; + GList *keys; keys = NULL; g_hash_table_foreach (hash_table, - g_hash_table_get_keys_callback, + hash_table_get_keys_callback, &keys); return keys; } - static void nautilus_tree_expansion_state_save_table_to_gconf (NautilusTreeExpansionState *expansion_state) { - GSList *uris; - - uris = g_hash_table_get_keys (expansion_state->details->table); + GList *uris; + uris = hash_table_get_keys (expansion_state->details->table); + uris = nautilus_g_str_list_alphabetize (uris); nautilus_preferences_set_string_list (NAUTILUS_PREFERENCES_TREE_VIEW_EXPANSION_STATE, uris); - - g_slist_free (uris); + g_list_free (uris); } static void diff --git a/data/top/.nautilus-metafile.xml b/data/top/.nautilus-metafile.xml index 8b9510aaa..9485ad19c 100644 --- a/data/top/.nautilus-metafile.xml +++ b/data/top/.nautilus-metafile.xml @@ -1,8 +1,8 @@ <?xml version="1.0"?> -<DIRECTORY ICONS_AUTO_LAYOUT="false" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF-rgb:FFFF/9999/3333:h" ICONS_ZOOM_LEVEL="3" SIDEBAR_BUTTONS="button=Edit Links...;script=#linksets"> - <FILE NAME="Computer.link" ICON_POSITION="251,216"/> - <FILE NAME="Gnumeric.link" ICON_POSITION="437,370"/> - <FILE NAME="Netscape.link" ICON_POSITION="363,372"/> - <FILE NAME="Services.link" ICON_POSITION="397,217"/> - <FILE NAME="The Gimp.link" ICON_POSITION="508,368"/> -</DIRECTORY> +<directory icons_auto_layout="false" background_color="rgb:FFFF/FFFF/FFFF-rgb:FFFF/9999/3333:h" icon_list_zoom_level="3" sidebar_buttons="button=Edit Links...;script=#linksets"> + <file name="Computer.link" icon_position="251,216"/> + <file name="Gnumeric.link" icon_position="437,370"/> + <file name="Netscape.link" icon_position="363,372"/> + <file name="Services.link" icon_position="397,217"/> + <file name="The Gimp.link" icon_position="508,368"/> +</directory> diff --git a/icons/ardmore/ardmore.xml b/icons/ardmore/ardmore.xml index 9601e0641..167e34c0b 100644 --- a/icons/ardmore/ardmore.xml +++ b/icons/ardmore/ardmore.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <theme _name="Tahoe" _description="This theme uses photo-realistic folders."> - <sidebar SIDEBAR_BACKGROUND_TILE_IMAGE="./bluewall.png" SIDEBAR_BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF" TITLE_COLOR="rgb:0000/0000/0000" TITLE_SHADOW_COLOR="rgb:BBBB/BBBB/BBBB" TITLE_INFO_COLOR="rgb:0000/0000/0000"/> - <directory BACKGROUND_TILE_IMAGE="./blueridge.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/> - <desktop BACKGROUND_TILE_IMAGE="patterns/fleur_de_lis.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/> - <zoom_control NUMBER_V_OFFSET="-6" DIGIT_WIDTH="6"/> - </theme> + <sidebar sidebar_background_tile_image="./bluewall.png" sidebar_background_color="rgb:FFFF/FFFF/FFFF" title_color="rgb:0000/0000/0000" title_shadow_color="rgb:BBBB/BBBB/BBBB" title_info_color="rgb:0000/0000/0000"/> + <directory background_tile_image="./blueridge.png" background_color="rgb:FFFF/FFFF/FFFF"/> + <desktop background_tile_image="patterns/fleur_de_lis.png" background_color="rgb:FFFF/FFFF/FFFF"/> + <zoom_control number_v_offset="-6" digit_width="6"/> +</theme> diff --git a/icons/arlo/arlo.xml b/icons/arlo/arlo.xml index 652d3e4fb..00f18354a 100644 --- a/icons/arlo/arlo.xml +++ b/icons/arlo/arlo.xml @@ -1,12 +1,13 @@ <?xml version="1.0"?> <theme _name="Crux-Teal" _description="A Teal variation of the Crux theme."> - <directory BACKGROUND_TILE_IMAGE="./backgrounds/window_pattern.png" DARK_INFO_COLOR="0x777777" - -LIGHT_INFO_COLOR="0xAAAAAA" SELECTION_BOX_COLOR_RGBA="0x497B7E40" SELECTION_BOX_COLOR="rgb:4949/7B7B/7E7E" /> - <sidebar SIDEBAR_BACKGROUND_COLOR="rgb:6666/9999/9999-rgb:0000/3333/3333%90-rgb:0000/0000/0000:h" SIDEBAR_BACKGROUND_TILE_IMAGE="patterns/.striated.png" TAB_PIECE_IMAGES="sidebar_tab_pieces" COMBINE="TRUE" - LEFT_OFFSET="0" SHADOW_OFFSET="1" TEXT_H_OFFSET="-4" LABEL_COLOR="rgb:FFFF/FFFF/FFFF" TAB_FONT="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" /> - <desktop BACKGROUND_TILE_IMAGE="./backgrounds/background_pattern.png"/> - <zoom_control NUMBER_V_OFFSET="-6" NUMBER_H_OFFSET="0" DIGIT_WIDTH="6"/> - <throbber FRAME_COUNT="28" URL="http://www.eazel.com"/> + <directory background_tile_image="./backgrounds/window_pattern.png" dark_info_color="0x777777" + light_info_color="0xAAAAAA" selection_box_color_rgba="0x497B7E40" selection_box_color="rgb:4949/7B7B/7E7E" /> + <sidebar sidebar_background_color="rgb:6666/9999/9999-rgb:0000/3333/3333%90-rgb:0000/0000/0000:h" + sidebar_background_tile_image="patterns/.striated.png" + tab_piece_images="sidebar_tab_pieces" combine="true" + left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF" + tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" /> + <desktop background_tile_image="./backgrounds/background_pattern.png"/> + <zoom_control number_v_offset="-6" number_h_offset="0" digit_width="6"/> + <throbber frame_count="28" url="http://www.eazel.com"/> </theme> - diff --git a/icons/arlo/i-directory.xml b/icons/arlo/i-directory.xml index a7822110d..221d7c465 100644 --- a/icons/arlo/i-directory.xml +++ b/icons/arlo/i-directory.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<ICON_SET> - <ICON SIZE="48" ATTACH_POINTS="18,22|50,0|50,24|50,48"/> - <ICON SIZE="72" ATTACH_POINTS="21,43|50,0|50,24|50,48"/> - <ICON SIZE="96" ATTACH_POINTS="29,58|50,0|50,24|50,48"/> -</ICON_SET> +<icon_set> + <icon size="48" attach_points="18,22|50,0|50,24|50,48"/> + <icon size="72" attach_points="21,43|50,0|50,24|50,48"/> + <icon size="96" attach_points="29,58|50,0|50,24|50,48"/> +</icon_set> diff --git a/icons/arlo/i-regular.xml b/icons/arlo/i-regular.xml index 1854dd6bc..9abbf1d0d 100644 --- a/icons/arlo/i-regular.xml +++ b/icons/arlo/i-regular.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> -<ICON_SET> - <ICON SIZE="48" EMBEDDED_TEXT_RECTANGLE="11,10,38,53"/> - <ICON SIZE="72" EMBEDDED_TEXT_RECTANGLE="14,13,57,80"/> - <ICON SIZE="96" EMBEDDED_TEXT_RECTANGLE="17,16,82,113"/> - <ICON SIZE="192" EMBEDDED_TEXT_RECTANGLE="28,26,159,219"/> -</ICON_SET> +<icon_set> + <icon size="48" embedded_text_rectangle="11,10,38,53"/> + <icon size="72" embedded_text_rectangle="14,13,57,80"/> + <icon size="96" embedded_text_rectangle="17,16,82,113"/> + <icon size="192" embedded_text_rectangle="28,26,159,219"/> +</icon_set> diff --git a/icons/crux_eggplant/crux_eggplant.xml b/icons/crux_eggplant/crux_eggplant.xml index 38f6c407a..1b2d060e8 100644 --- a/icons/crux_eggplant/crux_eggplant.xml +++ b/icons/crux_eggplant/crux_eggplant.xml @@ -1,12 +1,13 @@ <?xml version="1.0"?> <theme _name="Crux-Eggplant" _description="An Eggplant variation of the Crux theme."> - <directory BACKGROUND_TILE_IMAGE="./backgrounds/window_pattern.png" DARK_INFO_COLOR="0x777777" - -LIGHT_INFO_COLOR="0xAAAAAA" SELECTION_BOX_COLOR_RGBA="0x71577440" SELECTION_BOX_COLOR="rgb:7171/5757/7474" /> - <sidebar SIDEBAR_BACKGROUND_COLOR="rgb:8888/6F6F/8D8D-rgb:2525/0C0C/2A2A%90-rgb:0000/0000/0000:h" SIDEBAR_BACKGROUND_TILE_IMAGE="patterns/.striated.png" TAB_PIECE_IMAGES="sidebar_tab_pieces" COMBINE="TRUE" - LEFT_OFFSET="0" SHADOW_OFFSET="1" TEXT_H_OFFSET="-4" LABEL_COLOR="rgb:FFFF/FFFF/FFFF" TAB_FONT="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" /> - <desktop BACKGROUND_TILE_IMAGE="./backgrounds/background_pattern.png"/> - <zoom_control NUMBER_V_OFFSET="-6" NUMBER_H_OFFSET="0" DIGIT_WIDTH="6"/> - <throbber FRAME_COUNT="28" URL="http://www.eazel.com"/> + <directory background_tile_image="./backgrounds/window_pattern.png" dark_info_color="0x777777" + light_info_color="0xAAAAAA" selection_box_color_rgba="0x71577440" selection_box_color="rgb:7171/5757/7474" /> + <sidebar sidebar_background_color="rgb:8888/6F6F/8D8D-rgb:2525/0C0C/2A2A%90-rgb:0000/0000/0000:h" + sidebar_background_tile_image="patterns/.striated.png" + tab_piece_images="sidebar_tab_pieces" combine="true" + left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF" + tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" /> + <desktop background_tile_image="./backgrounds/background_pattern.png"/> + <zoom_control number_v_offset="-6" number_h_offset="0" digit_width="6"/> + <throbber frame_count="28" url="http://www.eazel.com"/> </theme> - diff --git a/icons/crux_eggplant/i-directory.xml b/icons/crux_eggplant/i-directory.xml index a7822110d..221d7c465 100644 --- a/icons/crux_eggplant/i-directory.xml +++ b/icons/crux_eggplant/i-directory.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<ICON_SET> - <ICON SIZE="48" ATTACH_POINTS="18,22|50,0|50,24|50,48"/> - <ICON SIZE="72" ATTACH_POINTS="21,43|50,0|50,24|50,48"/> - <ICON SIZE="96" ATTACH_POINTS="29,58|50,0|50,24|50,48"/> -</ICON_SET> +<icon_set> + <icon size="48" attach_points="18,22|50,0|50,24|50,48"/> + <icon size="72" attach_points="21,43|50,0|50,24|50,48"/> + <icon size="96" attach_points="29,58|50,0|50,24|50,48"/> +</icon_set> diff --git a/icons/crux_eggplant/i-regular.xml b/icons/crux_eggplant/i-regular.xml index 1854dd6bc..9abbf1d0d 100644 --- a/icons/crux_eggplant/i-regular.xml +++ b/icons/crux_eggplant/i-regular.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> -<ICON_SET> - <ICON SIZE="48" EMBEDDED_TEXT_RECTANGLE="11,10,38,53"/> - <ICON SIZE="72" EMBEDDED_TEXT_RECTANGLE="14,13,57,80"/> - <ICON SIZE="96" EMBEDDED_TEXT_RECTANGLE="17,16,82,113"/> - <ICON SIZE="192" EMBEDDED_TEXT_RECTANGLE="28,26,159,219"/> -</ICON_SET> +<icon_set> + <icon size="48" embedded_text_rectangle="11,10,38,53"/> + <icon size="72" embedded_text_rectangle="14,13,57,80"/> + <icon size="96" embedded_text_rectangle="17,16,82,113"/> + <icon size="192" embedded_text_rectangle="28,26,159,219"/> +</icon_set> diff --git a/icons/default.xml b/icons/default.xml index 22219ddd8..f424f46ab 100644 --- a/icons/default.xml +++ b/icons/default.xml @@ -1,21 +1,30 @@ <?xml version="1.0"?> + <theme _name="Default" _description="This is the default theme for Nautilus."> - <sidebar SIDEBAR_BACKGROUND_TILE_IMAGE="./side_bar_image.png" - SIDEBAR_BACKGROUND_COLOR="rgb:4747/4A4A/7C7C-rgb:2222/2323/3A3A:h" - TITLE_COLOR="rgb:FFFF/FFFF/FFFF" TITLE_INFO_COLOR="rgb:FFFF/FFFF/FFFF" TITLE_SHADOW_COLOR="rgb:0000/0000/0000" - TAB_PIECE_IMAGES="sidebar_tab_pieces" COMBINE="TRUE" LEFT_OFFSET="0" SHADOW_OFFSET="1" TEXT_H_OFFSET="-4" LABEL_COLOR="rgb:FFFF/FFFF/FFFF" TAB_FONT="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" /> - <desktop BACKGROUND_TILE_IMAGE="patterns/brushed_metal.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/> + <sidebar sidebar_background_tile_image="./side_bar_image.png" + sidebar_background_color="rgb:4747/4A4A/7C7C-rgb:2222/2323/3A3A:h" + title_color="rgb:FFFF/FFFF/FFFF" + title_info_color="rgb:FFFF/FFFF/FFFF" + title_shadow_color="rgb:0000/0000/0000" + tab_piece_images="sidebar_tab_pieces" combine="true" + left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF" + tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" /> + + <desktop background_tile_image="patterns/brushed_metal.png" background_color="rgb:FFFF/FFFF/FFFF"/> - <directory BACKGROUND_COLOR="rgb:CFFF/D333/D999" - SELECTION_BOX_COLOR_RGBA="0x727D974C" SELECTION_BOX_COLOR="rgb:7222/7DDD/9777" /> + <directory background_color="rgb:CFFF/D333/D999" + selection_box_color_rgba="0x727D974C" + selection_box_color="rgb:7222/7DDD/9777" /> - <icon HIGHLIGHT_BACKGROUND_COLOR="rgb:0000/0000/0000" HIGHLIGHT_TEXT_COLOR="rgb:FFFF/FFFF/FFFF" TEXT_FILL_COLOR="rgb:FFFF/FFFF/FFFF"/> + <icon highlight_background_color="rgb:0000/0000/0000" + highlight_text_color="rgb:FFFF/FFFF/FFFF" + text_fill_color="rgb:FFFF/FFFF/FFFF"/> - <thumbnails FRAME_OFFSETS="3,3,6,6"/> + <thumbnails frame_offsets="3,3,6,6"/> - <throbber FRAME_COUNT="15" URL="http://www.eazel.com" DELAY="75"/> + <throbber frame_count="15" url="http://www.eazel.com" delay="75"/> - <zoom_control NUMBER_V_OFFSET="-6" NUMBER_H_OFFSET="-2" DIGIT_WIDTH="6"/> + <zoom_control number_v_offset="-6" number_h_offset="-2" digit_width="6"/> - </theme> +</theme> diff --git a/icons/gnome/gnome.xml b/icons/gnome/gnome.xml index 0f83939e1..1c1f5570b 100644 --- a/icons/gnome/gnome.xml +++ b/icons/gnome/gnome.xml @@ -1,10 +1,10 @@ <?xml version="1.0"?> <theme _name="GNOME" _description="This theme uses the classic GNOME icons."> - <sidebar SIDEBAR_BACKGROUND_COLOR="rgb:DDDD/DDDD/FFFF" TITLE_COLOR="rgb:0000/0000/0000" TITLE_SHADOW_COLOR="rgb:FFFF/FFFF/FFFF" TITLE_INFO_COLOR="rgb:0000/0000/0000"/> - <desktop BACKGROUND_TILE_IMAGE="patterns/gnome.jpg"/> - <directory BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/> - <icon HIGHLIGHT_BACKGROUND_COLOR="rgb:0000/0000/0000" HIGHLIGHT_TEXT_COLOR="rgb:FFFF/FFFF/FFFF" TEXT_FILL_COLOR="rgb:FFFF/FFFF/FFFF"/> - <thumbnails FRAME_OFFSETS="3,3,6,6"/> - <toolbar ICON_THEME="standard"/> - <throbber FRAME_COUNT="10" URL="http://www.gnome.org"/> + <sidebar sidebar_background_color="rgb:DDDD/DDDD/FFFF" title_color="rgb:0000/0000/0000" title_shadow_color="rgb:FFFF/FFFF/FFFF" title_info_color="rgb:0000/0000/0000"/> + <desktop background_tile_image="patterns/gnome.jpg"/> + <directory background_color="rgb:FFFF/FFFF/FFFF"/> + <icon highlight_background_color="rgb:0000/0000/0000" highlight_text_color="rgb:FFFF/FFFF/FFFF" text_fill_color="rgb:FFFF/FFFF/FFFF"/> + <thumbnails frame_offsets="3,3,6,6"/> + <toolbar icon_theme="standard"/> + <throbber frame_count="10" url="http://www.gnome.org"/> </theme> diff --git a/icons/i-directory-accept.xml b/icons/i-directory-accept.xml index 477380831..01a37c9c9 100644 --- a/icons/i-directory-accept.xml +++ b/icons/i-directory-accept.xml @@ -1,8 +1,8 @@ <?xml version="1.0"?> -<ICON_SET> - <ICON SIZE="24" ATTACH_POINTS="12,11|25,0|25,12|25,24"/> - <ICON SIZE="36" ATTACH_POINTS="18,17|38,0|38,20|38,40"/> - <ICON SIZE="48" ATTACH_POINTS="28,25|50,0|50,24|50,48"/> - <ICON SIZE="72" ATTACH_POINTS="33,31|76,0|76,32|76,64"/> - <ICON SIZE="96" ATTACH_POINTS="48,45|100,0|100,48|100,96"/> -</ICON_SET> +<icon_set> + <icon size="24" attach_points="12,11|25,0|25,12|25,24"/> + <icon size="36" attach_points="18,17|38,0|38,20|38,40"/> + <icon size="48" attach_points="28,25|50,0|50,24|50,48"/> + <icon size="72" attach_points="33,31|76,0|76,32|76,64"/> + <icon size="96" attach_points="48,45|100,0|100,48|100,96"/> +</icon_set> diff --git a/icons/i-directory.xml b/icons/i-directory.xml index 51baddabc..646c6a5db 100644 --- a/icons/i-directory.xml +++ b/icons/i-directory.xml @@ -1,8 +1,8 @@ <?xml version="1.0"?> -<ICON_SET> - <ICON SIZE="24" ATTACH_POINTS="12,12|25,0|25,12|25,24"/> - <ICON SIZE="36" ATTACH_POINTS="20,20|38,0|38,20|38,40"/> - <ICON SIZE="48" ATTACH_POINTS="26,26|50,0|50,24|50,48"/> - <ICON SIZE="72" ATTACH_POINTS="36,36|76,0|76,32|76,64"/> - <ICON SIZE="96" ATTACH_POINTS="50,50|100,0|100,48|100,96"/> -</ICON_SET> +<icon_set> + <icon size="24" attach_points="12,12|25,0|25,12|25,24"/> + <icon size="36" attach_points="20,20|38,0|38,20|38,40"/> + <icon size="48" attach_points="26,26|50,0|50,24|50,48"/> + <icon size="72" attach_points="36,36|76,0|76,32|76,64"/> + <icon size="96" attach_points="50,50|100,0|100,48|100,96"/> +</icon_set> diff --git a/icons/i-regular.xml b/icons/i-regular.xml index 314adf146..e5ea80847 100644 --- a/icons/i-regular.xml +++ b/icons/i-regular.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> -<ICON_SET> - <ICON SIZE="36" EMBEDDED_TEXT_RECTANGLE="3,3,28,38"/> - <ICON SIZE="48" EMBEDDED_TEXT_RECTANGLE="4,4,40,48"/> - <ICON SIZE="72" EMBEDDED_TEXT_RECTANGLE="8,8,56,72"/> - <ICON SIZE="96" EMBEDDED_TEXT_RECTANGLE="12,12,65,92"/> -</ICON_SET> +<icon_set> + <icon size="36" embedded_text_rectangle="3,3,28,38"/> + <icon size="48" embedded_text_rectangle="4,4,40,48"/> + <icon size="72" embedded_text_rectangle="8,8,56,72"/> + <icon size="96" embedded_text_rectangle="12,12,65,92"/> +</icon_set> diff --git a/icons/villanova/villanova.xml b/icons/villanova/villanova.xml index 1f6406bee..9615091dd 100644 --- a/icons/villanova/villanova.xml +++ b/icons/villanova/villanova.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <theme _name="Sierra" _description="Uses manila folders and gray-green backgrounds."> - <sidebar SIDEBAR_BACKGROUND_TILE_IMAGE="./green_weave.png" SIDEBAR_BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF" TAB_PIECE_IMAGES="none"/> - <directory BACKGROUND_TILE_IMAGE="./villanova_green.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF" SELECTION_BOX_COLOR_RGBA="0x70818359" SELECTION_BOX_COLOR="rgb:7000/8111/8333"/> - <desktop BACKGROUND_TILE_IMAGE="./Sierra_desktop.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/> - <zoom_control NUMBER_V_OFFSET="-6" DIGIT_WIDTH="6"/> - </theme> + <sidebar sidebar_background_tile_image="./green_weave.png" sidebar_background_color="rgb:FFFF/FFFF/FFFF" tab_piece_images="none"/> + <directory background_tile_image="./villanova_green.png" background_color="rgb:FFFF/FFFF/FFFF" selection_box_color_rgba="0x70818359" selection_box_color="rgb:7000/8111/8333"/> + <desktop background_tile_image="./Sierra_desktop.png" background_color="rgb:FFFF/FFFF/FFFF"/> + <zoom_control number_v_offset="-6" digit_width="6"/> +</theme> diff --git a/libnautilus-extensions/nautilus-directory-metafile.c b/libnautilus-extensions/nautilus-directory-metafile.c index 73ea314d8..f7cb427c7 100644 --- a/libnautilus-extensions/nautilus-directory-metafile.c +++ b/libnautilus-extensions/nautilus-directory-metafile.c @@ -86,7 +86,7 @@ create_metafile_root (NautilusDirectory *directory) } root = xmlDocGetRootElement (directory->details->metafile); if (root == NULL) { - root = xmlNewDocNode (directory->details->metafile, NULL, "DIRECTORY", NULL); + root = xmlNewDocNode (directory->details->metafile, NULL, "directory", NULL); xmlDocSetRootElement (directory->details->metafile, root); } @@ -111,8 +111,8 @@ get_file_node (NautilusDirectory *directory, if (create) { root = create_metafile_root (directory); - node = xmlNewChild (root, NULL, "FILE", NULL); - xmlSetProp (node, "NAME", file_name); + node = xmlNewChild (root, NULL, "file", NULL); + xmlSetProp (node, "name", file_name); g_hash_table_insert (hash, xmlMemStrdup (file_name), node); return node; } @@ -650,7 +650,7 @@ nautilus_directory_rename_file_metadata (NautilusDirectory *directory, xmlFree (key); g_hash_table_insert (hash, xmlMemStrdup (new_file_name), value); - xmlSetProp (file_node, "NAME", new_file_name); + xmlSetProp (file_node, "name", new_file_name); nautilus_directory_request_write_metafile (directory); } } else { @@ -872,7 +872,7 @@ nautilus_directory_copy_file_metadata (NautilusDirectory *source_directory, node = xmlCopyNode (source_node, TRUE); root = create_metafile_root (destination_directory); xmlAddChild (root, node); - xmlSetProp (node, "NAME", destination_file_name); + xmlSetProp (node, "name", destination_file_name); g_hash_table_insert (destination_directory->details->metafile_node_hash, xmlMemStrdup (destination_file_name), node); } else { @@ -972,8 +972,8 @@ nautilus_directory_set_metafile_contents (NautilusDirectory *directory, hash = directory->details->metafile_node_hash; for (node = nautilus_xml_get_root_children (metafile_contents); node != NULL; node = node->next) { - if (strcmp (node->name, "FILE") == 0) { - name = xmlGetProp (node, "NAME"); + if (strcmp (node->name, "file") == 0) { + name = xmlGetProp (node, "name"); if (g_hash_table_lookup (hash, name) != NULL) { xmlFree (name); /* FIXME: Should we delete duplicate nodes as we discover them? */ diff --git a/libnautilus-extensions/nautilus-directory.c b/libnautilus-extensions/nautilus-directory.c index 81dea28df..ef38ab361 100644 --- a/libnautilus-extensions/nautilus-directory.c +++ b/libnautilus-extensions/nautilus-directory.c @@ -1498,23 +1498,23 @@ nautilus_self_check_directory (void) gtk_main_iteration (); } - nautilus_file_set_metadata (file, "TEST", "default", "value"); - NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_metadata (file, "TEST", "default"), "value"); - - nautilus_file_set_boolean_metadata (file, "TEST_BOOLEAN", TRUE, TRUE); - NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (file, "TEST_BOOLEAN", TRUE), TRUE); - nautilus_file_set_boolean_metadata (file, "TEST_BOOLEAN", TRUE, FALSE); - NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (file, "TEST_BOOLEAN", TRUE), FALSE); - NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (NULL, "TEST_BOOLEAN", TRUE), TRUE); - - nautilus_file_set_integer_metadata (file, "TEST_INTEGER", 0, 17); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "TEST_INTEGER", 0), 17); - nautilus_file_set_integer_metadata (file, "TEST_INTEGER", 0, -1); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "TEST_INTEGER", 0), -1); - nautilus_file_set_integer_metadata (file, "TEST_INTEGER", 42, 42); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "TEST_INTEGER", 42), 42); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (NULL, "TEST_INTEGER", 42), 42); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "NONEXISTENT_KEY", 42), 42); + nautilus_file_set_metadata (file, "test", "default", "value"); + NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_metadata (file, "test", "default"), "value"); + + nautilus_file_set_boolean_metadata (file, "test_boolean", TRUE, TRUE); + NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (file, "test_boolean", TRUE), TRUE); + nautilus_file_set_boolean_metadata (file, "test_boolean", TRUE, FALSE); + NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (file, "test_boolean", TRUE), FALSE); + NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (NULL, "test_boolean", TRUE), TRUE); + + nautilus_file_set_integer_metadata (file, "test_integer", 0, 17); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "test_integer", 0), 17); + nautilus_file_set_integer_metadata (file, "test_integer", 0, -1); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "test_integer", 0), -1); + nautilus_file_set_integer_metadata (file, "test_integer", 42, 42); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "test_integer", 42), 42); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (NULL, "test_integer", 42), 42); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "nonexistent_key", 42), 42); NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_directory_get ("file:///etc") == directory, TRUE); nautilus_directory_unref (directory); @@ -1569,7 +1569,7 @@ nautilus_self_check_directory (void) file = nautilus_file_get ("file:///etc/passwd"); - NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_metadata (file, "TEST", "default"), "value"); + NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_metadata (file, "test", "default"), "value"); nautilus_file_unref (file); diff --git a/libnautilus-extensions/nautilus-file.c b/libnautilus-extensions/nautilus-file.c index f913bd749..aa24a27f9 100644 --- a/libnautilus-extensions/nautilus-file.c +++ b/libnautilus-extensions/nautilus-file.c @@ -3862,7 +3862,7 @@ nautilus_file_get_keywords (NautilusFile *file) /* Put all the keywords into a list. */ keywords = nautilus_file_get_metadata_list - (file, "KEYWORD", "NAME"); + (file, "keyword", "name"); return sort_keyword_list_and_remove_duplicates (keywords); } @@ -3885,7 +3885,7 @@ nautilus_file_set_keywords (NautilusFile *file, GList *keywords) canonical_keywords = sort_keyword_list_and_remove_duplicates (g_list_copy (keywords)); nautilus_file_set_metadata_list - (file, "KEYWORD", "NAME", canonical_keywords); + (file, "keyword", "name", canonical_keywords); g_list_free (canonical_keywords); } diff --git a/libnautilus-extensions/nautilus-gconf-extensions.c b/libnautilus-extensions/nautilus-gconf-extensions.c index cd1513071..15b92e229 100644 --- a/libnautilus-extensions/nautilus-gconf-extensions.c +++ b/libnautilus-extensions/nautilus-gconf-extensions.c @@ -25,13 +25,11 @@ #include <config.h> #include "nautilus-gconf-extensions.h" -#include <gconf/gconf.h> +#include "nautilus-glib-extensions.h" +#include "nautilus-stock-dialogs.h" #include <gconf/gconf-client.h> - -#include <libgnome/gnome-defs.h> +#include <gconf/gconf.h> #include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-dialog.h> -#include <libgnomeui/gnome-dialog-util.h> static GConfClient *global_gconf_client = NULL; @@ -73,24 +71,22 @@ nautilus_gconf_client_get_global (void) gboolean nautilus_gconf_handle_error (GError **error) { + char *message; static gboolean shown_dialog = FALSE; g_return_val_if_fail (error != NULL, FALSE); if (*error != NULL) { g_warning (_("GConf error:\n %s"), (*error)->message); - if ( ! shown_dialog) { - char *message; - GtkWidget *dialog; - + if (! shown_dialog) { shown_dialog = TRUE; message = g_strdup_printf (_("GConf error:\n %s\n" "All further errors shown " "only on terminal"), (*error)->message); - - dialog = gnome_error_dialog (message); + nautilus_show_error_dialog (message, _("GConf Error"), NULL); + g_free (message); } g_error_free (*error); *error = NULL; @@ -214,37 +210,47 @@ nautilus_gconf_get_string (const char *key) void nautilus_gconf_set_string_list (const char *key, - GSList *string_list_value) + GList *string_list_value) { GConfClient *client; - GError *error = NULL; + GError *error; + GSList *slist; g_return_if_fail (key != NULL); client = nautilus_gconf_client_get_global (); g_return_if_fail (client != NULL); - gconf_client_set_list (client, key, GCONF_VALUE_STRING, string_list_value, &error); + slist = nautilus_g_slist_from_g_list (string_list_value); + + error = NULL; + gconf_client_set_list (client, key, GCONF_VALUE_STRING, slist, &error); nautilus_gconf_handle_error (&error); + + g_slist_free (slist); } -GSList * +GList * nautilus_gconf_get_string_list (const char *key) { - GSList *result; + GSList *slist; + GList *result; GConfClient *client; - GError *error = NULL; + GError *error; g_return_val_if_fail (key != NULL, NULL); client = nautilus_gconf_client_get_global (); g_return_val_if_fail (client != NULL, NULL); - result = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error); - + error = NULL; + slist = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error); if (nautilus_gconf_handle_error (&error)) { - result = NULL; + slist = NULL; } + + result = nautilus_g_list_from_g_slist (slist); + g_slist_free (slist); return result; } diff --git a/libnautilus-extensions/nautilus-gconf-extensions.h b/libnautilus-extensions/nautilus-gconf-extensions.h index b5901bf5f..a9393feb4 100644 --- a/libnautilus-extensions/nautilus-gconf-extensions.h +++ b/libnautilus-extensions/nautilus-gconf-extensions.h @@ -31,23 +31,23 @@ BEGIN_GNOME_DECLS -GConfClient *nautilus_gconf_client_get_global (void); -gboolean nautilus_gconf_handle_error (GError **error); -void nautilus_gconf_set_boolean (const char *key, - gboolean boolean_value); -gboolean nautilus_gconf_get_boolean (const char *key); -int nautilus_gconf_get_integer (const char *key); -void nautilus_gconf_set_integer (const char *key, - int int_value); -char *nautilus_gconf_get_string (const char *key); -void nautilus_gconf_set_string (const char *key, - const char *string_value); -GSList *nautilus_gconf_get_string_list (const char *key); -void nautilus_gconf_set_string_list (const char *key, - GSList *string_list_value); -gboolean nautilus_gconf_is_default (const char *key); -gboolean nautilus_gconf_monitor_directory (const char *directory); -void nautilus_gconf_suggest_sync (void); +GConfClient *nautilus_gconf_client_get_global (void); +gboolean nautilus_gconf_handle_error (GError **error); +void nautilus_gconf_set_boolean (const char *key, + gboolean boolean_value); +gboolean nautilus_gconf_get_boolean (const char *key); +int nautilus_gconf_get_integer (const char *key); +void nautilus_gconf_set_integer (const char *key, + int int_value); +char * nautilus_gconf_get_string (const char *key); +void nautilus_gconf_set_string (const char *key, + const char *string_value); +GList * nautilus_gconf_get_string_list (const char *key); +void nautilus_gconf_set_string_list (const char *key, + GList *string_list_value); +gboolean nautilus_gconf_is_default (const char *key); +gboolean nautilus_gconf_monitor_directory (const char *directory); +void nautilus_gconf_suggest_sync (void); END_GNOME_DECLS diff --git a/libnautilus-extensions/nautilus-glib-extensions.c b/libnautilus-extensions/nautilus-glib-extensions.c index c0660dbec..8b4b5e09c 100644 --- a/libnautilus-extensions/nautilus-glib-extensions.c +++ b/libnautilus-extensions/nautilus-glib-extensions.c @@ -997,9 +997,12 @@ nautilus_shell_quote (const char *string) return quoted_str; } -int nautilus_g_round (double d) +int +nautilus_round (double d) { - double val = floor (d + .5); + double val; + + val = floor (d + .5); /* The tests are needed because the result of floating-point to integral * conversion is undefined if the floating point value is not representable @@ -1012,6 +1015,32 @@ int nautilus_g_round (double d) return val; } +GList * +nautilus_g_list_from_g_slist (GSList *slist) +{ + GList *list; + GSList *node; + + list = NULL; + for (node = slist; node != NULL; node = node->next) { + list = g_list_prepend (list, node->data); + } + return g_list_reverse (list); +} + +GSList * +nautilus_g_slist_from_g_list (GList *list) +{ + GSList *slist; + GList *node; + + slist = NULL; + for (node = list; node != NULL; node = node->next) { + slist = g_slist_prepend (slist, node->data); + } + return g_slist_reverse (slist); +} + #if !defined (NAUTILUS_OMIT_SELF_CHECK) static void diff --git a/libnautilus-extensions/nautilus-glib-extensions.h b/libnautilus-extensions/nautilus-glib-extensions.h index 2ba84b70a..ea15e1e91 100644 --- a/libnautilus-extensions/nautilus-glib-extensions.h +++ b/libnautilus-extensions/nautilus-glib-extensions.h @@ -75,19 +75,22 @@ GList * nautilus_g_list_partition (GList NautilusPredicateFunction predicate, gpointer user_data, GList **removed); -void nautilus_g_list_free_deep_custom (GList *list, - GFunc element_free_func, - gpointer user_data); /* List functions for lists of g_free'able objects. */ void nautilus_g_list_free_deep (GList *list); -void nautilus_g_slist_free_deep_custom (GSList *list, +void nautilus_g_list_free_deep_custom (GList *list, GFunc element_free_func, gpointer user_data); +/* GSList functions. */ +GList * nautilus_g_list_from_g_slist (GSList *list); +GSList * nautilus_g_slist_from_g_list (GList *list); + /* List functions for slists of g_free'able objects. */ void nautilus_g_slist_free_deep (GSList *list); - +void nautilus_g_slist_free_deep_custom (GSList *list, + GFunc element_free_func, + gpointer user_data); /* List functions for lists of C strings. */ gboolean nautilus_g_str_list_equal (GList *str_list_a, @@ -143,6 +146,6 @@ gint64 nautilus_get_system_time (void); char * nautilus_shell_quote (const char *string); /* math */ -int nautilus_g_round (double d); +int nautilus_round (double d); #endif /* NAUTILUS_GLIB_EXTENSIONS_H */ diff --git a/libnautilus-extensions/nautilus-icon-container.c b/libnautilus-extensions/nautilus-icon-container.c index d8431f784..1435e9481 100644 --- a/libnautilus-extensions/nautilus-icon-container.c +++ b/libnautilus-extensions/nautilus-icon-container.c @@ -1508,12 +1508,17 @@ start_rubberbanding (NautilusIconContainer *container, event->x, event->y, &band_info->start_x, &band_info->start_y); + /* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ if (GNOME_CANVAS(container)->aa) { - fill_color_str = nautilus_theme_get_theme_data ("directory", "SELECTION_BOX_COLOR_RGBA"); + /* FIXME: Should use some standard format, not just a 32-bit integer. */ + fill_color_str = nautilus_theme_get_theme_data ("directory", "selection_box_color_rgba"); if (fill_color_str == NULL) { - fill_color = 0x77bbdd40; + fill_color = 0x77BBDD40; } else { fill_color = strtoul (fill_color_str, NULL, 0); + /* FIXME: Need error handling here. */ g_free (fill_color_str); } @@ -1533,7 +1538,7 @@ start_rubberbanding (NautilusIconContainer *container, NULL); } else { - fill_color_str = nautilus_theme_get_theme_data ("directory", "SELECTION_BOX_COLOR"); + fill_color_str = nautilus_theme_get_theme_data ("directory", "selection_box_color"); if (fill_color_str == NULL) { fill_color_str = g_strdup ("rgb:7777/BBBB/DDDD"); } @@ -2282,6 +2287,9 @@ destroy (GtkObject *object) gdk_pixbuf_unref (container->details->highlight_frame); } + /* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME, nautilus_icon_container_theme_changed, container); @@ -3265,7 +3273,7 @@ nautilus_icon_container_initialize (NautilusIconContainer *container) /* Set up DnD. */ nautilus_icon_dnd_init (container, stipple); - /* Make sure that we find out if the theme changes. */ + /* Make sure that we find out if the icons change. */ gtk_signal_connect_object_while_alive (nautilus_icon_factory_get (), "icons_changed", @@ -3284,7 +3292,9 @@ nautilus_icon_container_initialize (NautilusIconContainer *container) gtk_signal_connect (GTK_OBJECT (container), "focus-out-event", handle_focus_out_event, NULL); - + /* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ /* read in theme-dependent data */ nautilus_icon_container_theme_changed (container); nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_THEME, nautilus_icon_container_theme_changed, container); @@ -4928,8 +4938,11 @@ update_label_color (NautilusBackground *background, g_assert (NAUTILUS_IS_BACKGROUND (background)); g_assert (NAUTILUS_IS_ICON_CONTAINER (container)); + /* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ /* read the info colors from the current theme; use a reasonable default if undefined */ - light_info_color = nautilus_theme_get_theme_data ("directory", "LIGHT_INFO_COLOR"); + light_info_color = nautilus_theme_get_theme_data ("directory", "light_info_color"); if (light_info_color == NULL) { light_info_value = 0xAAAAFD; } else { @@ -4937,7 +4950,7 @@ update_label_color (NautilusBackground *background, g_free (light_info_color); } - dark_info_color = nautilus_theme_get_theme_data ("directory", "DARK_INFO_COLOR"); + dark_info_color = nautilus_theme_get_theme_data ("directory", "dark_info_color"); if (dark_info_color == NULL) { dark_info_value = 0x33337F; } else { @@ -4976,6 +4989,9 @@ nautilus_icon_container_set_is_fixed_size (NautilusIconContainer *container, /* handle theme changes */ +/* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ static void nautilus_icon_container_theme_changed (gpointer user_data) { @@ -4994,7 +5010,7 @@ nautilus_icon_container_theme_changed (gpointer user_data) g_free (text_frame_path); /* load the highlight color */ - highlight_color_str = nautilus_theme_get_theme_data ("directory", "HIGHLIGHT_COLOR_RGBA"); + highlight_color_str = nautilus_theme_get_theme_data ("directory", "highlight_color_rgba"); if (highlight_color_str == NULL) { container->details->highlight_color = NAUTILUS_RGBA_COLOR_PACK (0, 0, 0, 102); diff --git a/libnautilus-extensions/nautilus-icon-factory.c b/libnautilus-extensions/nautilus-icon-factory.c index b039fad56..9be2faeae 100644 --- a/libnautilus-extensions/nautilus-icon-factory.c +++ b/libnautilus-extensions/nautilus-icon-factory.c @@ -731,7 +731,7 @@ set_theme (const char *theme_name) /* now set up the default theme */ g_free (factory->default_theme_name); - factory->default_theme_name = nautilus_theme_get_theme_data ("icon-images", "DEFAULT_THEME"); + factory->default_theme_name = nautilus_theme_get_theme_data ("icon-images", "default_theme"); check_local_theme (factory->default_theme_name, &factory->local_default_theme); /* we changed the theme, so emit the icons_changed signal */ @@ -978,10 +978,10 @@ get_themed_icon_file_path (const char *theme_name, size_as_string = g_strdup_printf ("%u", icon_size); node = nautilus_xml_get_root_child_by_name_and_property - (doc, "ICON", "SIZE", size_as_string); + (doc, "icon", "size", size_as_string); g_free (size_as_string); - property = xmlGetProp (node, "EMBEDDED_TEXT_RECTANGLE"); + property = xmlGetProp (node, "embedded_text_rectangle"); if (property != NULL) { if (sscanf (property, @@ -995,7 +995,7 @@ get_themed_icon_file_path (const char *theme_name, xmlFree (property); } - property = xmlGetProp (node, "ATTACH_POINTS"); + property = xmlGetProp (node, "attach_points"); parse_attach_points (&details->attach_points, property); xmlFree (property); @@ -1115,7 +1115,7 @@ icon_theme_changed_callback (gpointer user_data) * long run, we sould just get rid of the user preference. */ theme_preference = nautilus_preferences_get (NAUTILUS_PREFERENCES_THEME); - icon_theme = nautilus_theme_get_theme_data ("icons", "ICON_THEME"); + icon_theme = nautilus_theme_get_theme_data ("icons", "icon_theme"); set_theme (icon_theme == NULL ? theme_preference : icon_theme); diff --git a/libnautilus-extensions/nautilus-icon-text-item.c b/libnautilus-extensions/nautilus-icon-text-item.c index e9390b859..ac4b95a3e 100644 --- a/libnautilus-extensions/nautilus-icon-text-item.c +++ b/libnautilus-extensions/nautilus-icon-text-item.c @@ -271,10 +271,10 @@ iti_destroy (GtkObject *object) /* Queue redraw of bounding box */ gnome_canvas_request_redraw (item->canvas, - nautilus_g_round (item->x1), - nautilus_g_round (item->y1), - nautilus_g_round (item->x2), - nautilus_g_round (item->y2)); + nautilus_round (item->x1), + nautilus_round (item->y1), + nautilus_round (item->x2), + nautilus_round (item->y2)); /* Free everything */ if (iti->font) @@ -373,16 +373,16 @@ iti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) (* parent_class->update) (item, affine, clip_path, flags); gnome_canvas_request_redraw (item->canvas, - nautilus_g_round (item->x1), - nautilus_g_round (item->y1), - nautilus_g_round (item->x2), - nautilus_g_round (item->y2)); + nautilus_round (item->x1), + nautilus_round (item->y1), + nautilus_round (item->x2), + nautilus_round (item->y2)); recompute_bounding_box (iti); gnome_canvas_request_redraw (item->canvas, - nautilus_g_round (item->x1), - nautilus_g_round (item->y1), - nautilus_g_round (item->x2), - nautilus_g_round (item->y2)); + nautilus_round (item->x1), + nautilus_round (item->y1), + nautilus_round (item->x2), + nautilus_round (item->y2)); } /* utility to fetch a color from a theme */ @@ -437,9 +437,9 @@ iti_paint_text (Iti *iti, GdkDrawable *drawable, int x, int y) bsgc = style->bg_gc [GTK_STATE_SELECTED]; /* fetch the colors from the theme */ - fetch_themed_color ("HIGHLIGHT_BACKGROUND_COLOR", &highlight_background_color); - fetch_themed_color ("HIGHLIGHT_TEXT_COLOR", &highlight_text_color); - fetch_themed_color ("TEXT_FILL_COLOR", &fill_color); + fetch_themed_color ("highlight_background_color", &highlight_background_color); + fetch_themed_color ("highlight_text_color", &highlight_text_color); + fetch_themed_color ("text_fill_color", &fill_color); /* Set up user defined colors */ canvas_item = GNOME_CANVAS_ITEM (iti); @@ -569,11 +569,11 @@ iti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int update iti = ITI (item); - width = nautilus_g_round (item->x2 - item->x1); - height = nautilus_g_round (item->y2 - item->y1); + width = nautilus_round (item->x2 - item->x1); + height = nautilus_round (item->y2 - item->y1); - xofs = nautilus_g_round (item->x1) - x; - yofs = nautilus_g_round (item->y1) - y; + xofs = nautilus_round (item->x1) - x; + yofs = nautilus_round (item->y1) - y; style = GTK_WIDGET (item->canvas)->style; @@ -655,8 +655,8 @@ iti_render (GnomeCanvasItem *item, GnomeCanvasBuf *buffer) visual = gdk_visual_get_system (); art_affine_identity(affine); - width = nautilus_g_round (item->x2 - item->x1); - height = nautilus_g_round (item->y2 - item->y1); + width = nautilus_round (item->x2 - item->x1); + height = nautilus_round (item->y2 - item->y1); /* allocate a pixmap to draw the text into, and clear it to white */ pixmap = gdk_pixmap_new (NULL, width, height, visual->depth); @@ -671,7 +671,7 @@ iti_render (GnomeCanvasItem *item, GnomeCanvasBuf *buffer) gdk_gc_unref (gc); /* use a common routine to draw the label into the pixmap */ - iti_draw (item, pixmap, nautilus_g_round (item->x1), nautilus_g_round (item->y1), width, height); + iti_draw (item, pixmap, nautilus_round (item->x1), nautilus_round (item->y1), width, height); /* turn it into a pixbuf */ colormap = gdk_colormap_new (visual, FALSE); @@ -686,7 +686,7 @@ iti_render (GnomeCanvasItem *item, GnomeCanvasBuf *buffer) gdk_pixmap_unref (pixmap); /* draw the pixbuf containing the label */ - draw_pixbuf_aa (text_pixbuf, buffer, affine, nautilus_g_round (item->x1), nautilus_g_round (item->y1)); + draw_pixbuf_aa (text_pixbuf, buffer, affine, nautilus_round (item->x1), nautilus_round (item->y1)); gdk_pixbuf_unref (text_pixbuf); buffer->is_bg = FALSE; @@ -1025,8 +1025,8 @@ iti_event (GnomeCanvasItem *item, GdkEvent *event) if (event->button.button == 1) { gnome_canvas_w2c_d (item->canvas, event->button.x, event->button.y, &cx, &cy); idx = iti_idx_from_x_y (iti, - nautilus_g_round (cx - (item->x1 + MARGIN_X)), - nautilus_g_round (cy - (item->y1 + MARGIN_Y))); + nautilus_round (cx - (item->x1 + MARGIN_X)), + nautilus_round (cy - (item->y1 + MARGIN_Y))); iti_start_selecting (iti, idx, event->button.time); } return TRUE; @@ -1038,8 +1038,8 @@ iti_event (GnomeCanvasItem *item, GdkEvent *event) gtk_widget_event (GTK_WIDGET (priv->entry), event); gnome_canvas_w2c_d (item->canvas, event->button.x, event->button.y, &cx, &cy); idx = iti_idx_from_x_y (iti, - nautilus_g_round (cx - (item->x1 + MARGIN_X)), - nautilus_g_round (cy - (item->y1 + MARGIN_Y))); + nautilus_round (cx - (item->x1 + MARGIN_X)), + nautilus_round (cy - (item->y1 + MARGIN_Y))); iti_selection_motion (iti, idx); return TRUE; diff --git a/libnautilus-extensions/nautilus-link-set.c b/libnautilus-extensions/nautilus-link-set.c index 9806fa707..05383e8a8 100644 --- a/libnautilus-extensions/nautilus-link-set.c +++ b/libnautilus-extensions/nautilus-link-set.c @@ -56,16 +56,16 @@ create_new_link (const char *directory_path, const char *name, const char *image output_document = xmlNewDoc ("1.0"); /* add the root node to the output document */ - root_node = xmlNewDocNode (output_document, NULL, "NAUTILUS_OBJECT", NULL); + root_node = xmlNewDocNode (output_document, NULL, "nautilus_object", NULL); xmlDocSetRootElement (output_document, root_node); /* Add mime magic string so that the mime sniffer can recognize us. * Note: The value of the tag has no meaning. */ - xmlSetProp (root_node, "NAUTILUS_LINK", "Nautilus Link"); + xmlSetProp (root_node, "nautilus_link", "Nautilus Link"); /* Add link and custom icon tags */ - xmlSetProp (root_node, "CUSTOM_ICON", image); - xmlSetProp (root_node, "LINK", uri); + xmlSetProp (root_node, "custom_icon", image); + xmlSetProp (root_node, "link", uri); /* all done, so save the xml document as a link file */ file_name = nautilus_make_path (directory_path, name); diff --git a/libnautilus-extensions/nautilus-link.c b/libnautilus-extensions/nautilus-link.c index 1463d2aef..2b5cb80b5 100644 --- a/libnautilus-extensions/nautilus-link.c +++ b/libnautilus-extensions/nautilus-link.c @@ -117,16 +117,16 @@ nautilus_link_local_create (const char *directory_path, output_document = xmlNewDoc ("1.0"); /* add the root node to the output document */ - root_node = xmlNewDocNode (output_document, NULL, "NAUTILUS_OBJECT", NULL); + root_node = xmlNewDocNode (output_document, NULL, "nautilus_object", NULL); xmlDocSetRootElement (output_document, root_node); /* Add mime magic string so that the mime sniffer can recognize us. * Note: The value of the tag identfies what type of link this. */ - xmlSetProp (root_node, "NAUTILUS_LINK", get_tag (type)); + xmlSetProp (root_node, "nautilus_link", get_tag (type)); /* Add link and custom icon tags */ - xmlSetProp (root_node, "CUSTOM_ICON", image); - xmlSetProp (root_node, "LINK", target_uri); + xmlSetProp (root_node, "custom_icon", image); + xmlSetProp (root_node, "link", target_uri); /* all done, so save the xml document as a link file */ path = nautilus_make_path (directory_path, name); @@ -269,7 +269,7 @@ gboolean nautilus_link_local_set_link_uri (const char *path, const char *link_uri) { return local_set_root_property (path, - "LINK", + "link", link_uri, forget_file_activation_uri); } @@ -279,7 +279,7 @@ nautilus_link_local_set_type (const char *path, NautilusLinkType type) { return local_set_root_property (path, - "NAUTILUS_LINK", + "nautilus_link", get_tag (type), NULL); } @@ -428,18 +428,18 @@ nautilus_link_local_get_image_uri (const char *path) char * nautilus_link_local_get_link_uri (const char *path) { - return local_get_root_property (path, "LINK"); + return local_get_root_property (path, "link"); } /* Returns the link type of the link file. */ NautilusLinkType nautilus_link_local_get_link_type (const char *path) { - return get_link_type (local_get_root_property (path, "NAUTILUS_LINK")); + return get_link_type (local_get_root_property (path, "nautilus_link")); } /* FIXME bugzilla.eazel.com 2495: - * Caller has to know to pass in a file with a NULL character at the end. + * Caller has to know to pass in a file with a NUL character at the end. */ char * nautilus_link_get_link_uri_given_file_contents (const char *file_contents, @@ -449,7 +449,7 @@ nautilus_link_get_link_uri_given_file_contents (const char *file_contents, char *property; doc = xmlParseMemory ((char *) file_contents, file_size); - property = xml_get_root_property (doc, "LINK"); + property = xml_get_root_property (doc, "link"); xmlFreeDoc (doc); return property; } diff --git a/libnautilus-extensions/nautilus-metadata.h b/libnautilus-extensions/nautilus-metadata.h index 3de64b564..00f96a2da 100644 --- a/libnautilus-extensions/nautilus-metadata.h +++ b/libnautilus-extensions/nautilus-metadata.h @@ -31,49 +31,49 @@ /* Per-file */ -#define NAUTILUS_METADATA_KEY_CONTENT_VIEWS "CONTENT_VIEWS" +#define NAUTILUS_METADATA_KEY_CONTENT_VIEWS "content_views" -#define NAUTILUS_METADATA_KEY_DEFAULT_ACTION_TYPE "DEFAULT_ACTION_TYPE" -#define NAUTILUS_METADATA_KEY_DEFAULT_APPLICATION "DEFAULT_APPLICATION" -#define NAUTILUS_METADATA_KEY_DEFAULT_COMPONENT "DEFAULT_COMPONENT" -#define NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_ADD "SHORT_LIST_APPLICATION_ADD" -#define NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_REMOVE "SHORT_LIST_APPLICATION_REMOVE" -#define NAUTILUS_METADATA_KEY_EXPLICIT_APPLICATION "APPLICATION" -#define NAUTILUS_METADATA_SUBKEY_APPLICATION_ID "ID" -#define NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_ADD "SHORT_LIST_COMPONENT_ADD" -#define NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_REMOVE "SHORT_LIST_COMPONENT_REMOVE" -#define NAUTILUS_METADATA_KEY_EXPLICIT_COMPONENT "EXPLICIT_CONTENT_VIEW" -#define NAUTILUS_METADATA_SUBKEY_COMPONENT_IID "IID" +#define NAUTILUS_METADATA_KEY_DEFAULT_ACTION_TYPE "default_action_type" +#define NAUTILUS_METADATA_KEY_DEFAULT_APPLICATION "default_application" +#define NAUTILUS_METADATA_KEY_DEFAULT_COMPONENT "default_component" +#define NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_ADD "short_list_application_add" +#define NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_REMOVE "short_list_application_remove" +#define NAUTILUS_METADATA_KEY_EXPLICIT_APPLICATION "application" +#define NAUTILUS_METADATA_SUBKEY_APPLICATION_ID "id" +#define NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_ADD "short_list_component_add" +#define NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_REMOVE "short_list_component_remove" +#define NAUTILUS_METADATA_KEY_EXPLICIT_COMPONENT "explicit_content_view" +#define NAUTILUS_METADATA_SUBKEY_COMPONENT_IID "iid" -#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR "BACKGROUND_COLOR" -#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE "BACKGROUND_TILE_IMAGE" +#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR "background_color" +#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE "background_tile_image" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL "ICONS_ZOOM_LEVEL" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT "ICONS_AUTO_LAYOUT" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_TIGHTER_LAYOUT "ICONS_TIGHTER_LAYOUT" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY "ICONS_SORT_BY" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED "ICONS_SORT_REVERSED" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL "icon_view_zoom_level" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT "icon_view_auto_layout" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_TIGHTER_LAYOUT "icon_view_tighter_layout" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY "icon_view_sort_by" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED "icon_view_sort_reversed" -#define NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL "LIST_ZOOM_LEVEL" -#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN "LIST_SORT_COLUMN" -#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED "LIST_SORT_REVERSED" +#define NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL "list_view_zoom_level" +#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN "list_view_sort_column" +#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED "list_view_sort_reversed" -#define NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY "WINDOW_GEOMETRY" +#define NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY "window_geometry" -#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR "SIDEBAR_BACKGROUND_COLOR" -#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE "SIDEBAR_BACKGROUND_TILE_IMAGE" -#define NAUTILUS_METADATA_KEY_SIDEBAR_BUTTONS "SIDEBAR_BUTTONS" -#define NAUTILUS_METADATA_KEY_SIDEBAR_TAB_COLOR "SIDEBAR_TAB_COLOR" -#define NAUTILUS_METADATA_KEY_SIDEBAR_TITLE_TAB_COLOR "SIDEBAR_TITLE_TAB_COLOR" +#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR "sidebar_background_color" +#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE "sidebar_background_tile_image" +#define NAUTILUS_METADATA_KEY_SIDEBAR_BUTTONS "sidebar_buttons" +#define NAUTILUS_METADATA_KEY_SIDEBAR_TAB_COLOR "sidebar_tab_color" +#define NAUTILUS_METADATA_KEY_SIDEBAR_TITLE_TAB_COLOR "sidebar_title_tab_color" -#define NAUTILUS_METADATA_KEY_NOTES "NOTES" -#define NAUTILUS_METADATA_KEY_ANNOTATION "ANNOTATION" -#define NAUTILUS_METADATA_KEY_ICON_POSITION "ICON_POSITION" -#define NAUTILUS_METADATA_KEY_ICON_SCALE "ICON_SCALE" -#define NAUTILUS_METADATA_KEY_CUSTOM_ICON "CUSTOM_ICON" +#define NAUTILUS_METADATA_KEY_NOTES "notes" +#define NAUTILUS_METADATA_KEY_ANNOTATION "annotation" +#define NAUTILUS_METADATA_KEY_ICON_POSITION "icon_position" +#define NAUTILUS_METADATA_KEY_ICON_SCALE "icon_scale" +#define NAUTILUS_METADATA_KEY_CUSTOM_ICON "custom_icon" /* per link file */ -#define NAUTILUS_METADATA_KEY_EXTRA_TEXT "EXTRA_TEXT" +#define NAUTILUS_METADATA_KEY_EXTRA_TEXT "extra_text" #endif /* NAUTILUS_METADATA_H */ diff --git a/libnautilus-extensions/nautilus-preferences.c b/libnautilus-extensions/nautilus-preferences.c index eb8e636d0..f76a2b4f6 100644 --- a/libnautilus-extensions/nautilus-preferences.c +++ b/libnautilus-extensions/nautilus-preferences.c @@ -513,7 +513,7 @@ nautilus_preferences_get (const char *name) void nautilus_preferences_set_string_list (const char *name, - GSList *string_list_value) + GList *string_list_value) { char *key; @@ -526,10 +526,10 @@ nautilus_preferences_set_string_list (const char *name, nautilus_gconf_suggest_sync (); } -GSList * +GList * nautilus_preferences_get_string_list (const char *name) { - GSList *result; + GList *result; char *key; g_return_val_if_fail (name != NULL, NULL); @@ -682,7 +682,7 @@ nautilus_preferences_default_get_string (const char *name, void nautilus_preferences_default_set_string_list (const char *name, int user_level, - GSList *string_list_value) + GList *string_list_value) { char *default_key; @@ -693,11 +693,11 @@ nautilus_preferences_default_set_string_list (const char *name, g_free (default_key); } -GSList * +GList * nautilus_preferences_default_get_string_list (const char *name, int user_level) { - GSList *result; + GList *result; char *default_key; g_return_val_if_fail (name != NULL, NULL); diff --git a/libnautilus-extensions/nautilus-preferences.h b/libnautilus-extensions/nautilus-preferences.h index 6c61bf30d..a8586e6ec 100644 --- a/libnautilus-extensions/nautilus-preferences.h +++ b/libnautilus-extensions/nautilus-preferences.h @@ -2,7 +2,7 @@ /* nautilus-preferences.c - Preference peek/poke/notify interface. - Copyright (C) 1999, 2000 Eazel, Inc. + Copyright (C) 1999, 2000, 2001 Eazel, Inc. The Gnome Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -62,9 +62,9 @@ void nautilus_preferences_set_integer (const char char * nautilus_preferences_get (const char *name); void nautilus_preferences_set (const char *name, const char *string_value); -GSList * nautilus_preferences_get_string_list (const char *name); +GList * nautilus_preferences_get_string_list (const char *name); void nautilus_preferences_set_string_list (const char *name, - GSList *string_list_value); + GList *string_list_value); /* Default values getters and setters */ gboolean nautilus_preferences_default_get_boolean (const char *name, @@ -82,11 +82,11 @@ char * nautilus_preferences_default_get_string (const char void nautilus_preferences_default_set_string (const char *name, int user_level, const char *string_value); -GSList * nautilus_preferences_default_get_string_list (const char *name, +GList * nautilus_preferences_default_get_string_list (const char *name, int user_level); void nautilus_preferences_default_set_string_list (const char *name, int user_level, - GSList *string_list_value); + GList *string_list_value); /* Callbacks */ void nautilus_preferences_add_callback (const char *name, NautilusPreferencesCallback callback, diff --git a/libnautilus-extensions/nautilus-search-uri.c b/libnautilus-extensions/nautilus-search-uri.c index 7a7614201..75d8b03b1 100644 --- a/libnautilus-extensions/nautilus-search-uri.c +++ b/libnautilus-extensions/nautilus-search-uri.c @@ -27,17 +27,18 @@ /* Must be included before other libgnome headers. */ #include <libgnome/gnome-defs.h> +#include "nautilus-glib-extensions.h" #include "nautilus-lib-self-check-functions.h" #include "nautilus-string.h" #include <libgnome/gnome-i18n.h> #include <libgnomevfs/gnome-vfs-utils.h> -static const char * strip_uri_beginning (const char *location_uri); -static GSList * tokenize_uri (const char *string); -static char * get_translated_criterion (const GSList *criterion); -static char * get_nth_criterion_prefix (GSList *criterion); -static char * parse_uri (const char *search_uri); -static void free_tokenized_uri (GSList *list); +static const char *strip_uri_beginning (const char *location_uri); +static GList * tokenize_uri (const char *string); +static char * get_translated_criterion (GList *criterion); +static char * get_nth_criterion_prefix (GList *criterion); +static char * parse_uri (const char *search_uri); +static void free_tokenized_uri (GList *list); /** * strip_uri_beginning: @@ -79,22 +80,14 @@ strip_uri_beginning (const char *location_uri) * */ static void -free_tokenized_uri (GSList *list) +free_tokenized_uri (GList *list) { - GSList *temp_list; - - for (temp_list = list; temp_list != NULL; temp_list = temp_list->next) { - GSList *inner_list, *temp_inner_list; - - inner_list = (GSList *)temp_list->data; - for (temp_inner_list = inner_list; temp_inner_list != NULL; - temp_inner_list = temp_inner_list->next) { - g_free ((char *)temp_inner_list->data); - } - - g_slist_free (inner_list); + GList *node; + + for (node = list; node != NULL; node = node->next) { + nautilus_g_list_free_deep (node->data); } - g_slist_free (list); + g_list_free (list); } @@ -110,12 +103,12 @@ free_tokenized_uri (GSList *list) * each criterin sinlgly linked list is made of the different tokens * of the criterion. */ -static GSList * +static GList * tokenize_uri (const char *string) { const char *temp_string; char **criteria; - GSList *criterion_list; + GList *criterion_list; int i, j; if (string == NULL) { @@ -143,16 +136,16 @@ tokenize_uri (const char *string) i++, temp_string = criteria[i]) { char **tokens; char *token; - GSList *token_list; + GList *token_list; /* split a criterion in different tokens */ token_list = NULL; tokens = g_strsplit (temp_string, " ", 2); for (j = 0, token = tokens[0]; token != NULL; j++, token = tokens[j]) { /* g_strstrip does not return a newly allocated string. */ - token_list = g_slist_append (token_list, g_strdup(g_strstrip (token))); + token_list = g_list_append (token_list, g_strdup (g_strstrip (token))); } - criterion_list = g_slist_append (criterion_list, token_list); + criterion_list = g_list_append (criterion_list, token_list); g_strfreev (tokens); } g_strfreev (criteria); @@ -581,7 +574,7 @@ get_item_number (field_criterion_item *current_table, char *item) * Returns a translated string for a given criterion uri. */ static char * -get_translated_criterion (const GSList *criterion) +get_translated_criterion (GList *criterion) { int item_number, value_item_number; @@ -590,7 +583,7 @@ get_translated_criterion (const GSList *criterion) char *ret_val; /* make sure we got a valid criterion */ - if (g_slist_length ((GSList *) criterion) != 3) { + if (g_list_length (criterion) != 3) { return NULL; } @@ -650,14 +643,14 @@ get_translated_criterion (const GSList *criterion) /** * get_nth_criterion_prefix: - * @criterion: The GSList whose data field points to the criterion GSList. + * @criterion: The GList whose data field points to the criterion GList. * * calculates the "," or "and" prefix for any criterion. * * return value: the translated prefix. */ static char * -get_nth_criterion_prefix (GSList *criterion) +get_nth_criterion_prefix (GList *criterion) { /* if we are the last criterion, put it here. */ @@ -676,7 +669,7 @@ get_nth_criterion_prefix (GSList *criterion) static char * parse_uri (const char *search_uri) { - GSList *criteria, *criterion; + GList *criteria, *criterion; char *translated_criterion, *translated_prefix; char *ret_val, *temp; @@ -686,7 +679,7 @@ parse_uri (const char *search_uri) } /* processes the first criterion and add the necessary "whose" prefix */ - translated_criterion = get_translated_criterion ((GSList *)criteria->data); + translated_criterion = get_translated_criterion ((GList *)criteria->data); if (translated_criterion == NULL) { free_tokenized_uri (criteria); return NULL; @@ -697,7 +690,7 @@ parse_uri (const char *search_uri) /* processes the other criteria and add the necessary "and" prefixes */ for (criterion = criteria->next; criterion != NULL; criterion = criterion->next) { - translated_criterion = get_translated_criterion ((const GSList *)criterion->data); + translated_criterion = get_translated_criterion (criterion->data); if (translated_criterion == NULL) { g_free (ret_val); free_tokenized_uri (criteria); diff --git a/libnautilus-extensions/nautilus-view-identifier.c b/libnautilus-extensions/nautilus-view-identifier.c index 6209bd452..587af3a9c 100644 --- a/libnautilus-extensions/nautilus-view-identifier.c +++ b/libnautilus-extensions/nautilus-view-identifier.c @@ -124,8 +124,7 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char view_as_name = server->iid; } - g_slist_foreach (langs, (GFunc)g_free, NULL); - g_slist_free (langs); + nautilus_g_slist_free_deep (langs); /* if the name is an OAFIID, clean it up for display */ if (nautilus_str_has_prefix (view_as_name, "OAFIID:")) { diff --git a/libnautilus-private/nautilus-directory-metafile.c b/libnautilus-private/nautilus-directory-metafile.c index 73ea314d8..f7cb427c7 100644 --- a/libnautilus-private/nautilus-directory-metafile.c +++ b/libnautilus-private/nautilus-directory-metafile.c @@ -86,7 +86,7 @@ create_metafile_root (NautilusDirectory *directory) } root = xmlDocGetRootElement (directory->details->metafile); if (root == NULL) { - root = xmlNewDocNode (directory->details->metafile, NULL, "DIRECTORY", NULL); + root = xmlNewDocNode (directory->details->metafile, NULL, "directory", NULL); xmlDocSetRootElement (directory->details->metafile, root); } @@ -111,8 +111,8 @@ get_file_node (NautilusDirectory *directory, if (create) { root = create_metafile_root (directory); - node = xmlNewChild (root, NULL, "FILE", NULL); - xmlSetProp (node, "NAME", file_name); + node = xmlNewChild (root, NULL, "file", NULL); + xmlSetProp (node, "name", file_name); g_hash_table_insert (hash, xmlMemStrdup (file_name), node); return node; } @@ -650,7 +650,7 @@ nautilus_directory_rename_file_metadata (NautilusDirectory *directory, xmlFree (key); g_hash_table_insert (hash, xmlMemStrdup (new_file_name), value); - xmlSetProp (file_node, "NAME", new_file_name); + xmlSetProp (file_node, "name", new_file_name); nautilus_directory_request_write_metafile (directory); } } else { @@ -872,7 +872,7 @@ nautilus_directory_copy_file_metadata (NautilusDirectory *source_directory, node = xmlCopyNode (source_node, TRUE); root = create_metafile_root (destination_directory); xmlAddChild (root, node); - xmlSetProp (node, "NAME", destination_file_name); + xmlSetProp (node, "name", destination_file_name); g_hash_table_insert (destination_directory->details->metafile_node_hash, xmlMemStrdup (destination_file_name), node); } else { @@ -972,8 +972,8 @@ nautilus_directory_set_metafile_contents (NautilusDirectory *directory, hash = directory->details->metafile_node_hash; for (node = nautilus_xml_get_root_children (metafile_contents); node != NULL; node = node->next) { - if (strcmp (node->name, "FILE") == 0) { - name = xmlGetProp (node, "NAME"); + if (strcmp (node->name, "file") == 0) { + name = xmlGetProp (node, "name"); if (g_hash_table_lookup (hash, name) != NULL) { xmlFree (name); /* FIXME: Should we delete duplicate nodes as we discover them? */ diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c index 81dea28df..ef38ab361 100644 --- a/libnautilus-private/nautilus-directory.c +++ b/libnautilus-private/nautilus-directory.c @@ -1498,23 +1498,23 @@ nautilus_self_check_directory (void) gtk_main_iteration (); } - nautilus_file_set_metadata (file, "TEST", "default", "value"); - NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_metadata (file, "TEST", "default"), "value"); - - nautilus_file_set_boolean_metadata (file, "TEST_BOOLEAN", TRUE, TRUE); - NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (file, "TEST_BOOLEAN", TRUE), TRUE); - nautilus_file_set_boolean_metadata (file, "TEST_BOOLEAN", TRUE, FALSE); - NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (file, "TEST_BOOLEAN", TRUE), FALSE); - NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (NULL, "TEST_BOOLEAN", TRUE), TRUE); - - nautilus_file_set_integer_metadata (file, "TEST_INTEGER", 0, 17); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "TEST_INTEGER", 0), 17); - nautilus_file_set_integer_metadata (file, "TEST_INTEGER", 0, -1); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "TEST_INTEGER", 0), -1); - nautilus_file_set_integer_metadata (file, "TEST_INTEGER", 42, 42); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "TEST_INTEGER", 42), 42); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (NULL, "TEST_INTEGER", 42), 42); - NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "NONEXISTENT_KEY", 42), 42); + nautilus_file_set_metadata (file, "test", "default", "value"); + NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_metadata (file, "test", "default"), "value"); + + nautilus_file_set_boolean_metadata (file, "test_boolean", TRUE, TRUE); + NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (file, "test_boolean", TRUE), TRUE); + nautilus_file_set_boolean_metadata (file, "test_boolean", TRUE, FALSE); + NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (file, "test_boolean", TRUE), FALSE); + NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get_boolean_metadata (NULL, "test_boolean", TRUE), TRUE); + + nautilus_file_set_integer_metadata (file, "test_integer", 0, 17); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "test_integer", 0), 17); + nautilus_file_set_integer_metadata (file, "test_integer", 0, -1); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "test_integer", 0), -1); + nautilus_file_set_integer_metadata (file, "test_integer", 42, 42); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "test_integer", 42), 42); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (NULL, "test_integer", 42), 42); + NAUTILUS_CHECK_INTEGER_RESULT (nautilus_file_get_integer_metadata (file, "nonexistent_key", 42), 42); NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_directory_get ("file:///etc") == directory, TRUE); nautilus_directory_unref (directory); @@ -1569,7 +1569,7 @@ nautilus_self_check_directory (void) file = nautilus_file_get ("file:///etc/passwd"); - NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_metadata (file, "TEST", "default"), "value"); + NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_metadata (file, "test", "default"), "value"); nautilus_file_unref (file); diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c index f913bd749..aa24a27f9 100644 --- a/libnautilus-private/nautilus-file.c +++ b/libnautilus-private/nautilus-file.c @@ -3862,7 +3862,7 @@ nautilus_file_get_keywords (NautilusFile *file) /* Put all the keywords into a list. */ keywords = nautilus_file_get_metadata_list - (file, "KEYWORD", "NAME"); + (file, "keyword", "name"); return sort_keyword_list_and_remove_duplicates (keywords); } @@ -3885,7 +3885,7 @@ nautilus_file_set_keywords (NautilusFile *file, GList *keywords) canonical_keywords = sort_keyword_list_and_remove_duplicates (g_list_copy (keywords)); nautilus_file_set_metadata_list - (file, "KEYWORD", "NAME", canonical_keywords); + (file, "keyword", "name", canonical_keywords); g_list_free (canonical_keywords); } diff --git a/libnautilus-private/nautilus-gconf-extensions.c b/libnautilus-private/nautilus-gconf-extensions.c index cd1513071..15b92e229 100644 --- a/libnautilus-private/nautilus-gconf-extensions.c +++ b/libnautilus-private/nautilus-gconf-extensions.c @@ -25,13 +25,11 @@ #include <config.h> #include "nautilus-gconf-extensions.h" -#include <gconf/gconf.h> +#include "nautilus-glib-extensions.h" +#include "nautilus-stock-dialogs.h" #include <gconf/gconf-client.h> - -#include <libgnome/gnome-defs.h> +#include <gconf/gconf.h> #include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-dialog.h> -#include <libgnomeui/gnome-dialog-util.h> static GConfClient *global_gconf_client = NULL; @@ -73,24 +71,22 @@ nautilus_gconf_client_get_global (void) gboolean nautilus_gconf_handle_error (GError **error) { + char *message; static gboolean shown_dialog = FALSE; g_return_val_if_fail (error != NULL, FALSE); if (*error != NULL) { g_warning (_("GConf error:\n %s"), (*error)->message); - if ( ! shown_dialog) { - char *message; - GtkWidget *dialog; - + if (! shown_dialog) { shown_dialog = TRUE; message = g_strdup_printf (_("GConf error:\n %s\n" "All further errors shown " "only on terminal"), (*error)->message); - - dialog = gnome_error_dialog (message); + nautilus_show_error_dialog (message, _("GConf Error"), NULL); + g_free (message); } g_error_free (*error); *error = NULL; @@ -214,37 +210,47 @@ nautilus_gconf_get_string (const char *key) void nautilus_gconf_set_string_list (const char *key, - GSList *string_list_value) + GList *string_list_value) { GConfClient *client; - GError *error = NULL; + GError *error; + GSList *slist; g_return_if_fail (key != NULL); client = nautilus_gconf_client_get_global (); g_return_if_fail (client != NULL); - gconf_client_set_list (client, key, GCONF_VALUE_STRING, string_list_value, &error); + slist = nautilus_g_slist_from_g_list (string_list_value); + + error = NULL; + gconf_client_set_list (client, key, GCONF_VALUE_STRING, slist, &error); nautilus_gconf_handle_error (&error); + + g_slist_free (slist); } -GSList * +GList * nautilus_gconf_get_string_list (const char *key) { - GSList *result; + GSList *slist; + GList *result; GConfClient *client; - GError *error = NULL; + GError *error; g_return_val_if_fail (key != NULL, NULL); client = nautilus_gconf_client_get_global (); g_return_val_if_fail (client != NULL, NULL); - result = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error); - + error = NULL; + slist = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error); if (nautilus_gconf_handle_error (&error)) { - result = NULL; + slist = NULL; } + + result = nautilus_g_list_from_g_slist (slist); + g_slist_free (slist); return result; } diff --git a/libnautilus-private/nautilus-gconf-extensions.h b/libnautilus-private/nautilus-gconf-extensions.h index b5901bf5f..a9393feb4 100644 --- a/libnautilus-private/nautilus-gconf-extensions.h +++ b/libnautilus-private/nautilus-gconf-extensions.h @@ -31,23 +31,23 @@ BEGIN_GNOME_DECLS -GConfClient *nautilus_gconf_client_get_global (void); -gboolean nautilus_gconf_handle_error (GError **error); -void nautilus_gconf_set_boolean (const char *key, - gboolean boolean_value); -gboolean nautilus_gconf_get_boolean (const char *key); -int nautilus_gconf_get_integer (const char *key); -void nautilus_gconf_set_integer (const char *key, - int int_value); -char *nautilus_gconf_get_string (const char *key); -void nautilus_gconf_set_string (const char *key, - const char *string_value); -GSList *nautilus_gconf_get_string_list (const char *key); -void nautilus_gconf_set_string_list (const char *key, - GSList *string_list_value); -gboolean nautilus_gconf_is_default (const char *key); -gboolean nautilus_gconf_monitor_directory (const char *directory); -void nautilus_gconf_suggest_sync (void); +GConfClient *nautilus_gconf_client_get_global (void); +gboolean nautilus_gconf_handle_error (GError **error); +void nautilus_gconf_set_boolean (const char *key, + gboolean boolean_value); +gboolean nautilus_gconf_get_boolean (const char *key); +int nautilus_gconf_get_integer (const char *key); +void nautilus_gconf_set_integer (const char *key, + int int_value); +char * nautilus_gconf_get_string (const char *key); +void nautilus_gconf_set_string (const char *key, + const char *string_value); +GList * nautilus_gconf_get_string_list (const char *key); +void nautilus_gconf_set_string_list (const char *key, + GList *string_list_value); +gboolean nautilus_gconf_is_default (const char *key); +gboolean nautilus_gconf_monitor_directory (const char *directory); +void nautilus_gconf_suggest_sync (void); END_GNOME_DECLS diff --git a/libnautilus-private/nautilus-glib-extensions.c b/libnautilus-private/nautilus-glib-extensions.c index c0660dbec..8b4b5e09c 100644 --- a/libnautilus-private/nautilus-glib-extensions.c +++ b/libnautilus-private/nautilus-glib-extensions.c @@ -997,9 +997,12 @@ nautilus_shell_quote (const char *string) return quoted_str; } -int nautilus_g_round (double d) +int +nautilus_round (double d) { - double val = floor (d + .5); + double val; + + val = floor (d + .5); /* The tests are needed because the result of floating-point to integral * conversion is undefined if the floating point value is not representable @@ -1012,6 +1015,32 @@ int nautilus_g_round (double d) return val; } +GList * +nautilus_g_list_from_g_slist (GSList *slist) +{ + GList *list; + GSList *node; + + list = NULL; + for (node = slist; node != NULL; node = node->next) { + list = g_list_prepend (list, node->data); + } + return g_list_reverse (list); +} + +GSList * +nautilus_g_slist_from_g_list (GList *list) +{ + GSList *slist; + GList *node; + + slist = NULL; + for (node = list; node != NULL; node = node->next) { + slist = g_slist_prepend (slist, node->data); + } + return g_slist_reverse (slist); +} + #if !defined (NAUTILUS_OMIT_SELF_CHECK) static void diff --git a/libnautilus-private/nautilus-glib-extensions.h b/libnautilus-private/nautilus-glib-extensions.h index 2ba84b70a..ea15e1e91 100644 --- a/libnautilus-private/nautilus-glib-extensions.h +++ b/libnautilus-private/nautilus-glib-extensions.h @@ -75,19 +75,22 @@ GList * nautilus_g_list_partition (GList NautilusPredicateFunction predicate, gpointer user_data, GList **removed); -void nautilus_g_list_free_deep_custom (GList *list, - GFunc element_free_func, - gpointer user_data); /* List functions for lists of g_free'able objects. */ void nautilus_g_list_free_deep (GList *list); -void nautilus_g_slist_free_deep_custom (GSList *list, +void nautilus_g_list_free_deep_custom (GList *list, GFunc element_free_func, gpointer user_data); +/* GSList functions. */ +GList * nautilus_g_list_from_g_slist (GSList *list); +GSList * nautilus_g_slist_from_g_list (GList *list); + /* List functions for slists of g_free'able objects. */ void nautilus_g_slist_free_deep (GSList *list); - +void nautilus_g_slist_free_deep_custom (GSList *list, + GFunc element_free_func, + gpointer user_data); /* List functions for lists of C strings. */ gboolean nautilus_g_str_list_equal (GList *str_list_a, @@ -143,6 +146,6 @@ gint64 nautilus_get_system_time (void); char * nautilus_shell_quote (const char *string); /* math */ -int nautilus_g_round (double d); +int nautilus_round (double d); #endif /* NAUTILUS_GLIB_EXTENSIONS_H */ diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index d8431f784..1435e9481 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -1508,12 +1508,17 @@ start_rubberbanding (NautilusIconContainer *container, event->x, event->y, &band_info->start_x, &band_info->start_y); + /* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ if (GNOME_CANVAS(container)->aa) { - fill_color_str = nautilus_theme_get_theme_data ("directory", "SELECTION_BOX_COLOR_RGBA"); + /* FIXME: Should use some standard format, not just a 32-bit integer. */ + fill_color_str = nautilus_theme_get_theme_data ("directory", "selection_box_color_rgba"); if (fill_color_str == NULL) { - fill_color = 0x77bbdd40; + fill_color = 0x77BBDD40; } else { fill_color = strtoul (fill_color_str, NULL, 0); + /* FIXME: Need error handling here. */ g_free (fill_color_str); } @@ -1533,7 +1538,7 @@ start_rubberbanding (NautilusIconContainer *container, NULL); } else { - fill_color_str = nautilus_theme_get_theme_data ("directory", "SELECTION_BOX_COLOR"); + fill_color_str = nautilus_theme_get_theme_data ("directory", "selection_box_color"); if (fill_color_str == NULL) { fill_color_str = g_strdup ("rgb:7777/BBBB/DDDD"); } @@ -2282,6 +2287,9 @@ destroy (GtkObject *object) gdk_pixbuf_unref (container->details->highlight_frame); } + /* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME, nautilus_icon_container_theme_changed, container); @@ -3265,7 +3273,7 @@ nautilus_icon_container_initialize (NautilusIconContainer *container) /* Set up DnD. */ nautilus_icon_dnd_init (container, stipple); - /* Make sure that we find out if the theme changes. */ + /* Make sure that we find out if the icons change. */ gtk_signal_connect_object_while_alive (nautilus_icon_factory_get (), "icons_changed", @@ -3284,7 +3292,9 @@ nautilus_icon_container_initialize (NautilusIconContainer *container) gtk_signal_connect (GTK_OBJECT (container), "focus-out-event", handle_focus_out_event, NULL); - + /* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ /* read in theme-dependent data */ nautilus_icon_container_theme_changed (container); nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_THEME, nautilus_icon_container_theme_changed, container); @@ -4928,8 +4938,11 @@ update_label_color (NautilusBackground *background, g_assert (NAUTILUS_IS_BACKGROUND (background)); g_assert (NAUTILUS_IS_ICON_CONTAINER (container)); + /* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ /* read the info colors from the current theme; use a reasonable default if undefined */ - light_info_color = nautilus_theme_get_theme_data ("directory", "LIGHT_INFO_COLOR"); + light_info_color = nautilus_theme_get_theme_data ("directory", "light_info_color"); if (light_info_color == NULL) { light_info_value = 0xAAAAFD; } else { @@ -4937,7 +4950,7 @@ update_label_color (NautilusBackground *background, g_free (light_info_color); } - dark_info_color = nautilus_theme_get_theme_data ("directory", "DARK_INFO_COLOR"); + dark_info_color = nautilus_theme_get_theme_data ("directory", "dark_info_color"); if (dark_info_color == NULL) { dark_info_value = 0x33337F; } else { @@ -4976,6 +4989,9 @@ nautilus_icon_container_set_is_fixed_size (NautilusIconContainer *container, /* handle theme changes */ +/* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here. + * The NautilusIconContainer class should simply provide calls to set the colors. + */ static void nautilus_icon_container_theme_changed (gpointer user_data) { @@ -4994,7 +5010,7 @@ nautilus_icon_container_theme_changed (gpointer user_data) g_free (text_frame_path); /* load the highlight color */ - highlight_color_str = nautilus_theme_get_theme_data ("directory", "HIGHLIGHT_COLOR_RGBA"); + highlight_color_str = nautilus_theme_get_theme_data ("directory", "highlight_color_rgba"); if (highlight_color_str == NULL) { container->details->highlight_color = NAUTILUS_RGBA_COLOR_PACK (0, 0, 0, 102); diff --git a/libnautilus-private/nautilus-icon-factory.c b/libnautilus-private/nautilus-icon-factory.c index b039fad56..9be2faeae 100644 --- a/libnautilus-private/nautilus-icon-factory.c +++ b/libnautilus-private/nautilus-icon-factory.c @@ -731,7 +731,7 @@ set_theme (const char *theme_name) /* now set up the default theme */ g_free (factory->default_theme_name); - factory->default_theme_name = nautilus_theme_get_theme_data ("icon-images", "DEFAULT_THEME"); + factory->default_theme_name = nautilus_theme_get_theme_data ("icon-images", "default_theme"); check_local_theme (factory->default_theme_name, &factory->local_default_theme); /* we changed the theme, so emit the icons_changed signal */ @@ -978,10 +978,10 @@ get_themed_icon_file_path (const char *theme_name, size_as_string = g_strdup_printf ("%u", icon_size); node = nautilus_xml_get_root_child_by_name_and_property - (doc, "ICON", "SIZE", size_as_string); + (doc, "icon", "size", size_as_string); g_free (size_as_string); - property = xmlGetProp (node, "EMBEDDED_TEXT_RECTANGLE"); + property = xmlGetProp (node, "embedded_text_rectangle"); if (property != NULL) { if (sscanf (property, @@ -995,7 +995,7 @@ get_themed_icon_file_path (const char *theme_name, xmlFree (property); } - property = xmlGetProp (node, "ATTACH_POINTS"); + property = xmlGetProp (node, "attach_points"); parse_attach_points (&details->attach_points, property); xmlFree (property); @@ -1115,7 +1115,7 @@ icon_theme_changed_callback (gpointer user_data) * long run, we sould just get rid of the user preference. */ theme_preference = nautilus_preferences_get (NAUTILUS_PREFERENCES_THEME); - icon_theme = nautilus_theme_get_theme_data ("icons", "ICON_THEME"); + icon_theme = nautilus_theme_get_theme_data ("icons", "icon_theme"); set_theme (icon_theme == NULL ? theme_preference : icon_theme); diff --git a/libnautilus-private/nautilus-icon-text-item.c b/libnautilus-private/nautilus-icon-text-item.c index e9390b859..ac4b95a3e 100644 --- a/libnautilus-private/nautilus-icon-text-item.c +++ b/libnautilus-private/nautilus-icon-text-item.c @@ -271,10 +271,10 @@ iti_destroy (GtkObject *object) /* Queue redraw of bounding box */ gnome_canvas_request_redraw (item->canvas, - nautilus_g_round (item->x1), - nautilus_g_round (item->y1), - nautilus_g_round (item->x2), - nautilus_g_round (item->y2)); + nautilus_round (item->x1), + nautilus_round (item->y1), + nautilus_round (item->x2), + nautilus_round (item->y2)); /* Free everything */ if (iti->font) @@ -373,16 +373,16 @@ iti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) (* parent_class->update) (item, affine, clip_path, flags); gnome_canvas_request_redraw (item->canvas, - nautilus_g_round (item->x1), - nautilus_g_round (item->y1), - nautilus_g_round (item->x2), - nautilus_g_round (item->y2)); + nautilus_round (item->x1), + nautilus_round (item->y1), + nautilus_round (item->x2), + nautilus_round (item->y2)); recompute_bounding_box (iti); gnome_canvas_request_redraw (item->canvas, - nautilus_g_round (item->x1), - nautilus_g_round (item->y1), - nautilus_g_round (item->x2), - nautilus_g_round (item->y2)); + nautilus_round (item->x1), + nautilus_round (item->y1), + nautilus_round (item->x2), + nautilus_round (item->y2)); } /* utility to fetch a color from a theme */ @@ -437,9 +437,9 @@ iti_paint_text (Iti *iti, GdkDrawable *drawable, int x, int y) bsgc = style->bg_gc [GTK_STATE_SELECTED]; /* fetch the colors from the theme */ - fetch_themed_color ("HIGHLIGHT_BACKGROUND_COLOR", &highlight_background_color); - fetch_themed_color ("HIGHLIGHT_TEXT_COLOR", &highlight_text_color); - fetch_themed_color ("TEXT_FILL_COLOR", &fill_color); + fetch_themed_color ("highlight_background_color", &highlight_background_color); + fetch_themed_color ("highlight_text_color", &highlight_text_color); + fetch_themed_color ("text_fill_color", &fill_color); /* Set up user defined colors */ canvas_item = GNOME_CANVAS_ITEM (iti); @@ -569,11 +569,11 @@ iti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int update iti = ITI (item); - width = nautilus_g_round (item->x2 - item->x1); - height = nautilus_g_round (item->y2 - item->y1); + width = nautilus_round (item->x2 - item->x1); + height = nautilus_round (item->y2 - item->y1); - xofs = nautilus_g_round (item->x1) - x; - yofs = nautilus_g_round (item->y1) - y; + xofs = nautilus_round (item->x1) - x; + yofs = nautilus_round (item->y1) - y; style = GTK_WIDGET (item->canvas)->style; @@ -655,8 +655,8 @@ iti_render (GnomeCanvasItem *item, GnomeCanvasBuf *buffer) visual = gdk_visual_get_system (); art_affine_identity(affine); - width = nautilus_g_round (item->x2 - item->x1); - height = nautilus_g_round (item->y2 - item->y1); + width = nautilus_round (item->x2 - item->x1); + height = nautilus_round (item->y2 - item->y1); /* allocate a pixmap to draw the text into, and clear it to white */ pixmap = gdk_pixmap_new (NULL, width, height, visual->depth); @@ -671,7 +671,7 @@ iti_render (GnomeCanvasItem *item, GnomeCanvasBuf *buffer) gdk_gc_unref (gc); /* use a common routine to draw the label into the pixmap */ - iti_draw (item, pixmap, nautilus_g_round (item->x1), nautilus_g_round (item->y1), width, height); + iti_draw (item, pixmap, nautilus_round (item->x1), nautilus_round (item->y1), width, height); /* turn it into a pixbuf */ colormap = gdk_colormap_new (visual, FALSE); @@ -686,7 +686,7 @@ iti_render (GnomeCanvasItem *item, GnomeCanvasBuf *buffer) gdk_pixmap_unref (pixmap); /* draw the pixbuf containing the label */ - draw_pixbuf_aa (text_pixbuf, buffer, affine, nautilus_g_round (item->x1), nautilus_g_round (item->y1)); + draw_pixbuf_aa (text_pixbuf, buffer, affine, nautilus_round (item->x1), nautilus_round (item->y1)); gdk_pixbuf_unref (text_pixbuf); buffer->is_bg = FALSE; @@ -1025,8 +1025,8 @@ iti_event (GnomeCanvasItem *item, GdkEvent *event) if (event->button.button == 1) { gnome_canvas_w2c_d (item->canvas, event->button.x, event->button.y, &cx, &cy); idx = iti_idx_from_x_y (iti, - nautilus_g_round (cx - (item->x1 + MARGIN_X)), - nautilus_g_round (cy - (item->y1 + MARGIN_Y))); + nautilus_round (cx - (item->x1 + MARGIN_X)), + nautilus_round (cy - (item->y1 + MARGIN_Y))); iti_start_selecting (iti, idx, event->button.time); } return TRUE; @@ -1038,8 +1038,8 @@ iti_event (GnomeCanvasItem *item, GdkEvent *event) gtk_widget_event (GTK_WIDGET (priv->entry), event); gnome_canvas_w2c_d (item->canvas, event->button.x, event->button.y, &cx, &cy); idx = iti_idx_from_x_y (iti, - nautilus_g_round (cx - (item->x1 + MARGIN_X)), - nautilus_g_round (cy - (item->y1 + MARGIN_Y))); + nautilus_round (cx - (item->x1 + MARGIN_X)), + nautilus_round (cy - (item->y1 + MARGIN_Y))); iti_selection_motion (iti, idx); return TRUE; diff --git a/libnautilus-private/nautilus-link-set.c b/libnautilus-private/nautilus-link-set.c index 9806fa707..05383e8a8 100644 --- a/libnautilus-private/nautilus-link-set.c +++ b/libnautilus-private/nautilus-link-set.c @@ -56,16 +56,16 @@ create_new_link (const char *directory_path, const char *name, const char *image output_document = xmlNewDoc ("1.0"); /* add the root node to the output document */ - root_node = xmlNewDocNode (output_document, NULL, "NAUTILUS_OBJECT", NULL); + root_node = xmlNewDocNode (output_document, NULL, "nautilus_object", NULL); xmlDocSetRootElement (output_document, root_node); /* Add mime magic string so that the mime sniffer can recognize us. * Note: The value of the tag has no meaning. */ - xmlSetProp (root_node, "NAUTILUS_LINK", "Nautilus Link"); + xmlSetProp (root_node, "nautilus_link", "Nautilus Link"); /* Add link and custom icon tags */ - xmlSetProp (root_node, "CUSTOM_ICON", image); - xmlSetProp (root_node, "LINK", uri); + xmlSetProp (root_node, "custom_icon", image); + xmlSetProp (root_node, "link", uri); /* all done, so save the xml document as a link file */ file_name = nautilus_make_path (directory_path, name); diff --git a/libnautilus-private/nautilus-link.c b/libnautilus-private/nautilus-link.c index 1463d2aef..2b5cb80b5 100644 --- a/libnautilus-private/nautilus-link.c +++ b/libnautilus-private/nautilus-link.c @@ -117,16 +117,16 @@ nautilus_link_local_create (const char *directory_path, output_document = xmlNewDoc ("1.0"); /* add the root node to the output document */ - root_node = xmlNewDocNode (output_document, NULL, "NAUTILUS_OBJECT", NULL); + root_node = xmlNewDocNode (output_document, NULL, "nautilus_object", NULL); xmlDocSetRootElement (output_document, root_node); /* Add mime magic string so that the mime sniffer can recognize us. * Note: The value of the tag identfies what type of link this. */ - xmlSetProp (root_node, "NAUTILUS_LINK", get_tag (type)); + xmlSetProp (root_node, "nautilus_link", get_tag (type)); /* Add link and custom icon tags */ - xmlSetProp (root_node, "CUSTOM_ICON", image); - xmlSetProp (root_node, "LINK", target_uri); + xmlSetProp (root_node, "custom_icon", image); + xmlSetProp (root_node, "link", target_uri); /* all done, so save the xml document as a link file */ path = nautilus_make_path (directory_path, name); @@ -269,7 +269,7 @@ gboolean nautilus_link_local_set_link_uri (const char *path, const char *link_uri) { return local_set_root_property (path, - "LINK", + "link", link_uri, forget_file_activation_uri); } @@ -279,7 +279,7 @@ nautilus_link_local_set_type (const char *path, NautilusLinkType type) { return local_set_root_property (path, - "NAUTILUS_LINK", + "nautilus_link", get_tag (type), NULL); } @@ -428,18 +428,18 @@ nautilus_link_local_get_image_uri (const char *path) char * nautilus_link_local_get_link_uri (const char *path) { - return local_get_root_property (path, "LINK"); + return local_get_root_property (path, "link"); } /* Returns the link type of the link file. */ NautilusLinkType nautilus_link_local_get_link_type (const char *path) { - return get_link_type (local_get_root_property (path, "NAUTILUS_LINK")); + return get_link_type (local_get_root_property (path, "nautilus_link")); } /* FIXME bugzilla.eazel.com 2495: - * Caller has to know to pass in a file with a NULL character at the end. + * Caller has to know to pass in a file with a NUL character at the end. */ char * nautilus_link_get_link_uri_given_file_contents (const char *file_contents, @@ -449,7 +449,7 @@ nautilus_link_get_link_uri_given_file_contents (const char *file_contents, char *property; doc = xmlParseMemory ((char *) file_contents, file_size); - property = xml_get_root_property (doc, "LINK"); + property = xml_get_root_property (doc, "link"); xmlFreeDoc (doc); return property; } diff --git a/libnautilus-private/nautilus-metadata.h b/libnautilus-private/nautilus-metadata.h index 3de64b564..00f96a2da 100644 --- a/libnautilus-private/nautilus-metadata.h +++ b/libnautilus-private/nautilus-metadata.h @@ -31,49 +31,49 @@ /* Per-file */ -#define NAUTILUS_METADATA_KEY_CONTENT_VIEWS "CONTENT_VIEWS" +#define NAUTILUS_METADATA_KEY_CONTENT_VIEWS "content_views" -#define NAUTILUS_METADATA_KEY_DEFAULT_ACTION_TYPE "DEFAULT_ACTION_TYPE" -#define NAUTILUS_METADATA_KEY_DEFAULT_APPLICATION "DEFAULT_APPLICATION" -#define NAUTILUS_METADATA_KEY_DEFAULT_COMPONENT "DEFAULT_COMPONENT" -#define NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_ADD "SHORT_LIST_APPLICATION_ADD" -#define NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_REMOVE "SHORT_LIST_APPLICATION_REMOVE" -#define NAUTILUS_METADATA_KEY_EXPLICIT_APPLICATION "APPLICATION" -#define NAUTILUS_METADATA_SUBKEY_APPLICATION_ID "ID" -#define NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_ADD "SHORT_LIST_COMPONENT_ADD" -#define NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_REMOVE "SHORT_LIST_COMPONENT_REMOVE" -#define NAUTILUS_METADATA_KEY_EXPLICIT_COMPONENT "EXPLICIT_CONTENT_VIEW" -#define NAUTILUS_METADATA_SUBKEY_COMPONENT_IID "IID" +#define NAUTILUS_METADATA_KEY_DEFAULT_ACTION_TYPE "default_action_type" +#define NAUTILUS_METADATA_KEY_DEFAULT_APPLICATION "default_application" +#define NAUTILUS_METADATA_KEY_DEFAULT_COMPONENT "default_component" +#define NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_ADD "short_list_application_add" +#define NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_REMOVE "short_list_application_remove" +#define NAUTILUS_METADATA_KEY_EXPLICIT_APPLICATION "application" +#define NAUTILUS_METADATA_SUBKEY_APPLICATION_ID "id" +#define NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_ADD "short_list_component_add" +#define NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_REMOVE "short_list_component_remove" +#define NAUTILUS_METADATA_KEY_EXPLICIT_COMPONENT "explicit_content_view" +#define NAUTILUS_METADATA_SUBKEY_COMPONENT_IID "iid" -#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR "BACKGROUND_COLOR" -#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE "BACKGROUND_TILE_IMAGE" +#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR "background_color" +#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE "background_tile_image" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL "ICONS_ZOOM_LEVEL" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT "ICONS_AUTO_LAYOUT" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_TIGHTER_LAYOUT "ICONS_TIGHTER_LAYOUT" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY "ICONS_SORT_BY" -#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED "ICONS_SORT_REVERSED" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL "icon_view_zoom_level" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT "icon_view_auto_layout" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_TIGHTER_LAYOUT "icon_view_tighter_layout" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY "icon_view_sort_by" +#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED "icon_view_sort_reversed" -#define NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL "LIST_ZOOM_LEVEL" -#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN "LIST_SORT_COLUMN" -#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED "LIST_SORT_REVERSED" +#define NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL "list_view_zoom_level" +#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN "list_view_sort_column" +#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED "list_view_sort_reversed" -#define NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY "WINDOW_GEOMETRY" +#define NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY "window_geometry" -#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR "SIDEBAR_BACKGROUND_COLOR" -#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE "SIDEBAR_BACKGROUND_TILE_IMAGE" -#define NAUTILUS_METADATA_KEY_SIDEBAR_BUTTONS "SIDEBAR_BUTTONS" -#define NAUTILUS_METADATA_KEY_SIDEBAR_TAB_COLOR "SIDEBAR_TAB_COLOR" -#define NAUTILUS_METADATA_KEY_SIDEBAR_TITLE_TAB_COLOR "SIDEBAR_TITLE_TAB_COLOR" +#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR "sidebar_background_color" +#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE "sidebar_background_tile_image" +#define NAUTILUS_METADATA_KEY_SIDEBAR_BUTTONS "sidebar_buttons" +#define NAUTILUS_METADATA_KEY_SIDEBAR_TAB_COLOR "sidebar_tab_color" +#define NAUTILUS_METADATA_KEY_SIDEBAR_TITLE_TAB_COLOR "sidebar_title_tab_color" -#define NAUTILUS_METADATA_KEY_NOTES "NOTES" -#define NAUTILUS_METADATA_KEY_ANNOTATION "ANNOTATION" -#define NAUTILUS_METADATA_KEY_ICON_POSITION "ICON_POSITION" -#define NAUTILUS_METADATA_KEY_ICON_SCALE "ICON_SCALE" -#define NAUTILUS_METADATA_KEY_CUSTOM_ICON "CUSTOM_ICON" +#define NAUTILUS_METADATA_KEY_NOTES "notes" +#define NAUTILUS_METADATA_KEY_ANNOTATION "annotation" +#define NAUTILUS_METADATA_KEY_ICON_POSITION "icon_position" +#define NAUTILUS_METADATA_KEY_ICON_SCALE "icon_scale" +#define NAUTILUS_METADATA_KEY_CUSTOM_ICON "custom_icon" /* per link file */ -#define NAUTILUS_METADATA_KEY_EXTRA_TEXT "EXTRA_TEXT" +#define NAUTILUS_METADATA_KEY_EXTRA_TEXT "extra_text" #endif /* NAUTILUS_METADATA_H */ diff --git a/libnautilus-private/nautilus-preferences.c b/libnautilus-private/nautilus-preferences.c index eb8e636d0..f76a2b4f6 100644 --- a/libnautilus-private/nautilus-preferences.c +++ b/libnautilus-private/nautilus-preferences.c @@ -513,7 +513,7 @@ nautilus_preferences_get (const char *name) void nautilus_preferences_set_string_list (const char *name, - GSList *string_list_value) + GList *string_list_value) { char *key; @@ -526,10 +526,10 @@ nautilus_preferences_set_string_list (const char *name, nautilus_gconf_suggest_sync (); } -GSList * +GList * nautilus_preferences_get_string_list (const char *name) { - GSList *result; + GList *result; char *key; g_return_val_if_fail (name != NULL, NULL); @@ -682,7 +682,7 @@ nautilus_preferences_default_get_string (const char *name, void nautilus_preferences_default_set_string_list (const char *name, int user_level, - GSList *string_list_value) + GList *string_list_value) { char *default_key; @@ -693,11 +693,11 @@ nautilus_preferences_default_set_string_list (const char *name, g_free (default_key); } -GSList * +GList * nautilus_preferences_default_get_string_list (const char *name, int user_level) { - GSList *result; + GList *result; char *default_key; g_return_val_if_fail (name != NULL, NULL); diff --git a/libnautilus-private/nautilus-preferences.h b/libnautilus-private/nautilus-preferences.h index 6c61bf30d..a8586e6ec 100644 --- a/libnautilus-private/nautilus-preferences.h +++ b/libnautilus-private/nautilus-preferences.h @@ -2,7 +2,7 @@ /* nautilus-preferences.c - Preference peek/poke/notify interface. - Copyright (C) 1999, 2000 Eazel, Inc. + Copyright (C) 1999, 2000, 2001 Eazel, Inc. The Gnome Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -62,9 +62,9 @@ void nautilus_preferences_set_integer (const char char * nautilus_preferences_get (const char *name); void nautilus_preferences_set (const char *name, const char *string_value); -GSList * nautilus_preferences_get_string_list (const char *name); +GList * nautilus_preferences_get_string_list (const char *name); void nautilus_preferences_set_string_list (const char *name, - GSList *string_list_value); + GList *string_list_value); /* Default values getters and setters */ gboolean nautilus_preferences_default_get_boolean (const char *name, @@ -82,11 +82,11 @@ char * nautilus_preferences_default_get_string (const char void nautilus_preferences_default_set_string (const char *name, int user_level, const char *string_value); -GSList * nautilus_preferences_default_get_string_list (const char *name, +GList * nautilus_preferences_default_get_string_list (const char *name, int user_level); void nautilus_preferences_default_set_string_list (const char *name, int user_level, - GSList *string_list_value); + GList *string_list_value); /* Callbacks */ void nautilus_preferences_add_callback (const char *name, NautilusPreferencesCallback callback, diff --git a/libnautilus-private/nautilus-search-uri.c b/libnautilus-private/nautilus-search-uri.c index 7a7614201..75d8b03b1 100644 --- a/libnautilus-private/nautilus-search-uri.c +++ b/libnautilus-private/nautilus-search-uri.c @@ -27,17 +27,18 @@ /* Must be included before other libgnome headers. */ #include <libgnome/gnome-defs.h> +#include "nautilus-glib-extensions.h" #include "nautilus-lib-self-check-functions.h" #include "nautilus-string.h" #include <libgnome/gnome-i18n.h> #include <libgnomevfs/gnome-vfs-utils.h> -static const char * strip_uri_beginning (const char *location_uri); -static GSList * tokenize_uri (const char *string); -static char * get_translated_criterion (const GSList *criterion); -static char * get_nth_criterion_prefix (GSList *criterion); -static char * parse_uri (const char *search_uri); -static void free_tokenized_uri (GSList *list); +static const char *strip_uri_beginning (const char *location_uri); +static GList * tokenize_uri (const char *string); +static char * get_translated_criterion (GList *criterion); +static char * get_nth_criterion_prefix (GList *criterion); +static char * parse_uri (const char *search_uri); +static void free_tokenized_uri (GList *list); /** * strip_uri_beginning: @@ -79,22 +80,14 @@ strip_uri_beginning (const char *location_uri) * */ static void -free_tokenized_uri (GSList *list) +free_tokenized_uri (GList *list) { - GSList *temp_list; - - for (temp_list = list; temp_list != NULL; temp_list = temp_list->next) { - GSList *inner_list, *temp_inner_list; - - inner_list = (GSList *)temp_list->data; - for (temp_inner_list = inner_list; temp_inner_list != NULL; - temp_inner_list = temp_inner_list->next) { - g_free ((char *)temp_inner_list->data); - } - - g_slist_free (inner_list); + GList *node; + + for (node = list; node != NULL; node = node->next) { + nautilus_g_list_free_deep (node->data); } - g_slist_free (list); + g_list_free (list); } @@ -110,12 +103,12 @@ free_tokenized_uri (GSList *list) * each criterin sinlgly linked list is made of the different tokens * of the criterion. */ -static GSList * +static GList * tokenize_uri (const char *string) { const char *temp_string; char **criteria; - GSList *criterion_list; + GList *criterion_list; int i, j; if (string == NULL) { @@ -143,16 +136,16 @@ tokenize_uri (const char *string) i++, temp_string = criteria[i]) { char **tokens; char *token; - GSList *token_list; + GList *token_list; /* split a criterion in different tokens */ token_list = NULL; tokens = g_strsplit (temp_string, " ", 2); for (j = 0, token = tokens[0]; token != NULL; j++, token = tokens[j]) { /* g_strstrip does not return a newly allocated string. */ - token_list = g_slist_append (token_list, g_strdup(g_strstrip (token))); + token_list = g_list_append (token_list, g_strdup (g_strstrip (token))); } - criterion_list = g_slist_append (criterion_list, token_list); + criterion_list = g_list_append (criterion_list, token_list); g_strfreev (tokens); } g_strfreev (criteria); @@ -581,7 +574,7 @@ get_item_number (field_criterion_item *current_table, char *item) * Returns a translated string for a given criterion uri. */ static char * -get_translated_criterion (const GSList *criterion) +get_translated_criterion (GList *criterion) { int item_number, value_item_number; @@ -590,7 +583,7 @@ get_translated_criterion (const GSList *criterion) char *ret_val; /* make sure we got a valid criterion */ - if (g_slist_length ((GSList *) criterion) != 3) { + if (g_list_length (criterion) != 3) { return NULL; } @@ -650,14 +643,14 @@ get_translated_criterion (const GSList *criterion) /** * get_nth_criterion_prefix: - * @criterion: The GSList whose data field points to the criterion GSList. + * @criterion: The GList whose data field points to the criterion GList. * * calculates the "," or "and" prefix for any criterion. * * return value: the translated prefix. */ static char * -get_nth_criterion_prefix (GSList *criterion) +get_nth_criterion_prefix (GList *criterion) { /* if we are the last criterion, put it here. */ @@ -676,7 +669,7 @@ get_nth_criterion_prefix (GSList *criterion) static char * parse_uri (const char *search_uri) { - GSList *criteria, *criterion; + GList *criteria, *criterion; char *translated_criterion, *translated_prefix; char *ret_val, *temp; @@ -686,7 +679,7 @@ parse_uri (const char *search_uri) } /* processes the first criterion and add the necessary "whose" prefix */ - translated_criterion = get_translated_criterion ((GSList *)criteria->data); + translated_criterion = get_translated_criterion ((GList *)criteria->data); if (translated_criterion == NULL) { free_tokenized_uri (criteria); return NULL; @@ -697,7 +690,7 @@ parse_uri (const char *search_uri) /* processes the other criteria and add the necessary "and" prefixes */ for (criterion = criteria->next; criterion != NULL; criterion = criterion->next) { - translated_criterion = get_translated_criterion ((const GSList *)criterion->data); + translated_criterion = get_translated_criterion (criterion->data); if (translated_criterion == NULL) { g_free (ret_val); free_tokenized_uri (criteria); diff --git a/libnautilus-private/nautilus-view-identifier.c b/libnautilus-private/nautilus-view-identifier.c index 6209bd452..587af3a9c 100644 --- a/libnautilus-private/nautilus-view-identifier.c +++ b/libnautilus-private/nautilus-view-identifier.c @@ -124,8 +124,7 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char view_as_name = server->iid; } - g_slist_foreach (langs, (GFunc)g_free, NULL); - g_slist_free (langs); + nautilus_g_slist_free_deep (langs); /* if the name is an OAFIID, clean it up for display */ if (nautilus_str_has_prefix (view_as_name, "OAFIID:")) { diff --git a/libnautilus/nautilus-view-standard-main.h b/libnautilus/nautilus-view-standard-main.h index 5aea84aae..31bd77d14 100644 --- a/libnautilus/nautilus-view-standard-main.h +++ b/libnautilus/nautilus-view-standard-main.h @@ -35,9 +35,7 @@ #include <libnautilus/nautilus-view.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +BEGIN_GNOME_DECLS typedef NautilusView * (*NautilusViewCreateFunction) (const char *iid, void *user_data); @@ -64,8 +62,6 @@ int nautilus_view_standard_main_multi (const char *executable_n */ NautilusView * nautilus_view_create_from_get_type_function (const char *iid, void *user_data); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +END_GNOME_DECLS #endif /* NAUTILUS_VIEW_STANDARD_MAIN_H */ diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c index 29fe8c2ee..a17eac969 100644 --- a/src/file-manager/fm-desktop-icon-view.c +++ b/src/file-manager/fm-desktop-icon-view.c @@ -54,7 +54,6 @@ #include <libnautilus-extensions/nautilus-string.h> #include <libnautilus-extensions/nautilus-trash-monitor.h> #include <libnautilus-extensions/nautilus-volume-monitor.h> -#include <src/nautilus-application.h> #include <limits.h> #include <stddef.h> #include <stdio.h> @@ -714,7 +713,7 @@ icon_view_create_nautilus_links (NautilusIconContainer *container, const GList * message = _("Nautilus does not currently support " "launchers that require a terminal."); nautilus_show_warning_dialog (message, _("Unable to Create Link"), - fm_directory_view_get_containing_window (view)); + fm_directory_view_get_containing_window (view)); break; } diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 2051cc4be..20c7cac09 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -70,8 +70,6 @@ #include <libnautilus-extensions/nautilus-view-identifier.h> #include <libnautilus/nautilus-bonobo-ui.h> #include <math.h> -#include <src/nautilus-application.h> - #define DISPLAY_TIMEOUT_INTERVAL_MSECS 500 #define SILENT_WINDOW_OPEN_LIMIT 5 @@ -82,22 +80,14 @@ #define NAUTILUS_COMMAND_SPECIFIER "command:" /* Paths to use when referring to bonobo menu items. */ -#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN "/menu/File/Open Placeholder/Open" #define FM_DIRECTORY_VIEW_MENU_PATH_OPEN_IN_NEW_WINDOW "/menu/File/Open Placeholder/OpenNew" #define FM_DIRECTORY_VIEW_MENU_PATH_OPEN_WITH "/menu/File/Open Placeholder/Open With" -#define FM_DIRECTORY_VIEW_MENU_PATH_NEW_FOLDER "/menu/File/New Items Placeholder/New Folder" -#define FM_DIRECTORY_VIEW_MENU_PATH_DELETE "/menu/File/File Items Placeholder/Delete" #define FM_DIRECTORY_VIEW_MENU_PATH_TRASH "/menu/File/File Items Placeholder/Trash" #define FM_DIRECTORY_VIEW_MENU_PATH_EMPTY_TRASH "/menu/File/Global File Items Placeholder/Empty Trash" -#define FM_DIRECTORY_VIEW_MENU_PATH_DUPLICATE "/menu/File/File Items Placeholder/Duplicate" #define FM_DIRECTORY_VIEW_MENU_PATH_CREATE_LINK "/menu/File/File Items Placeholder/Create Link" -#define FM_DIRECTORY_VIEW_MENU_PATH_SHOW_PROPERTIES "/menu/File/File Items Placeholder/Show Properties" -#define FM_DIRECTORY_VIEW_MENU_PATH_RESET_BACKGROUND "/menu/Edit/Global Edit Items Placeholder/Reset Background" #define FM_DIRECTORY_VIEW_MENU_PATH_REMOVE_CUSTOM_ICONS "/menu/Edit/Edit Items Placeholder/Remove Custom Icons" #define FM_DIRECTORY_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER "/menu/File/Open Placeholder/Open With/Applications Placeholder" -#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_APPLICATION "/menu/File/Open Placeholder/Open With/OtherApplication" #define FM_DIRECTORY_VIEW_MENU_PATH_VIEWERS_PLACEHOLDER "/menu/File/Open Placeholder/Open With/Viewers Placeholder" -#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_VIEWER "/menu/File/Open Placeholder/Open With/OtherViewer" #define FM_DIRECTORY_VIEW_POPUP_PATH_BACKGROUND "/popups/background" #define FM_DIRECTORY_VIEW_POPUP_PATH_SELECTION "/popups/selection" @@ -161,6 +151,9 @@ struct FMDirectoryViewDetails gboolean metadata_for_directory_as_file_pending; gboolean metadata_for_files_in_directory_pending; + gboolean selection_change_is_due_to_shell; + gboolean send_selection_change_to_shell; + NautilusFile *file_monitored_for_open_with; }; @@ -1325,6 +1318,8 @@ fm_directory_view_send_selection_change (FMDirectoryView *view) /* Free the URIs. */ nautilus_g_list_free_deep (uris); + + view->details->send_selection_change_to_shell = FALSE; } static void @@ -1356,33 +1351,35 @@ file_list_from_uri_list (GList *uri_list) static void selection_changed_callback (NautilusView *nautilus_view, GList *selection_uris, - FMDirectoryView *directory_view) + FMDirectoryView *view) { GList *selection; - if (directory_view->details->loading) { - nautilus_g_list_free_deep (directory_view->details->pending_uris_selected); - directory_view->details->pending_uris_selected = NULL; + if (view->details->loading) { + nautilus_g_list_free_deep (view->details->pending_uris_selected); + view->details->pending_uris_selected = NULL; } - if (!directory_view->details->loading) { + if (!view->details->loading) { /* If we aren't still loading, set the selection right now. */ - selection = file_list_from_uri_list (selection_uris); - fm_directory_view_set_selection (directory_view, selection); + selection = file_list_from_uri_list (selection_uris); + view->details->selection_change_is_due_to_shell = TRUE; + fm_directory_view_set_selection (view, selection); + view->details->selection_change_is_due_to_shell = FALSE; nautilus_file_list_free (selection); } else { /* If we are still loading, add to the list of pending URIs instead. */ - directory_view->details->pending_uris_selected = - g_list_concat (directory_view->details->pending_uris_selected, + view->details->pending_uris_selected = + g_list_concat (view->details->pending_uris_selected, nautilus_g_str_list_copy (selection_uris)); } } static void stop_loading_callback (NautilusView *nautilus_view, - FMDirectoryView *directory_view) + FMDirectoryView *view) { - fm_directory_view_stop (directory_view); + fm_directory_view_stop (view); } @@ -1458,7 +1455,9 @@ done_loading (FMDirectoryView *view) selection = file_list_from_uri_list (uris_selected); nautilus_g_list_free_deep (uris_selected); + view->details->selection_change_is_due_to_shell = TRUE; fm_directory_view_set_selection (view, selection); + view->details->selection_change_is_due_to_shell = FALSE; fm_directory_view_reveal_selection (view); nautilus_file_list_free (selection); @@ -1673,7 +1672,8 @@ copy_move_done_callback (GHashTable *debuting_uris, gpointer data) /* on the off-chance that all the icons have already been added ... */ if (debuting_uri_data->added_files != NULL) { - fm_directory_view_set_selection (directory_view, debuting_uri_data->added_files); + fm_directory_view_set_selection (directory_view, + debuting_uri_data->added_files); fm_directory_view_reveal_selection (directory_view); } debuting_uri_data_free (debuting_uri_data); @@ -1792,6 +1792,9 @@ display_pending_files (FMDirectoryView *view) } if (send_selection_change) { + /* Send a selection change since some file names could + * have changed. + */ fm_directory_view_send_selection_change (view); } @@ -1802,21 +1805,14 @@ static gboolean display_selection_info_idle_callback (gpointer data) { FMDirectoryView *view; - BonoboObject *nautilus_view; view = FM_DIRECTORY_VIEW (data); - nautilus_view = BONOBO_OBJECT (view->details->nautilus_view); - - /* Ref the view so that the widget can't be destroyed during - * idle processing. - */ - bonobo_object_ref (nautilus_view); view->details->display_selection_idle_id = 0; fm_directory_view_display_selection_info (view); - fm_directory_view_send_selection_change (view); - - bonobo_object_unref (nautilus_view); + if (view->details->send_selection_change_to_shell) { + fm_directory_view_send_selection_change (view); + } return FALSE; } @@ -1845,21 +1841,12 @@ static gboolean update_menus_timeout_callback (gpointer data) { FMDirectoryView *view; - BonoboObject *nautilus_view; view = FM_DIRECTORY_VIEW (data); - nautilus_view = BONOBO_OBJECT (view->details->nautilus_view); - - /* Ref the view so that the widget can't be destroyed during - * idle processing. - */ - bonobo_object_ref (nautilus_view); view->details->update_menus_timeout_id = 0; fm_directory_view_update_menus (view); - bonobo_object_unref (nautilus_view); - return FALSE; } @@ -1867,21 +1854,12 @@ static gboolean display_pending_idle_callback (gpointer data) { FMDirectoryView *view; - BonoboObject *nautilus_view; view = FM_DIRECTORY_VIEW (data); - nautilus_view = BONOBO_OBJECT (view->details->nautilus_view); - - /* Ref the view so that the widget can't be destroyed during - * idle processing. - */ - bonobo_object_ref (nautilus_view); view->details->display_pending_idle_id = 0; display_pending_files (view); - bonobo_object_unref (nautilus_view); - /* Don't do another idle until we receive more files. */ return FALSE; @@ -1892,15 +1870,8 @@ display_pending_timeout_callback (gpointer data) { FMDirectoryView *view; gboolean displayed_some; - BonoboObject *nautilus_view; view = FM_DIRECTORY_VIEW (data); - nautilus_view = BONOBO_OBJECT (view->details->nautilus_view); - - /* Ref the view so that the widget can't be destroyed during - * idle processing. - */ - bonobo_object_ref (nautilus_view); /* Do another timeout if we displayed some files. Once we get * all the files, we'll start using idle instead. @@ -1911,8 +1882,6 @@ display_pending_timeout_callback (gpointer data) view->details->display_pending_timeout_id = 0; } - bonobo_object_unref (nautilus_view); - return displayed_some; } @@ -2318,7 +2287,6 @@ fm_directory_view_get_bonobo_control (FMDirectoryView *view) NautilusView *nautilus_view; nautilus_view = fm_directory_view_get_nautilus_view (view); - return nautilus_view_get_bonobo_control (nautilus_view); } @@ -3180,7 +3148,6 @@ real_update_menus (FMDirectoryView *view) nautilus_bonobo_set_sensitive (view->details->ui, FM_DIRECTORY_VIEW_COMMAND_OPEN, selection_count == 1); - if (selection_count <= 1) { label_with_underscore = g_strdup (_("Open in _New Window")); @@ -3339,8 +3306,8 @@ fm_directory_view_pop_up_selection_context_menu (FMDirectoryView *view, * **/ void -fm_directory_view_pop_up_background_context_menu (FMDirectoryView *view, - GdkEventButton *event) +fm_directory_view_pop_up_background_context_menu (FMDirectoryView *view, + GdkEventButton *event) { g_assert (FM_IS_DIRECTORY_VIEW (view)); @@ -3350,7 +3317,7 @@ fm_directory_view_pop_up_background_context_menu (FMDirectoryView *view, update_menus_if_pending (view); nautilus_pop_up_context_menu (create_popup_menu - (view, FM_DIRECTORY_VIEW_POPUP_PATH_BACKGROUND), + (view, FM_DIRECTORY_VIEW_POPUP_PATH_BACKGROUND), NAUTILUS_DEFAULT_POPUP_MENU_DISPLACEMENT, NAUTILUS_DEFAULT_POPUP_MENU_DISPLACEMENT, event); @@ -3386,6 +3353,10 @@ fm_directory_view_notify_selection_changed (FMDirectoryView *view) { g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); + if (!view->details->selection_change_is_due_to_shell) { + view->details->send_selection_change_to_shell = TRUE; + } + /* Schedule a display of the new selection. */ if (view->details->display_selection_idle_id == 0) { view->details->display_selection_idle_id diff --git a/src/nautilus-application.c b/src/nautilus-application.c index 50a7447cc..15dfe6507 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -4,7 +4,7 @@ * Nautilus * * Copyright (C) 1999, 2000 Red Hat, Inc. - * Copyright (C) 2000 Eazel, Inc. + * Copyright (C) 2000, 2001 Eazel, Inc. * * Nautilus is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,7 +20,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Author: Elliot Lee <sopwith@redhat.com>, + * Authors: Elliot Lee <sopwith@redhat.com>, + * Darin Adler <darin@eazel.com> * */ @@ -157,9 +158,10 @@ create_factory (PortableServer_POA poa, static NautilusDesktopWindow *nautilus_application_desktop_window; /* Keeps track of all the nautilus windows. */ -static GSList *nautilus_application_window_list; +static GList *nautilus_application_window_list; -GSList *nautilus_application_windows (void) +GList * +nautilus_application_get_window_list (void) { return nautilus_application_window_list; } @@ -526,7 +528,7 @@ nautilus_application_close_all_windows (void) static void nautilus_application_destroyed_window (GtkObject *object, NautilusApplication *application) { - nautilus_application_window_list = g_slist_remove (nautilus_application_window_list, object); + nautilus_application_window_list = g_list_remove (nautilus_application_window_list, object); } static gboolean @@ -561,7 +563,7 @@ nautilus_application_create_window (NautilusApplication *application) "destroy", nautilus_application_destroyed_window, application); - nautilus_application_window_list = g_slist_prepend (nautilus_application_window_list, window); + nautilus_application_window_list = g_list_prepend (nautilus_application_window_list, window); /* Do not yet show the window. It will be shown later on if it can * successfully display its initial URI. Otherwise it will be destroyed @@ -674,7 +676,7 @@ static void volume_unmounted_callback (NautilusVolumeMonitor *monitor, NautilusVolume *volume, NautilusApplication *application) { - GSList *windows, *index, *close_list; + GList *windows, *index, *close_list; NautilusWindow *window; char *text_uri; const char *path; @@ -683,7 +685,7 @@ volume_unmounted_callback (NautilusVolumeMonitor *monitor, NautilusVolume *volum close_list = NULL; /* Check and see if any of the open windows are displaying contents from the unmounted volume */ - windows = nautilus_application_windows (); + windows = nautilus_application_get_window_list (); /* Construct a list of windows to be closed */ for (index = windows; index != NULL; index = index->next) { @@ -697,7 +699,7 @@ volume_unmounted_callback (NautilusVolumeMonitor *monitor, NautilusVolume *volum path = gnome_vfs_uri_get_path (uri); if (strlen (path) >= strlen (volume->mount_path)) { if (strncmp (path, volume->mount_path, strlen (volume->mount_path)) == 0) { - close_list = g_slist_prepend (close_list, window); + close_list = g_list_prepend (close_list, window); } } gnome_vfs_uri_unref (uri); @@ -710,6 +712,6 @@ volume_unmounted_callback (NautilusVolumeMonitor *monitor, NautilusVolume *volum nautilus_window_close (NAUTILUS_WINDOW (index->data)); } - g_slist_free (close_list); + g_list_free (close_list); } diff --git a/src/nautilus-application.h b/src/nautilus-application.h index 0af5fe52c..d8f4d020e 100644 --- a/src/nautilus-application.h +++ b/src/nautilus-application.h @@ -52,23 +52,20 @@ typedef struct { BonoboObjectClass parent_class; } NautilusApplicationClass; -GtkType nautilus_application_get_type (void); -NautilusApplication *nautilus_application_new (void); -void nautilus_application_startup (NautilusApplication *application, - gboolean kill_shell, - gboolean restart_shell, - gboolean start_desktop, - gboolean no_default_window, - gboolean do_first_time_druid_check, - const char *default_geometry, - const char *urls[]); - -GSList *nautilus_application_windows (void); -NautilusWindow *nautilus_application_create_window (NautilusApplication *application); - -void nautilus_application_close_all_windows (void); - -void nautilus_application_open_desktop (NautilusApplication *application); -void nautilus_application_close_desktop (void); +GtkType nautilus_application_get_type (void); +NautilusApplication *nautilus_application_new (void); +void nautilus_application_startup (NautilusApplication *application, + gboolean kill_shell, + gboolean restart_shell, + gboolean start_desktop, + gboolean no_default_window, + gboolean do_first_time_druid_check, + const char *default_geometry, + const char *urls[]); +GList * nautilus_application_get_window_list (void); +NautilusWindow * nautilus_application_create_window (NautilusApplication *application); +void nautilus_application_close_all_windows (void); +void nautilus_application_open_desktop (NautilusApplication *application); +void nautilus_application_close_desktop (void); #endif /* NAUTILUS_APPLICATION_H */ diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c index 68c67bfc7..c0f54f1d0 100644 --- a/src/nautilus-information-panel.c +++ b/src/nautilus-information-panel.c @@ -1405,7 +1405,7 @@ nautilus_sidebar_update_appearance (NautilusSidebar *sidebar) char* combine_str; background_color = g_strdup (sidebar->details->default_background_color); background_image = g_strdup (sidebar->details->default_background_image); - combine_str = nautilus_theme_get_theme_data ("sidebar", "COMBINE"); + combine_str = nautilus_theme_get_theme_data ("sidebar", "combine"); combine = combine_str != NULL; g_free (combine_str); } else { @@ -1534,7 +1534,8 @@ nautilus_sidebar_set_title (NautilusSidebar *sidebar, const char* new_title) doesn't generate a signal */ static void -nautilus_sidebar_size_allocate(GtkWidget *widget, GtkAllocation *allocation) +nautilus_sidebar_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { NautilusSidebar *sidebar = NAUTILUS_SIDEBAR(widget); diff --git a/src/nautilus-main.c b/src/nautilus-main.c index 6d2b7b3f4..a92565cd9 100644 --- a/src/nautilus-main.c +++ b/src/nautilus-main.c @@ -259,7 +259,9 @@ main (int argc, char *argv[]) application = nautilus_application_new (); nautilus_application_startup (application, - kill_shell, restart_shell, start_desktop, no_default_window, TRUE, geometry, + kill_shell, restart_shell, start_desktop, no_default_window, + !(kill_shell || restart_shell), + geometry, args); if (is_event_loop_needed ()) { bonobo_main (); diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c index 96cbb5396..1a39eb185 100644 --- a/src/nautilus-navigation-window.c +++ b/src/nautilus-navigation-window.c @@ -617,22 +617,24 @@ nautilus_window_set_arg (GtkObject *object, guint arg_id) { char *old_name; - NautilusWindow *window = (NautilusWindow *) object; + NautilusWindow *window; + + window = NAUTILUS_WINDOW (object); - switch(arg_id) { + switch (arg_id) { case ARG_APP_ID: if (GTK_VALUE_STRING (*arg) == NULL) { return; } - old_name = bonobo_window_get_name (BONOBO_WINDOW (object)); - bonobo_window_set_name (BONOBO_WINDOW (object), GTK_VALUE_STRING (*arg)); + old_name = bonobo_window_get_name (BONOBO_WINDOW (window)); + bonobo_window_set_name (BONOBO_WINDOW (window), GTK_VALUE_STRING (*arg)); /* This hack of using the time when the name first * goes non-NULL to be window-constructed time is * completely lame. But it works, so for now we leave * it alone. */ if (old_name == NULL) { - nautilus_window_constructed (NAUTILUS_WINDOW (object)); + nautilus_window_constructed (window); } g_free (old_name); break; @@ -647,7 +649,7 @@ nautilus_window_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { - switch(arg_id) { + switch (arg_id) { case ARG_APP_ID: GTK_VALUE_STRING (*arg) = bonobo_window_get_name (BONOBO_WINDOW (object)); break; @@ -1488,14 +1490,14 @@ nautilus_window_clear_back_list (NautilusWindow *window) void nautilus_forget_history (void) { - GSList *window_node; + GList *window_node; NautilusWindow *window; /* Clear out each window's back & forward lists. Also, remove * each window's current location bookmark from history list * so it doesn't get clobbered. */ - for (window_node = nautilus_application_windows (); + for (window_node = nautilus_application_get_window_list (); window_node != NULL; window_node = window_node->next) { @@ -1514,7 +1516,7 @@ nautilus_forget_history (void) free_history_list (); /* Re-add each window's current location to history list. */ - for (window_node = nautilus_application_windows (); + for (window_node = nautilus_application_get_window_list (); window_node != NULL; window_node = window_node->next) { diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c index 96cbb5396..1a39eb185 100644 --- a/src/nautilus-object-window.c +++ b/src/nautilus-object-window.c @@ -617,22 +617,24 @@ nautilus_window_set_arg (GtkObject *object, guint arg_id) { char *old_name; - NautilusWindow *window = (NautilusWindow *) object; + NautilusWindow *window; + + window = NAUTILUS_WINDOW (object); - switch(arg_id) { + switch (arg_id) { case ARG_APP_ID: if (GTK_VALUE_STRING (*arg) == NULL) { return; } - old_name = bonobo_window_get_name (BONOBO_WINDOW (object)); - bonobo_window_set_name (BONOBO_WINDOW (object), GTK_VALUE_STRING (*arg)); + old_name = bonobo_window_get_name (BONOBO_WINDOW (window)); + bonobo_window_set_name (BONOBO_WINDOW (window), GTK_VALUE_STRING (*arg)); /* This hack of using the time when the name first * goes non-NULL to be window-constructed time is * completely lame. But it works, so for now we leave * it alone. */ if (old_name == NULL) { - nautilus_window_constructed (NAUTILUS_WINDOW (object)); + nautilus_window_constructed (window); } g_free (old_name); break; @@ -647,7 +649,7 @@ nautilus_window_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { - switch(arg_id) { + switch (arg_id) { case ARG_APP_ID: GTK_VALUE_STRING (*arg) = bonobo_window_get_name (BONOBO_WINDOW (object)); break; @@ -1488,14 +1490,14 @@ nautilus_window_clear_back_list (NautilusWindow *window) void nautilus_forget_history (void) { - GSList *window_node; + GList *window_node; NautilusWindow *window; /* Clear out each window's back & forward lists. Also, remove * each window's current location bookmark from history list * so it doesn't get clobbered. */ - for (window_node = nautilus_application_windows (); + for (window_node = nautilus_application_get_window_list (); window_node != NULL; window_node = window_node->next) { @@ -1514,7 +1516,7 @@ nautilus_forget_history (void) free_history_list (); /* Re-add each window's current location to history list. */ - for (window_node = nautilus_application_windows (); + for (window_node = nautilus_application_get_window_list (); window_node != NULL; window_node = window_node->next) { diff --git a/src/nautilus-shell.c b/src/nautilus-shell.c index 930cae8e0..a13b0fc2d 100644 --- a/src/nautilus-shell.c +++ b/src/nautilus-shell.c @@ -49,37 +49,44 @@ #include <libnautilus/nautilus-bonobo-workarounds.h> #include <stdlib.h> -#define START_STATE_CONFIG "start-state" - -struct NautilusShellDetails { - NautilusApplication *application; -}; - -static void nautilus_shell_initialize (NautilusShell *shell); -static void nautilus_shell_initialize_class (NautilusShellClass *klass); -static void destroy (GtkObject *shell); -static void corba_open_windows (PortableServer_Servant servant, - const Nautilus_URIList *list, - const CORBA_char *geometry, - CORBA_Environment *ev); -static void corba_open_default_window (PortableServer_Servant servant, - const CORBA_char *geometry, - CORBA_Environment *ev); -static void corba_start_desktop (PortableServer_Servant servant, - CORBA_Environment *ev); -static void corba_stop_desktop (PortableServer_Servant servant, - CORBA_Environment *ev); -static void corba_quit (PortableServer_Servant servant, - CORBA_Environment *ev); -static void corba_restart (PortableServer_Servant servant, - CORBA_Environment *ev); -static gboolean restore_window_states (NautilusShell *shell); +/* turn this on to enable the caveat dialog */ +#if 0 +#define SHOW_CAVEAT +#endif /* Keep window from shrinking down ridiculously small; numbers are somewhat arbitrary */ #define APPLICATION_WINDOW_MIN_WIDTH 300 #define APPLICATION_WINDOW_MIN_HEIGHT 100 -NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusShell, nautilus_shell, BONOBO_OBJECT_TYPE) +#define START_STATE_CONFIG "start-state" + +struct NautilusShellDetails { + NautilusApplication *application; +}; + +static void nautilus_shell_initialize (NautilusShell *shell); +static void nautilus_shell_initialize_class (NautilusShellClass *klass); +static void destroy (GtkObject *shell); +static void corba_open_windows (PortableServer_Servant servant, + const Nautilus_URIList *list, + const CORBA_char *geometry, + CORBA_Environment *ev); +static void corba_open_default_window (PortableServer_Servant servant, + const CORBA_char *geometry, + CORBA_Environment *ev); +static void corba_start_desktop (PortableServer_Servant servant, + CORBA_Environment *ev); +static void corba_stop_desktop (PortableServer_Servant servant, + CORBA_Environment *ev); +static void corba_quit (PortableServer_Servant servant, + CORBA_Environment *ev); +static void corba_restart (PortableServer_Servant servant, + CORBA_Environment *ev); +static gboolean restore_window_states (NautilusShell *shell); + +NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusShell, + nautilus_shell, + BONOBO_OBJECT_TYPE) static void nautilus_shell_initialize_class (NautilusShellClass *klass) @@ -91,12 +98,14 @@ static POA_Nautilus_Shell__epv * nautilus_shell_get_epv (void) { static POA_Nautilus_Shell__epv epv; + epv.open_windows = corba_open_windows; epv.open_default_window = corba_open_default_window; epv.start_desktop = corba_start_desktop; epv.stop_desktop = corba_stop_desktop; epv.quit = corba_quit; epv.restart = corba_restart; + return &epv; } @@ -104,8 +113,10 @@ static POA_Nautilus_Shell__vepv * nautilus_shell_get_vepv (void) { static POA_Nautilus_Shell__vepv vepv; + vepv.Bonobo_Unknown_epv = nautilus_bonobo_object_get_epv (); vepv.Nautilus_Shell_epv = nautilus_shell_get_epv (); + return &vepv; } @@ -160,6 +171,8 @@ nautilus_shell_new (NautilusApplication *application) return shell; } +#ifdef SHOW_CAVEAT + static void display_caveat (GtkWindow *parent_window) { @@ -229,9 +242,12 @@ display_caveat (GtkWindow *parent_window) gtk_widget_show (GTK_WIDGET (dialog)); } +#endif /* SHOW_CAVEAT */ + static void display_caveat_first_time (NautilusShell *shell, NautilusWindow *window) { +#ifdef SHOW_CAVEAT static gboolean showed_caveat; /* Show the "not ready for prime time" dialog after the first @@ -246,6 +262,7 @@ display_caveat_first_time (NautilusShell *shell, NautilusWindow *window) display_caveat, window); } showed_caveat = TRUE; +#endif /* SHOW_CAVEAT */ } static void @@ -318,14 +335,14 @@ corba_start_desktop (PortableServer_Servant servant, static void corba_stop_desktop (PortableServer_Servant servant, - CORBA_Environment *ev) + CORBA_Environment *ev) { nautilus_application_close_desktop (); } static void corba_quit (PortableServer_Servant servant, - CORBA_Environment *ev) + CORBA_Environment *ev) { nautilus_main_event_loop_quit (); } @@ -341,11 +358,11 @@ corba_quit (PortableServer_Servant servant, static void save_window_states (void) { - GSList *windows, *iter; - GSList *out = NULL; + GList *windows, *iter; + GList *out = NULL; - windows = nautilus_application_windows (); - for (iter = windows; iter; iter = g_slist_next (iter)) { + windows = nautilus_application_get_window_list (); + for (iter = windows; iter; iter = g_list_next (iter)) { NautilusWindow *window = (NautilusWindow *) (iter->data); GdkWindow *gdk_window = GTK_WIDGET (window)->window; char *window_info; @@ -372,19 +389,18 @@ save_window_states (void) x, y, window->location); } - out = g_slist_prepend (out, window_info); + out = g_list_prepend (out, window_info); } nautilus_preferences_set_string_list (START_STATE_CONFIG, out); - g_slist_foreach (out, (GFunc)g_free, NULL); - g_slist_free (out); + nautilus_g_list_free_deep (out); } /* returns TRUE if there was state info which has been used to create new windows */ static gboolean restore_window_states (NautilusShell *shell) { - GSList *start_state, *iter; + GList *start_state, *iter; NautilusWindow *window; char *window_info, *p, *uri; int x, y, width, height; @@ -394,7 +410,7 @@ restore_window_states (NautilusShell *shell) return FALSE; } - for (iter = start_state; iter; iter = g_slist_next (iter)) { + for (iter = start_state; iter; iter = iter->next) { p = window_info = (char *) (iter->data); width = strtol (p, &p, 10); @@ -430,7 +446,7 @@ restore_window_states (NautilusShell *shell) g_free (window_info); } - g_slist_free (start_state); + nautilus_g_list_free_deep (start_state); nautilus_preferences_set_string_list (START_STATE_CONFIG, NULL); return TRUE; } @@ -443,5 +459,4 @@ corba_restart (PortableServer_Servant servant, nautilus_main_event_loop_quit (); nautilus_setenv ("_NAUTILUS_RESTART", "yes", 1); - } diff --git a/src/nautilus-sidebar-tabs.c b/src/nautilus-sidebar-tabs.c index 769eac11e..93c025297 100644 --- a/src/nautilus-sidebar-tabs.c +++ b/src/nautilus-sidebar-tabs.c @@ -180,8 +180,8 @@ nautilus_sidebar_tabs_load_theme_data (NautilusSidebarTabs *sidebar_tabs) } /* load the tab_pieces image if necessary */ - tab_pieces = nautilus_theme_get_theme_data ("sidebar", "TAB_PIECE_IMAGES"); - tab_piece_theme = nautilus_theme_get_theme_data ("sidebar", "TAB_PIECE_THEME"); + tab_pieces = nautilus_theme_get_theme_data ("sidebar", "tab_piece_images"); + tab_piece_theme = nautilus_theme_get_theme_data ("sidebar", "tab_piece_theme"); if (tab_pieces) { /* check for "none" to force non-bitmap tabs, necessary since the default has bitmap ones now */ @@ -203,7 +203,7 @@ nautilus_sidebar_tabs_load_theme_data (NautilusSidebarTabs *sidebar_tabs) if (sidebar_tabs->details->tab_piece_images[0]) { /* load the left offset */ - temp_str = nautilus_theme_get_theme_data ("sidebar", "LEFT_OFFSET"); + temp_str = nautilus_theme_get_theme_data ("sidebar", "left_offset"); if (temp_str) { sidebar_tabs->details->tab_left_offset = atoi(temp_str); g_free (temp_str); @@ -738,7 +738,7 @@ get_text_offset (void) int offset; char *temp_str; - temp_str = nautilus_theme_get_theme_data ("sidebar", "TEXT_H_OFFSET"); + temp_str = nautilus_theme_get_theme_data ("sidebar", "text_h_offset"); if (temp_str) { offset = atoi (temp_str); g_free (temp_str); diff --git a/src/nautilus-sidebar-title.c b/src/nautilus-sidebar-title.c index d8eac4be5..ea0aa96b6 100644 --- a/src/nautilus-sidebar-title.c +++ b/src/nautilus-sidebar-title.c @@ -281,9 +281,9 @@ nautilus_sidebar_title_select_text_color (NautilusSidebarTitle *sidebar_title) background = nautilus_sidebar_title_background (sidebar_title); if (background != NULL) { if (nautilus_sidebar_title_background_is_default (sidebar_title)) { - sidebar_title_color = nautilus_theme_get_theme_data ("sidebar", "TITLE_COLOR"); - sidebar_info_title_color = nautilus_theme_get_theme_data ("sidebar", "TITLE_INFO_COLOR"); - sidebar_title_shadow_color = nautilus_theme_get_theme_data ("sidebar", "TITLE_SHADOW_COLOR"); + sidebar_title_color = nautilus_theme_get_theme_data ("sidebar", "title_color"); + sidebar_info_title_color = nautilus_theme_get_theme_data ("sidebar", "title_info_color"); + sidebar_title_shadow_color = nautilus_theme_get_theme_data ("sidebar", "title_shadow_color"); } if (sidebar_title_color == NULL) { @@ -340,7 +340,7 @@ nautilus_sidebar_title_theme_changed (gpointer user_data) sidebar_title = NAUTILUS_SIDEBAR_TITLE (user_data); - shadow_offset_str = nautilus_theme_get_theme_data ("sidebar", "SHADOW_OFFSET"); + shadow_offset_str = nautilus_theme_get_theme_data ("sidebar", "shadow_offset"); if (shadow_offset_str) { sidebar_title->details->shadow_offset = atoi (shadow_offset_str); g_free (shadow_offset_str); diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c index 68c67bfc7..c0f54f1d0 100644 --- a/src/nautilus-sidebar.c +++ b/src/nautilus-sidebar.c @@ -1405,7 +1405,7 @@ nautilus_sidebar_update_appearance (NautilusSidebar *sidebar) char* combine_str; background_color = g_strdup (sidebar->details->default_background_color); background_image = g_strdup (sidebar->details->default_background_image); - combine_str = nautilus_theme_get_theme_data ("sidebar", "COMBINE"); + combine_str = nautilus_theme_get_theme_data ("sidebar", "combine"); combine = combine_str != NULL; g_free (combine_str); } else { @@ -1534,7 +1534,8 @@ nautilus_sidebar_set_title (NautilusSidebar *sidebar, const char* new_title) doesn't generate a signal */ static void -nautilus_sidebar_size_allocate(GtkWidget *widget, GtkAllocation *allocation) +nautilus_sidebar_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { NautilusSidebar *sidebar = NAUTILUS_SIDEBAR(widget); diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index 96cbb5396..1a39eb185 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -617,22 +617,24 @@ nautilus_window_set_arg (GtkObject *object, guint arg_id) { char *old_name; - NautilusWindow *window = (NautilusWindow *) object; + NautilusWindow *window; + + window = NAUTILUS_WINDOW (object); - switch(arg_id) { + switch (arg_id) { case ARG_APP_ID: if (GTK_VALUE_STRING (*arg) == NULL) { return; } - old_name = bonobo_window_get_name (BONOBO_WINDOW (object)); - bonobo_window_set_name (BONOBO_WINDOW (object), GTK_VALUE_STRING (*arg)); + old_name = bonobo_window_get_name (BONOBO_WINDOW (window)); + bonobo_window_set_name (BONOBO_WINDOW (window), GTK_VALUE_STRING (*arg)); /* This hack of using the time when the name first * goes non-NULL to be window-constructed time is * completely lame. But it works, so for now we leave * it alone. */ if (old_name == NULL) { - nautilus_window_constructed (NAUTILUS_WINDOW (object)); + nautilus_window_constructed (window); } g_free (old_name); break; @@ -647,7 +649,7 @@ nautilus_window_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { - switch(arg_id) { + switch (arg_id) { case ARG_APP_ID: GTK_VALUE_STRING (*arg) = bonobo_window_get_name (BONOBO_WINDOW (object)); break; @@ -1488,14 +1490,14 @@ nautilus_window_clear_back_list (NautilusWindow *window) void nautilus_forget_history (void) { - GSList *window_node; + GList *window_node; NautilusWindow *window; /* Clear out each window's back & forward lists. Also, remove * each window's current location bookmark from history list * so it doesn't get clobbered. */ - for (window_node = nautilus_application_windows (); + for (window_node = nautilus_application_get_window_list (); window_node != NULL; window_node = window_node->next) { @@ -1514,7 +1516,7 @@ nautilus_forget_history (void) free_history_list (); /* Re-add each window's current location to history list. */ - for (window_node = nautilus_application_windows (); + for (window_node = nautilus_application_get_window_list (); window_node != NULL; window_node = window_node->next) { diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c index 4bbe5483e..1436736ca 100644 --- a/src/nautilus-window-manage-views.c +++ b/src/nautilus-window-manage-views.c @@ -101,9 +101,11 @@ static void cancel_location_change (NautilusWindow *window); static void change_selection (NautilusWindow *window, - GList *selection) + GList *selection, + NautilusViewFrame *requesting_view) { GList *sorted, *node; + NautilusViewFrame *view; /* Sort list into canonical order and check if it's the same as * the selection we already have. @@ -118,10 +120,15 @@ change_selection (NautilusWindow *window, nautilus_g_list_free_deep (window->selection); window->selection = sorted; - /* Tell all the view frames about it. */ - nautilus_view_frame_selection_changed (window->content_view, sorted); + /* Tell all the view frames about it, except the one that changed it. */ + if (window->content_view != requesting_view) { + nautilus_view_frame_selection_changed (window->content_view, sorted); + } for (node = window->sidebar_panels; node != NULL; node = node->next) { - nautilus_view_frame_selection_changed (node->data, sorted); + view = node->data; + if (view != requesting_view) { + nautilus_view_frame_selection_changed (view, sorted); + } } } @@ -993,7 +1000,6 @@ static void end_location_change (NautilusWindow *window) { nautilus_window_allow_stop (window, FALSE); - free_location_change (window); } @@ -1060,9 +1066,8 @@ position_and_show_window_callback (NautilusFile *file, static gboolean just_one_window (void) { - GSList *window_list; - window_list = nautilus_application_windows (); - return window_list == NULL || window_list->next == NULL; + return !nautilus_g_list_more_than_one_item + (nautilus_application_get_window_list ()); } static void @@ -1080,7 +1085,8 @@ nautilus_window_end_location_change_callback (NautilusNavigationResult result_co char *scheme_string; char *type_string; char *dialog_title; - GnomeDialog *dialog; + char *home_uri; + GnomeDialog *dialog; GList *attributes; GnomeVFSURI *vfs_uri; @@ -1249,8 +1255,6 @@ nautilus_window_end_location_change_callback (NautilusNavigationResult result_co /* if this is the only window, we don't want to quit, so we redirect it to home */ if (just_one_window ()) { - char *home_uri; - /* the user could have typed in a home directory that doesn't exist, in which case going home would cause an infinite loop, so we better test for that */ @@ -1597,7 +1601,7 @@ change_selection_callback (NautilusViewFrame *view, { g_assert (NAUTILUS_IS_WINDOW (window)); - change_selection (window, selection); + change_selection (window, selection, view); } static void @@ -1669,14 +1673,14 @@ open_location_prefer_existing_window_callback (NautilusViewFrame *view, NautilusWindow *window) { NautilusWindow *existing_window; - GSList *node; + GList *node; g_assert (NAUTILUS_IS_WINDOW (window)); /* First, handle the case where there's already a window for * this location. */ - for (node = nautilus_application_windows (); + for (node = nautilus_application_get_window_list (); node != NULL; node = node->next) { existing_window = NAUTILUS_WINDOW (node->data); if (nautilus_uris_match (existing_window->location, location)) { @@ -1721,7 +1725,9 @@ view_loaded_callback (NautilusViewFrame *view, /* it's a sidebar panel being loaded */ g_assert (view != window->content_view); if (window->location != NULL) { - set_view_location_and_selection (view, window->location, window->selection); + set_view_location_and_selection (view, + window->location, + window->selection); } } if (window->details->title != NULL) { diff --git a/src/nautilus-window-toolbars.c b/src/nautilus-window-toolbars.c index a38f8261a..1f05b29d8 100644 --- a/src/nautilus-window-toolbars.c +++ b/src/nautilus-window-toolbars.c @@ -181,7 +181,7 @@ get_file_name_from_icon_name (const char *icon_name) char *full_path_name, *icon_theme, *theme_path_name; /* look in the theme to see if there's a redirection found */ - icon_theme = nautilus_theme_get_theme_data ("toolbar", "ICON_THEME"); + icon_theme = nautilus_theme_get_theme_data ("toolbar", "icon_theme"); if (icon_theme != NULL) { /* special case the "standard" theme which indicates using the stock gnome icons */ if (nautilus_strcmp (icon_theme, "standard") == 0) { diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 96cbb5396..1a39eb185 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -617,22 +617,24 @@ nautilus_window_set_arg (GtkObject *object, guint arg_id) { char *old_name; - NautilusWindow *window = (NautilusWindow *) object; + NautilusWindow *window; + + window = NAUTILUS_WINDOW (object); - switch(arg_id) { + switch (arg_id) { case ARG_APP_ID: if (GTK_VALUE_STRING (*arg) == NULL) { return; } - old_name = bonobo_window_get_name (BONOBO_WINDOW (object)); - bonobo_window_set_name (BONOBO_WINDOW (object), GTK_VALUE_STRING (*arg)); + old_name = bonobo_window_get_name (BONOBO_WINDOW (window)); + bonobo_window_set_name (BONOBO_WINDOW (window), GTK_VALUE_STRING (*arg)); /* This hack of using the time when the name first * goes non-NULL to be window-constructed time is * completely lame. But it works, so for now we leave * it alone. */ if (old_name == NULL) { - nautilus_window_constructed (NAUTILUS_WINDOW (object)); + nautilus_window_constructed (window); } g_free (old_name); break; @@ -647,7 +649,7 @@ nautilus_window_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) { - switch(arg_id) { + switch (arg_id) { case ARG_APP_ID: GTK_VALUE_STRING (*arg) = bonobo_window_get_name (BONOBO_WINDOW (object)); break; @@ -1488,14 +1490,14 @@ nautilus_window_clear_back_list (NautilusWindow *window) void nautilus_forget_history (void) { - GSList *window_node; + GList *window_node; NautilusWindow *window; /* Clear out each window's back & forward lists. Also, remove * each window's current location bookmark from history list * so it doesn't get clobbered. */ - for (window_node = nautilus_application_windows (); + for (window_node = nautilus_application_get_window_list (); window_node != NULL; window_node = window_node->next) { @@ -1514,7 +1516,7 @@ nautilus_forget_history (void) free_history_list (); /* Re-add each window's current location to history list. */ - for (window_node = nautilus_application_windows (); + for (window_node = nautilus_application_get_window_list (); window_node != NULL; window_node = window_node->next) { diff --git a/src/nautilus-zoom-control.c b/src/nautilus-zoom-control.c index 32125f2aa..53f08c273 100644 --- a/src/nautilus-zoom-control.c +++ b/src/nautilus-zoom-control.c @@ -292,9 +292,9 @@ void draw_number (GtkWidget *widget, GdkRectangle *box) zoom_control = NAUTILUS_ZOOM_CONTROL (widget); number_pixbuf = NULL; - num_v_offset = get_zoom_offset ("NUMBER_V_OFFSET"); - num_h_offset = get_zoom_offset ("NUMBER_H_OFFSET"); - char_width = get_zoom_offset ("DIGIT_WIDTH"); + num_v_offset = get_zoom_offset ("number_v_offset"); + num_h_offset = get_zoom_offset ("number_h_offset"); + char_width = get_zoom_offset ("digit_width"); if (char_width == 0) char_width = 6; |