Commit b99fa350 authored by Michael Meeks's avatar Michael Meeks Committed by Michael Meeks

setup both the rgba and GdkColor variants. (update_label_color): upd.

2002-02-17  Michael Meeks  <michael@ximian.com>

	* libnautilus-private/nautilus-icon-container.c
	(nautilus_icon_container_theme_changed): setup both
	the rgba and GdkColor variants.
	(update_label_color): upd. color handling.
	(alloc_colors): allocate the colors on realize

2002-02-15  Michael Meeks  <michael@ximian.com>

	* libnautilus-private/nautilus-icon-container.c
	(nautilus_icon_container_get_label_color): return
	the colors we need, grab them from the style's text
	information though.

2002-02-14  Michael Meeks  <michael@ximian.com>

	* libnautilus-private/nautilus-icon-canvas-item.c
	(nautilus_icon_canvas_item_get_property),
	(nautilus_icon_canvas_item_set_property): port to
	properties.
	(draw_or_measure_label_text): update color handling,
	could we re-use the gc here ?
	(draw_stretch_handles): upd gc unref.
	(nautilus_icon_canvas_item_class_init): upd.

	* libnautilus-private/nautilus-theme.c
	(nautilus_pixmap_file_may_be_local),
	(nautilus_theme_install_user_theme),
	(nautilus_theme_make_preview_pixbuf),
	(theme_get_property),
	(load_theme_document): upd. file tests.

	* libnautilus-private/nautilus-monitor.c
	(get_event_uri): use g_build_filename.

	* libnautilus-private/nautilus-find-icon-image.c
	(get_user_emblem_path, make_full_icon_path),
	(make_full_icon_path): upd. file test.

	* libnautilus-private/nautilus-file-utilities.c
	(nautilus_pixmap_file),
	(nautilus_get_data_file_path),
	(nautilus_get_user_directory),
	(nautilus_get_desktop_directory): upd. file tests.

	* libnautilus-private/nautilus-directory-metafile.c
	(nautilus_directory_get_boolean_file_metadata): use
	strcasecmp not ascii_strdown to save yet more malloc
	locking penalty.

	* libnautilus-private/nautilus-directory-background.c
	(nautilus_file_background_receive_root_window_changes),
	(desktop_background_destroyed_callback): upd. root
	window macro.
	(nautilus_connect_background_to_file_metadata),
	(initialize_background_from_settings),
	(image_loading_done_callback): upd g_signal bits.

	* libnautilus-private/nautilus-volume-monitor.c
	(nautilus_volume_monitor_class_init): upd file test.

	* libnautilus-private/nautilus-undo-signal-handlers.c
	(nautilus_undo_tear_down_nautilus_entry_for_undo): upd.

	* libnautilus-private/nautilus-undo-manager.c
	(nautilus_undo_manager_class_init): upd. signal bits.

	* libnautilus-private/nautilus-trash-monitor.c
	(nautilus_trash_monitor_class_init): g_cclosureize.
	(nautilus_trash_monitor_init): g_signal upds.

	* libnautilus-private/nautilus-trash-file.c
	(trash_destroy, nautilus_trash_file_init),
	(remove_real_file): upd. g_signal bits.

	* libnautilus-private/nautilus-trash-directory.c
	(nautilus_trash_directory_init): upd. signal connect.
	(trash_destroy): upd. signal bits.

	* libnautilus-private/nautilus-program-choosing.c
	(get_xalf_prefix): upd. find_program_in_path.

	* libnautilus-private/nautilus-program-chooser.c
	(nautilus_program_chooser_init): upd. window policy

	* libnautilus-private/nautilus-merged-directory.c
	(merged_remove_real_directory): upd. g_signal.
	(nautilus_merged_directory_class_init): upd. g_closure

	* libnautilus-private/nautilus-link-desktop-file.c
	(nautilus_link_desktop_file_get_link_icon_from_desktop):
	upd. pixmap location.

	* libnautilus-private/nautilus-icon-factory.c
	(nautilus_icon_factory_class_init): upd. marshallers
	(is_theme_in_user_directory): upd. file test.

	* libnautilus-private/nautilus-icon-dnd.c
	(auto_scroll_timeout_callback): do a queue_draw_area
	instead of a widget_draw.

	* libnautilus-private/nautilus-icon-container.c
	(nautilus_icon_container_init),
	(set_pending_icon_to_reveal): g_signal updates.
	(nautilus_icon_container_new): remove visual
	push/pop.

	* libnautilus-private/nautilus-file.c
	(nautilus_file_fit_date_as_string): upd. julian date get.
	(nautilus_file_class_init): upd. marshallers.

	* libnautilus-private/nautilus-file-operations.c
	(extract_and_ellipsize_file_name_for_dialog): use
	get_basename.
	(nautilus_file_operations_copy_move): use gtk stock.


	* libnautilus-private/nautilus-file-operations-progress.c
	(nautilus_file_operations_progress_update): use
	progress_bar_set_fraction.
	(nautilus_file_operations_progress_init): prune
	progress setup - these are the defaults.

	* libnautilus-private/nautilus-entry.c
	(nautilus_entry_key_press): upd select_region.

	* libnautilus-private/nautilus-drag-window.c
	(get_ancestor_blocked_by): upd type_is_a.

	* libnautilus-private/nautilus-dnd.c
	(nautilus_drag_finalize),
	(nautilus_drag_init): g_object ref upd.

	* libnautilus-private/nautilus-directory.c
	(nautilus_directory_class_init): marshaller upd..
	(nautilus_directory_schedule_metadata_remove),
	(nautilus_directory_schedule_metadata_copy),
	(nautilus_directory_schedule_metadata_move):
	basename upd.

	* libnautilus-private/nautilus-directory-background.c
	(desktop_background_realized): g_signal upd.
	(theme_image_path_to_uri): file test upd.
	(image_loading_done_callback): object unref on gc & pixmap.
	(background_changed_callback): g_signal upd.

	* libnautilus-private/nautilus-bookmark.c
	(nautilus_bookmark_disconnect_file): g_signal upd.
	(nautilus_bookmark_uri_known_not_to_exist): upd
	file test.

	* libnautilus-private/nautilus-authn-manager.c
	(authentication_dialog_button_clicked): use
	GTK_RESPONSE_OK

	* libnautilus-private/Makefile.am: add deprc.
	CFLAGS.

	* libnautilus/Makefile.am: ditto.

	* configure.in (DISABLE_DEPRECATED_CFLAGS): add.

2002-02-13  Michael Meeks  <michael@ximian.com>

	* libnautilus-private/nautilus-icon-dnd.c
	(nautilus_icon_container_free_drag_data):
	re-enterancy protection.
parent cad4a60e
2002-02-17 Michael Meeks <michael@ximian.com>
* libnautilus-private/nautilus-icon-container.c
(nautilus_icon_container_theme_changed): setup both
the rgba and GdkColor variants.
(update_label_color): upd. color handling.
(alloc_colors): allocate the colors on realize
2002-02-15 Michael Meeks <michael@ximian.com>
* libnautilus-private/nautilus-icon-container.c
(nautilus_icon_container_get_label_color): return
the colors we need, grab them from the style's text
information though.
2002-02-14 Michael Meeks <michael@ximian.com>
* libnautilus-private/nautilus-icon-canvas-item.c
(nautilus_icon_canvas_item_get_property),
(nautilus_icon_canvas_item_set_property): port to
properties.
(draw_or_measure_label_text): update color handling,
could we re-use the gc here ?
(draw_stretch_handles): upd gc unref.
(nautilus_icon_canvas_item_class_init): upd.
* libnautilus-private/nautilus-theme.c
(nautilus_pixmap_file_may_be_local),
(nautilus_theme_install_user_theme),
(nautilus_theme_make_preview_pixbuf),
(theme_get_property),
(load_theme_document): upd. file tests.
* libnautilus-private/nautilus-monitor.c
(get_event_uri): use g_build_filename.
* libnautilus-private/nautilus-find-icon-image.c
(get_user_emblem_path, make_full_icon_path),
(make_full_icon_path): upd. file test.
* libnautilus-private/nautilus-file-utilities.c
(nautilus_pixmap_file),
(nautilus_get_data_file_path),
(nautilus_get_user_directory),
(nautilus_get_desktop_directory): upd. file tests.
* libnautilus-private/nautilus-directory-metafile.c
(nautilus_directory_get_boolean_file_metadata): use
strcasecmp not ascii_strdown to save yet more malloc
locking penalty.
* libnautilus-private/nautilus-directory-background.c
(nautilus_file_background_receive_root_window_changes),
(desktop_background_destroyed_callback): upd. root
window macro.
(nautilus_connect_background_to_file_metadata),
(initialize_background_from_settings),
(image_loading_done_callback): upd g_signal bits.
* libnautilus-private/nautilus-volume-monitor.c
(nautilus_volume_monitor_class_init): upd file test.
* libnautilus-private/nautilus-undo-signal-handlers.c
(nautilus_undo_tear_down_nautilus_entry_for_undo): upd.
* libnautilus-private/nautilus-undo-manager.c
(nautilus_undo_manager_class_init): upd. signal bits.
* libnautilus-private/nautilus-trash-monitor.c
(nautilus_trash_monitor_class_init): g_cclosureize.
(nautilus_trash_monitor_init): g_signal upds.
* libnautilus-private/nautilus-trash-file.c
(trash_destroy, nautilus_trash_file_init),
(remove_real_file): upd. g_signal bits.
* libnautilus-private/nautilus-trash-directory.c
(nautilus_trash_directory_init): upd. signal connect.
(trash_destroy): upd. signal bits.
* libnautilus-private/nautilus-program-choosing.c
(get_xalf_prefix): upd. find_program_in_path.
* libnautilus-private/nautilus-program-chooser.c
(nautilus_program_chooser_init): upd. window policy
* libnautilus-private/nautilus-merged-directory.c
(merged_remove_real_directory): upd. g_signal.
(nautilus_merged_directory_class_init): upd. g_closure
* libnautilus-private/nautilus-link-desktop-file.c
(nautilus_link_desktop_file_get_link_icon_from_desktop):
upd. pixmap location.
* libnautilus-private/nautilus-icon-factory.c
(nautilus_icon_factory_class_init): upd. marshallers
(is_theme_in_user_directory): upd. file test.
* libnautilus-private/nautilus-icon-dnd.c
(auto_scroll_timeout_callback): do a queue_draw_area
instead of a widget_draw.
* libnautilus-private/nautilus-icon-container.c
(nautilus_icon_container_init),
(set_pending_icon_to_reveal): g_signal updates.
(nautilus_icon_container_new): remove visual
push/pop.
* libnautilus-private/nautilus-file.c
(nautilus_file_fit_date_as_string): upd. julian date get.
(nautilus_file_class_init): upd. marshallers.
* libnautilus-private/nautilus-file-operations.c
(extract_and_ellipsize_file_name_for_dialog): use
get_basename.
(nautilus_file_operations_copy_move): use gtk stock.
* libnautilus-private/nautilus-file-operations-progress.c
(nautilus_file_operations_progress_update): use
progress_bar_set_fraction.
(nautilus_file_operations_progress_init): prune
progress setup - these are the defaults.
* libnautilus-private/nautilus-entry.c
(nautilus_entry_key_press): upd select_region.
* libnautilus-private/nautilus-drag-window.c
(get_ancestor_blocked_by): upd type_is_a.
* libnautilus-private/nautilus-dnd.c
(nautilus_drag_finalize),
(nautilus_drag_init): g_object ref upd.
* libnautilus-private/nautilus-directory.c
(nautilus_directory_class_init): marshaller upd..
(nautilus_directory_schedule_metadata_remove),
(nautilus_directory_schedule_metadata_copy),
(nautilus_directory_schedule_metadata_move):
basename upd.
* libnautilus-private/nautilus-directory-background.c
(desktop_background_realized): g_signal upd.
(theme_image_path_to_uri): file test upd.
(image_loading_done_callback): object unref on gc & pixmap.
(background_changed_callback): g_signal upd.
* libnautilus-private/nautilus-bookmark.c
(nautilus_bookmark_disconnect_file): g_signal upd.
(nautilus_bookmark_uri_known_not_to_exist): upd
file test.
* libnautilus-private/nautilus-authn-manager.c
(authentication_dialog_button_clicked): use
GTK_RESPONSE_OK
* libnautilus-private/Makefile.am: add deprc.
CFLAGS.
* libnautilus/Makefile.am: ditto.
* configure.in (DISABLE_DEPRECATED_CFLAGS): add.
2002-02-13 Michael Meeks <michael@ximian.com>
* libnautilus-private/nautilus-icon-dnd.c
(nautilus_icon_container_free_drag_data):
re-enterancy protection.
2002-02-17 Kjartan Maraas <kmaraas@gnome.org>
* libnautilus-private/nautilus-icon-container.c: Remove calls to
......
......@@ -295,6 +295,15 @@ AC_SUBST(MUSIC_COMPONENT_CFLAGS)
MUSIC_COMPONENT_LIBS="`$PKG_CONFIG --libs $MUSIC_COMPONENT_MODULES`"
AC_SUBST(MUSIC_COMPONENT_LIBS)
DISABLE_DEPRECATED_CFLAGS=" \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DGNOME_DISABLE_DEPRECATED \
-DBONOBO_DISABLE_DEPRECATED"
AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
dnl ==========================================================================
AC_OUTPUT([
......
......@@ -6,6 +6,7 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(CORE_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \
$(NULL)
......
......@@ -124,7 +124,7 @@ authentication_dialog_button_clicked (GtkDialog *dialog,
{
DEBUG_MSG (("+%s button: %d\n", G_GNUC_FUNCTION, button_number));
if (button_number == GNOME_OK) {
if (button_number == GTK_RESPONSE_OK) {
info->out_args->username
= eel_password_dialog_get_username (EEL_PASSWORD_DIALOG (dialog));
info->out_args->password
......
......@@ -472,7 +472,8 @@ nautilus_bookmark_disconnect_file (NautilusBookmark *bookmark)
g_assert (NAUTILUS_IS_BOOKMARK (bookmark));
if (bookmark->details->file != NULL) {
gtk_signal_disconnect_by_func (GTK_OBJECT (bookmark->details->file),
g_signal_handlers_disconnect_by_func (
bookmark->details->file,
G_CALLBACK (bookmark_file_changed_callback),
bookmark);
nautilus_file_unref (bookmark->details->file);
......@@ -601,7 +602,8 @@ nautilus_bookmark_uri_known_not_to_exist (NautilusBookmark *bookmark)
}
/* Now check if the file exists (sync. call OK because it is local). */
exists = g_file_exists (path_name);
exists = g_file_test (path_name, G_FILE_TEST_EXISTS);
g_free (path_name);
return !exists;
}
......@@ -69,7 +69,8 @@ desktop_background_realized (NautilusIconContainer *icon_container, void *discon
EelBackground *background;
if ((gboolean) GPOINTER_TO_INT (disconnect_signal)) {
gtk_signal_disconnect_by_func (GTK_OBJECT (icon_container),
g_signal_handlers_disconnect_by_func (
icon_container,
G_CALLBACK (desktop_background_realized),
disconnect_signal);
}
......@@ -154,7 +155,7 @@ theme_image_path_to_uri (char *image_file, const char *theme_name)
image_path = g_strdup_printf ("%s/%s", NAUTILUS_DATADIR, image_file);
}
if (image_path && g_file_exists (image_path)) {
if (image_path && g_file_test (image_path, G_FILE_TEST_EXISTS)) {
image_uri = gnome_vfs_get_uri_from_local_path (image_path);
} else {
image_uri = NULL;
......@@ -519,7 +520,9 @@ nautilus_file_background_event_filter (GdkXEvent *gdk_xevent, GdkEvent *event, g
static void
desktop_background_destroyed_callback (EelBackground *background, void *georgeWBush)
{
gdk_window_remove_filter (GDK_ROOT_PARENT(), nautilus_file_background_event_filter, background);
gdk_window_remove_filter (
gdk_get_default_root_window (),
nautilus_file_background_event_filter, background);
}
static void
......@@ -528,7 +531,9 @@ nautilus_file_background_receive_root_window_changes (EelBackground *background)
XWindowAttributes attribs = { 0 };
/* set up a filter on the root window to get notified about property changes */
gdk_window_add_filter (GDK_ROOT_PARENT(), nautilus_file_background_event_filter, background);
gdk_window_add_filter (
gdk_get_default_root_window (),
nautilus_file_background_event_filter, background);
gdk_error_trap_push ();
......@@ -640,7 +645,8 @@ image_loading_done_callback (EelBackground *background, gboolean successful_load
GdkWindow *background_window;
if ((gboolean) GPOINTER_TO_INT (disconnect_signal)) {
gtk_signal_disconnect_by_func (GTK_OBJECT (background),
g_signal_handlers_disconnect_by_func
(background,
G_CALLBACK (image_loading_done_callback),
disconnect_signal);
}
......@@ -651,7 +657,7 @@ image_loading_done_callback (EelBackground *background, gboolean successful_load
pixmap = make_root_pixmap (width, height);
gc = gdk_gc_new (pixmap);
eel_background_draw_to_drawable (background, pixmap, gc, 0, 0, width, height, width, height);
gdk_gc_unref (gc);
g_object_unref (gc);
set_root_pixmap (pixmap);
......@@ -662,7 +668,7 @@ image_loading_done_callback (EelBackground *background, gboolean successful_load
#endif
}
gdk_pixmap_unref (pixmap);
g_object_unref (pixmap);
}
static void
......@@ -753,9 +759,8 @@ background_changed_callback (EelBackground *background,
/* Block the other handler while we are writing metadata so it doesn't
* try to change the background.
*/
gtk_signal_handler_block_by_func (GTK_OBJECT (file),
G_CALLBACK (saved_settings_changed_callback),
background);
g_signal_handlers_block_by_func (
file, G_CALLBACK (saved_settings_changed_callback), background);
nautilus_file_set_metadata (file,
NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR,
......@@ -768,9 +773,8 @@ background_changed_callback (EelBackground *background,
image);
/* Unblock the handler. */
gtk_signal_handler_unblock_by_func (GTK_OBJECT (file),
G_CALLBACK (saved_settings_changed_callback),
background);
g_signal_handlers_unblock_by_func (
file, G_CALLBACK (saved_settings_changed_callback), background);
}
g_free (color);
......@@ -816,7 +820,8 @@ initialize_background_from_settings (NautilusFile *file,
/* Block the other handler while we are responding to changes
* in the metadata so it doesn't try to change the metadata.
*/
gtk_signal_handler_block_by_func (GTK_OBJECT (background),
g_signal_handlers_block_by_func
(background,
G_CALLBACK (background_changed_callback),
file);
......@@ -830,7 +835,8 @@ initialize_background_from_settings (NautilusFile *file,
eel_background_set_image_placement (background, placement);
/* Unblock the handler. */
gtk_signal_handler_unblock_by_func (GTK_OBJECT (background),
g_signal_handlers_unblock_by_func
(background,
G_CALLBACK (background_changed_callback),
file);
......@@ -875,7 +881,8 @@ background_reset_callback (EelBackground *background,
/* Block the other handler while we are writing metadata so it doesn't
* try to change the background.
*/
gtk_signal_handler_block_by_func (GTK_OBJECT (file),
g_signal_handlers_block_by_func (
file,
G_CALLBACK (saved_settings_changed_callback),
background);
......@@ -890,7 +897,8 @@ background_reset_callback (EelBackground *background,
NULL,
NULL);
/* Unblock the handler. */
gtk_signal_handler_unblock_by_func (GTK_OBJECT (file),
g_signal_handlers_unblock_by_func (
file,
G_CALLBACK (saved_settings_changed_callback),
background);
}
......@@ -903,7 +911,8 @@ static void
background_destroyed_callback (EelBackground *background,
NautilusFile *file)
{
gtk_signal_disconnect_by_func (GTK_OBJECT (file),
g_signal_handlers_disconnect_by_func (
file,
G_CALLBACK (saved_settings_changed_callback),
background);
nautilus_file_monitor_remove (file, background);
......@@ -933,16 +942,20 @@ nautilus_connect_background_to_file_metadata (GtkWidget *widget,
/* Disconnect old signal handlers. */
if (old_file != NULL) {
g_assert (NAUTILUS_IS_FILE (old_file));
gtk_signal_disconnect_by_func (GTK_OBJECT (background),
g_signal_handlers_disconnect_by_func
(background,
G_CALLBACK (background_changed_callback),
old_file);
gtk_signal_disconnect_by_func (GTK_OBJECT (background),
g_signal_handlers_disconnect_by_func
(background,
G_CALLBACK (background_destroyed_callback),
old_file);
gtk_signal_disconnect_by_func (GTK_OBJECT (background),
g_signal_handlers_disconnect_by_func
(background,
G_CALLBACK (background_reset_callback),
old_file);
gtk_signal_disconnect_by_func (GTK_OBJECT (old_file),
g_signal_handlers_disconnect_by_func
(old_file,
G_CALLBACK (saved_settings_changed_callback),
background);
nautilus_file_monitor_remove (old_file, background);
......
......@@ -366,10 +366,9 @@ nautilus_directory_get_boolean_file_metadata (NautilusDirectory *directory,
(directory, file_name, key,
default_metadata ? "true" : "false");
g_strdown (result_as_string);
if (strcmp (result_as_string, "true") == 0) {
if (g_ascii_strcasecmp (result_as_string, "true") == 0) {
result = TRUE;
} else if (strcmp (result_as_string, "false") == 0) {
} else if (g_ascii_strcasecmp (result_as_string, "false") == 0) {
result = FALSE;
} else {
if (result_as_string != NULL) {
......
......@@ -90,7 +90,7 @@ nautilus_directory_class_init (NautilusDirectoryClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusDirectoryClass, files_added),
NULL, NULL,
gtk_marshal_VOID__POINTER,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
signals[FILES_CHANGED] =
g_signal_new ("files_changed",
......@@ -98,7 +98,7 @@ nautilus_directory_class_init (NautilusDirectoryClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusDirectoryClass, files_changed),
NULL, NULL,
gtk_marshal_VOID__POINTER,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
signals[DONE_LOADING] =
g_signal_new ("done_loading",
......@@ -106,7 +106,7 @@ nautilus_directory_class_init (NautilusDirectoryClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusDirectoryClass, done_loading),
NULL, NULL,
gtk_marshal_VOID__VOID,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[LOAD_ERROR] =
g_signal_new ("load_error",
......@@ -114,7 +114,7 @@ nautilus_directory_class_init (NautilusDirectoryClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusDirectoryClass, load_error),
NULL, NULL,
gtk_marshal_VOID__INT,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1, G_TYPE_INT);
klass->get_name_for_self_as_new_file = real_get_name_for_self_as_new_file;
......@@ -1301,7 +1301,7 @@ nautilus_directory_schedule_metadata_copy (GList *uri_pairs)
GList *p;
URIPair *pair;
NautilusDirectory *source_directory, *destination_directory;
const char *source_relative_uri, *destination_relative_uri;
char *source_relative_uri, *destination_relative_uri;
for (p = uri_pairs; p != NULL; p = p->next) {
pair = (URIPair *) p->data;
......@@ -1309,14 +1309,17 @@ nautilus_directory_schedule_metadata_copy (GList *uri_pairs)
source_directory = get_parent_directory (pair->from_uri);
destination_directory = get_parent_directory (pair->to_uri);
source_relative_uri = g_basename (pair->from_uri);
destination_relative_uri = g_basename (pair->to_uri);
source_relative_uri = g_path_get_basename (pair->from_uri);
destination_relative_uri = g_path_get_basename (pair->to_uri);
nautilus_directory_copy_file_metadata (source_directory,
source_relative_uri,
destination_directory,
destination_relative_uri);
g_free (source_relative_uri);
g_free (destination_relative_uri);
nautilus_directory_unref (source_directory);
nautilus_directory_unref (destination_directory);
}
......@@ -1328,7 +1331,7 @@ nautilus_directory_schedule_metadata_move (GList *uri_pairs)
GList *p;
URIPair *pair;
NautilusDirectory *source_directory, *destination_directory;
const char *source_relative_uri, *destination_relative_uri;
char *source_relative_uri, *destination_relative_uri;
for (p = uri_pairs; p != NULL; p = p->next) {
pair = (URIPair *) p->data;
......@@ -1336,8 +1339,8 @@ nautilus_directory_schedule_metadata_move (GList *uri_pairs)
source_directory = get_parent_directory (pair->from_uri);
destination_directory = get_parent_directory (pair->to_uri);
source_relative_uri = g_basename (pair->from_uri);
destination_relative_uri = g_basename (pair->to_uri);
source_relative_uri = g_path_get_basename (pair->from_uri);
destination_relative_uri = g_path_get_basename (pair->to_uri);
nautilus_directory_copy_file_metadata (source_directory,
source_relative_uri,
......@@ -1346,6 +1349,9 @@ nautilus_directory_schedule_metadata_move (GList *uri_pairs)
nautilus_directory_remove_file_metadata (source_directory,
source_relative_uri);
g_free (source_relative_uri);
g_free (destination_relative_uri);
nautilus_directory_unref (source_directory);
nautilus_directory_unref (destination_directory);
}
......@@ -1357,17 +1363,19 @@ nautilus_directory_schedule_metadata_remove (GList *uris)
GList *p;
const char *uri;
NautilusDirectory *directory;
const char *relative_uri;
char *relative_uri;
for (p = uris; p != NULL; p = p->next) {
uri = (const char *) p->data;
directory = get_parent_directory (uri);
relative_uri = g_basename (uri);
relative_uri = g_path_get_basename (uri);
nautilus_directory_remove_file_metadata (directory,
relative_uri);
g_free (relative_uri);
nautilus_directory_unref (directory);
}
}
......
......@@ -68,14 +68,15 @@
void
nautilus_drag_init (NautilusDragInfo *drag_info,
const GtkTargetEntry *drag_types, int drag_type_count,
const GtkTargetEntry *drag_types,
int drag_type_count,
GdkBitmap *stipple)
{
drag_info->target_list = gtk_target_list_new (drag_types,
drag_type_count);
if (stipple != NULL) {
drag_info->stipple = gdk_bitmap_ref (stipple);
drag_info->stipple = g_object_ref (stipple);
}
drag_info->drop_occured = FALSE;
......@@ -89,7 +90,7 @@ nautilus_drag_finalize (NautilusDragInfo *drag_info)
nautilus_drag_destroy_selection_list (drag_info->selection_list);
if (drag_info->stipple != NULL) {
gdk_bitmap_unref (drag_info->stipple);
g_object_unref (drag_info->stipple);
}
g_free (drag_info);
......
......@@ -65,18 +65,19 @@ static Atom sawfish_wm_raise_window = 0;
*/
static GtkWidget *
get_ancestor_blocked_by (GtkWidget *widget,
GtkType widget_type,
GtkType blocking_type)
GType widget_type,
GType blocking_type)
{
g_return_val_if_fail (widget != NULL, NULL);
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
while (widget != NULL)
{
if (gtk_type_is_a (GTK_WIDGET_TYPE (widget), widget_type))
if (g_type_is_a (GTK_WIDGET_TYPE (widget), widget_type))
return widget;
else if (gtk_type_is_a (GTK_WIDGET_TYPE (widget), blocking_type))
else if (g_type_is_a (GTK_WIDGET_TYPE (widget), blocking_type))
return NULL;
widget = widget->parent;
}
......
......@@ -139,7 +139,7 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
*/
if (entry->details->special_tab_handling && gtk_editable_get_selection_bounds (editable, NULL, NULL)) {
position = strlen (gtk_entry_get_text (GTK_ENTRY (editable)));
gtk_entry_select_region (GTK_ENTRY (editable), position, position);
gtk_editable_select_region (editable, position, position);
return TRUE;
}
break;
......@@ -424,7 +424,7 @@ nautilus_entry_class_init (NautilusEntryClass *class)
G_STRUCT_OFFSET (NautilusEntryClass,
user_changed),
NULL, NULL,
gtk_marshal_VOID__VOID,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[SELECTION_CHANGED] = g_signal_new
("selection_changed",
......@@ -433,7 +433,7 @@ nautilus_entry_class_init (NautilusEntryClass *class)
G_STRUCT_OFFSET (NautilusEntryClass,
selection_changed),
NULL, NULL,
gtk_marshal_VOID__VOID,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
......
......@@ -97,9 +97,9 @@ nautilus_file_operations_progress_update (NautilusFileOperationsProgress *progre
return;
}
gtk_progress_configure (GTK_PROGRESS (progress->details->progress_bar),
progress->details->bytes_copied,
0.0,
gtk_progress_bar_set_fraction
(GTK_PROGRESS_BAR (progress->details->progress_bar),
(double) progress->details->bytes_copied /
progress->details->bytes_total);
}
......@@ -240,11 +240,9 @@ nautilus_file_operations_progress_init (NautilusFileOperationsProgress *progress
/* progress bar */
progress->details->progress_bar = gtk_progress_bar_new ();
gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (progress->details->progress_bar),
GTK_PROGRESS_CONTINUOUS);
gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (progress->details->progress_bar),
GTK_PROGRESS_LEFT_TO_RIGHT);
#ifdef GNOME2_CONVERSION_COMPLETE
gtk_widget_set_usize (progress->details->progress_bar, PROGRESS_BAR_WIDTH, -1);
#endif
gtk_box_pack_start (vbox, progress->details->progress_bar, FALSE, TRUE, 0);
gtk_widget_show (progress->details->progress_bar);
......
......@@ -25,6 +25,7 @@
*/
#include <config.h>
#include <string.h>
#include "nautilus-file-operations.h"
#include "nautilus-file-operations-progress.h"
......@@ -269,15 +270,16 @@ format_and_ellipsize_uri_for_dialog (const char *uri)
static char *
extract_and_ellipsize_file_name_for_dialog (const char *uri)
{
const char *last_part;
char *basename;
char *unescaped, *result;
last_part = g_basename (uri);
g_return_val_if_fail (last_part != NULL, NULL);
basename = g_path_get_basename (uri);
g_return_val_if_fail (basename != NULL, NULL);
unescaped = gnome_vfs_unescape_string_for_display (last_part);
unescaped = gnome_vfs_unescape_string_for_display (basename);
result = ellipsize_string_for_dialog (unescaped);
g_free (unescaped);
g_free (basename);
return result;
}
......@@ -292,6 +294,8 @@ parent_for_error_dialog (TransferInfo *transfer_info)
return transfer_info->parent_view;
}
#ifdef GNOME2_CONVERSION_COMPLETE
/* This needs testing with a working WM - metacity ? */
static void
fit_rect_on_screen (GdkRectangle *rect)
{
......@@ -325,10 +329,12 @@ center_dialog_over_rect (GtkWindow *window, GdkRectangle rect)
rect.y + rect.height / 2
- GTK_WIDGET (window)->allocation.height / 2);
}
#endif
static void
center_dialog_over_window (GtkWindow *window, GtkWindow *over)
{
#ifdef GNOME2_CONVERSION_COMPLETE
GdkRectangle rect;
int x, y, w, h;
......@@ -343,6 +349,15 @@ center_dialog_over_window (GtkWindow *window, GtkWindow *over)
rect.height = h;
center_dialog_over_rect (window, rect);
#endif
GdkGeometry geometry = { 0 };
geometry.win_gravity = GDK_GRAVITY_CENTER;
gtk_window_set_geometry_hints (window,
GTK_WIDGET (over),
&geometry,
GDK_HINT_WIN_GRAVITY);
}
static void
......@@ -1968,7 +1983,7 @@ nautilus_file_operations_copy_move (const GList *item_uris,
FALSE,
_("You cannot copy items into the Trash."),
_("Can't Copy to Trash"),
GNOME_STOCK_BUTTON_OK, NULL, NULL);
GTK_STOCK_OK, NULL);
result = GNOME_VFS_ERROR_NOT_PERMITTED;
}
}
......@@ -2002,7 +2017,7 @@ nautilus_file_operations_copy_move (const GList *item_uris,
((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("Can't Change Trash Location")
: _("Can't Copy Trash"),
GNOME_STOCK_BUTTON_OK, NULL, NULL);
GTK_STOCK_OK, NULL, NULL);
result = GNOME_VFS_ERROR_NOT_PERMITTED;
break;
......@@ -2029,7 +2044,7 @@ nautilus_file_operations_copy_move (const GList *item_uris,
((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("Can't Move Into Self")
: _("Can't Copy Into Self"),
GNOME_STOCK_BUTTON_OK, NULL, NULL);
GTK_STOCK_OK, NULL, NULL);
result = GNOME_VFS_ERROR_NOT_PERMITTED;
break;
......@@ -2042,7 +2057,7 @@ nautilus_file_operations_copy_move (const GList *item_uris,
FALSE,
_("You cannot copy a file over itself."),
_("Can't Copy Over Self"),
GNOME_STOCK_BUTTON_OK, NULL, NULL);
GTK_STOCK_OK, NULL, NULL);
result = GNOME_VFS_ERROR_NOT_PERMITTED;
break;
......@@ -2302,7 +2317,7 @@ confirm_empty_trash (GtkWidget *parent_view)
"all of the items in the Trash?"),
_("Delete Trash Contents?"),
_("Empty"),
GNOME_STOCK_BUTTON_CANCEL,
GTK_STOCK_CANCEL,
parent_window);