Commit 92312a5f authored by Darin Adler's avatar Darin Adler

reviewed by: Pavel Cisler <pavel@eazel.com>

	More loose ends of the file copy and paste feature.

	* libnautilus-extensions/nautilus-directory-notify.h:
	Rename NautilusFileChangesQueuePositionSetting to
	NautilusFileChangesQueuePosition. Add a field so it can
	be used to set or remove a position. Rename
	nautilus_directory_schedule_position_setting to
	nautilus_directory_schedule_position_set.

	* libnautilus-extensions/nautilus-directory.c:
	(nautilus_directory_schedule_position_set): Change name and also
	make it handle the case where we want to remove a position rather
	than setting it.

	* libnautilus-extensions/nautilus-file-changes-queue.h:
	* libnautilus-extensions/nautilus-file-changes-queue.c:
	(nautilus_file_changes_queue_schedule_position_set): Name change.
	(nautilus_file_changes_queue_schedule_position_remove): New
	function used to remove a position.
	(position_set_list_free): Name changes, added the new remove
	flavor where needed.
	(nautilus_file_changes_consume_changes): Updated SET case,
	added case for REMOVE.

	* libnautilus-extensions/nautilus-file-operations.c:
	(icon_position_iterator_get_next): New function, used to extract
	the next position out of the iterator.
	(apply_one_position): Simplified by using
	icon_position_iterator_get_next, and also changed so that the
	position is always either removed or set.

	* libnautilus-extensions/nautilus-file-operations.h: Fixed header.

	* libnautilus-extensions/nautilus-gtk-extensions.h:
	* libnautilus-extensions/nautilus-gtk-extensions.c:
	(event_get_time), (nautilus_get_current_event_time): Add new
	function to get the current event time. This is available in GTK
	2.0, so we can remove it when we move up.

	* libnautilus-extensions/nautilus-link.c:
	(nautilus_link_local_create): Updated for change to notify API.

	* libnautilus-extensions/nautilus-program-choosing.c:
	(nautilus_launch_application_from_command): Added FIXME.

	* src/file-manager/fm-directory-view.c: (copy_or_cut_files): Use
	new nautilus_get_current_event_time function. Put up a status
	string about the cut or copy. Since there's no other feedback this
	is especially important.
	(paste_files_callback): Use new nautilus_get_current_event_time
	function.
	(real_selection_clear_event): Erase the status string.
	(real_selection_received): Put up a status string if the paste
	does nothing. Since we can't desensitize the Paste Files command,
	this is the next best thing.
parent a62c1cdb
2001-03-23 Darin Adler <darin@eazel.com>
reviewed by: Pavel Cisler <pavel@eazel.com>
More loose ends of the file copy and paste feature.
* libnautilus-extensions/nautilus-directory-notify.h:
Rename NautilusFileChangesQueuePositionSetting to
NautilusFileChangesQueuePosition. Add a field so it can
be used to set or remove a position. Rename
nautilus_directory_schedule_position_setting to
nautilus_directory_schedule_position_set.
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_schedule_position_set): Change name and also
make it handle the case where we want to remove a position rather
than setting it.
* libnautilus-extensions/nautilus-file-changes-queue.h:
* libnautilus-extensions/nautilus-file-changes-queue.c:
(nautilus_file_changes_queue_schedule_position_set): Name change.
(nautilus_file_changes_queue_schedule_position_remove): New
function used to remove a position.
(position_set_list_free): Name changes, added the new remove
flavor where needed.
(nautilus_file_changes_consume_changes): Updated SET case,
added case for REMOVE.
* libnautilus-extensions/nautilus-file-operations.c:
(icon_position_iterator_get_next): New function, used to extract
the next position out of the iterator.
(apply_one_position): Simplified by using
icon_position_iterator_get_next, and also changed so that the
position is always either removed or set.
* libnautilus-extensions/nautilus-file-operations.h: Fixed header.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(event_get_time), (nautilus_get_current_event_time): Add new
function to get the current event time. This is available in GTK
2.0, so we can remove it when we move up.
* libnautilus-extensions/nautilus-link.c:
(nautilus_link_local_create): Updated for change to notify API.
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application_from_command): Added FIXME.
* src/file-manager/fm-directory-view.c: (copy_or_cut_files): Use
new nautilus_get_current_event_time function. Put up a status
string about the cut or copy. Since there's no other feedback this
is especially important.
(paste_files_callback): Use new nautilus_get_current_event_time
function.
(real_selection_clear_event): Erase the status string.
(real_selection_received): Put up a status string if the paste
does nothing. Since we can't desensitize the Paste Files command,
this is the next best thing.
2001-03-23 Darin Adler <darin@eazel.com>
reviewed by: John Sullivan <sullivan@eazel.com>
......
......@@ -33,22 +33,22 @@ typedef struct {
typedef struct {
char *uri;
gboolean set;
GdkPoint point;
} NautilusFileChangesQueuePositionSetting;
} NautilusFileChangesQueuePosition;
/* Almost-public change notification calls */
void nautilus_directory_notify_files_added (GList *uris);
void nautilus_directory_notify_files_moved (GList *uri_pairs);
void nautilus_directory_notify_files_removed (GList *uris);
void nautilus_directory_schedule_metadata_copy (GList *uri_pairs);
void nautilus_directory_schedule_metadata_move (GList *uri_pairs);
void nautilus_directory_schedule_metadata_remove (GList *uris);
void nautilus_directory_schedule_position_setting (GList *position_setting_list);
void nautilus_directory_notify_files_added (GList *uris);
void nautilus_directory_notify_files_moved (GList *uri_pairs);
void nautilus_directory_notify_files_removed (GList *uris);
void nautilus_directory_schedule_metadata_copy (GList *uri_pairs);
void nautilus_directory_schedule_metadata_move (GList *uri_pairs);
void nautilus_directory_schedule_metadata_remove (GList *uris);
void nautilus_directory_schedule_position_set (GList *position_setting_list);
/* Change notification hack.
* This is called when code modifies the file and it needs to trigger
* a notification. Eventually this should become private, but for now
* it needs to be used for code like the thumbnail generation.
*/
void nautilus_file_changed (NautilusFile *file);
void nautilus_file_changed (NautilusFile *file);
......@@ -1420,19 +1420,24 @@ nautilus_directory_schedule_metadata_remove (GList *uris)
}
void
nautilus_directory_schedule_position_setting (GList *position_setting_list)
nautilus_directory_schedule_position_set (GList *position_setting_list)
{
GList *p;
const NautilusFileChangesQueuePositionSetting *item;
const NautilusFileChangesQueuePosition *item;
NautilusFile *file;
char *position_string;
for (p = position_setting_list; p != NULL; p = p->next) {
item = (const NautilusFileChangesQueuePositionSetting *) p->data;
item = (NautilusFileChangesQueuePosition *) p->data;
file = nautilus_file_get (item->uri);
position_string = g_strdup_printf ("%d,%d", item->point.x, item->point.y);
if (item->set) {
position_string = g_strdup_printf ("%d,%d",
item->point.x, item->point.y);
} else {
position_string = NULL;
}
nautilus_file_set_metadata
(file,
NAUTILUS_METADATA_KEY_ICON_POSITION,
......@@ -1444,7 +1449,6 @@ nautilus_directory_schedule_position_setting (GList *position_setting_list)
}
}
gboolean
nautilus_directory_contains_file (NautilusDirectory *directory,
NautilusFile *file)
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-directory.h: Nautilus directory model.
Copyright (C) 1999, 2000 Eazel, Inc.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
......@@ -23,9 +21,9 @@
*/
#include <config.h>
#include "nautilus-file-changes-queue.h"
#include "nautilus-directory-notify.h"
#include "nautilus-file-changes-queue.h"
#include "nautilus-glib-extensions.h"
#ifdef G_THREADS_ENABLED
......@@ -44,7 +42,8 @@ typedef enum {
CHANGE_METADATA_COPIED,
CHANGE_METADATA_MOVED,
CHANGE_METADATA_REMOVED,
CHANGE_POSITION_SET
CHANGE_POSITION_SET,
CHANGE_POSITION_REMOVE
} NautilusFileChangeKind;
typedef struct {
......@@ -227,8 +226,8 @@ nautilus_file_changes_queue_schedule_metadata_remove (const char *uri)
}
void
nautilus_file_changes_queue_schedule_position_setting (const char *uri,
GdkPoint point)
nautilus_file_changes_queue_schedule_position_set (const char *uri,
GdkPoint point)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
......@@ -242,6 +241,20 @@ nautilus_file_changes_queue_schedule_position_setting (const char *uri,
nautilus_file_changes_queue_add_common (queue, new_item);
}
void
nautilus_file_changes_queue_schedule_position_remove (const char *uri)
{
NautilusFileChange *new_item;
NautilusFileChangesQueue *queue;
queue = nautilus_file_changes_queue_get ();
new_item = g_new (NautilusFileChange, 1);
new_item->kind = CHANGE_POSITION_REMOVE;
new_item->from_uri = g_strdup (uri);
nautilus_file_changes_queue_add_common (queue, new_item);
}
static NautilusFileChange *
nautilus_file_changes_queue_get_change (NautilusFileChangesQueue *queue)
{
......@@ -293,10 +306,10 @@ pairs_list_free (GList *pairs)
}
static void
position_setting_list_free (GList *list)
position_set_list_free (GList *list)
{
GList *p;
NautilusFileChangesQueuePositionSetting *item;
NautilusFileChangesQueuePosition *item;
for (p = list; p != NULL; p = p->next) {
item = p->data;
......@@ -315,9 +328,9 @@ nautilus_file_changes_consume_changes (gboolean consume_all)
NautilusFileChange *change;
GList *additions, *deletions, *moves;
GList *metadata_copy_requests, *metadata_move_requests, *metadata_remove_requests;
GList *position_setting_requests;
GList *position_set_requests;
URIPair *pair;
NautilusFileChangesQueuePositionSetting *position_setting;
NautilusFileChangesQueuePosition *position_set;
guint chunk_count;
NautilusFileChangesQueue *queue;
gboolean flush_needed;
......@@ -329,7 +342,7 @@ nautilus_file_changes_consume_changes (gboolean consume_all)
metadata_copy_requests = NULL;
metadata_move_requests = NULL;
metadata_remove_requests = NULL;
position_setting_requests = NULL;
position_set_requests = NULL;
queue = nautilus_file_changes_queue_get();
......@@ -347,51 +360,56 @@ nautilus_file_changes_consume_changes (gboolean consume_all)
flush_needed = TRUE;
/* no changes left, flush everything */
} else {
flush_needed = (additions != NULL
&& (change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_POSITION_SET));
flush_needed |= (moves != NULL
&& (change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_MOVED
&& change->kind != CHANGE_POSITION_SET));
flush_needed |= (deletions != NULL
&& (change->kind != CHANGE_FILE_REMOVED
&& change->kind != CHANGE_METADATA_REMOVED));
flush_needed |= (metadata_copy_requests != NULL
&& (change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_POSITION_SET));
flush_needed |= (metadata_move_requests != NULL
&& (change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_MOVED
&& change->kind != CHANGE_POSITION_SET));
flush_needed = additions != NULL
&& change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE;
flush_needed |= moves != NULL
&& change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_MOVED
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE;
flush_needed |= deletions != NULL
&& change->kind != CHANGE_FILE_REMOVED
&& change->kind != CHANGE_METADATA_REMOVED;
flush_needed |= metadata_copy_requests != NULL
&& change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE;
flush_needed |= metadata_move_requests != NULL
&& change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_MOVED
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE;
flush_needed |= (metadata_remove_requests != NULL
&& (change->kind != CHANGE_FILE_REMOVED
&& change->kind != CHANGE_METADATA_REMOVED));
flush_needed |= metadata_remove_requests != NULL
&& change->kind != CHANGE_FILE_REMOVED
&& change->kind != CHANGE_METADATA_REMOVED;
flush_needed |= (position_setting_requests != NULL
&& (change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_METADATA_MOVED));
flush_needed |= position_set_requests != NULL
&& change->kind != CHANGE_POSITION_SET
&& change->kind != CHANGE_POSITION_REMOVE
&& change->kind != CHANGE_FILE_ADDED
&& change->kind != CHANGE_FILE_MOVED
&& change->kind != CHANGE_METADATA_COPIED
&& change->kind != CHANGE_METADATA_MOVED;
flush_needed |= !consume_all && chunk_count >= CONSUME_CHANGES_MAX_CHUNK;
/* we have reached the chunk maximum */
}
if (flush_needed) {
/* Send changes we collected off.
* At one time we may only have one of the lists
* contain changes.
*/
if (deletions != NULL) {
nautilus_directory_notify_files_removed (deletions);
nautilus_g_list_free_deep (deletions);
......@@ -422,10 +440,10 @@ nautilus_file_changes_consume_changes (gboolean consume_all)
nautilus_g_list_free_deep (metadata_remove_requests);
metadata_remove_requests = NULL;
}
if (position_setting_requests != NULL) {
nautilus_directory_schedule_position_setting (position_setting_requests);
position_setting_list_free (position_setting_requests);
position_setting_requests = NULL;
if (position_set_requests != NULL) {
nautilus_directory_schedule_position_set (position_set_requests);
position_set_list_free (position_set_requests);
position_set_requests = NULL;
}
}
......@@ -471,11 +489,20 @@ nautilus_file_changes_consume_changes (gboolean consume_all)
break;
case CHANGE_POSITION_SET:
position_setting = g_new (NautilusFileChangesQueuePositionSetting, 1);
position_setting->uri = change->from_uri;
position_setting->point = change->point;
position_setting_requests = g_list_append (position_setting_requests,
position_setting);
position_set = g_new (NautilusFileChangesQueuePosition, 1);
position_set->uri = change->from_uri;
position_set->set = TRUE;
position_set->point = change->point;
position_set_requests = g_list_append (position_set_requests,
position_set);
break;
case CHANGE_POSITION_REMOVE:
position_set = g_new (NautilusFileChangesQueuePosition, 1);
position_set->uri = change->from_uri;
position_set->set = FALSE;
position_set_requests = g_list_append (position_set_requests,
position_set);
break;
default:
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-directory.h: Nautilus directory model.
Copyright (C) 1999, 2000 Eazel, Inc.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
......@@ -25,20 +23,21 @@
#ifndef NAUTILUS_FILE_CHANGES_QUEUE_H
#define NAUTILUS_FILE_CHANGES_QUEUE_H
#include <glib.h>
#include <gdk/gdktypes.h>
void nautilus_file_changes_queue_file_added (const char *uri);
void nautilus_file_changes_queue_file_removed (const char *uri);
void nautilus_file_changes_queue_file_moved (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_copy (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_move (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_remove (const char *uri);
void nautilus_file_changes_queue_schedule_position_setting (const char *uri,
GdkPoint point);
void nautilus_file_changes_queue_file_added (const char *uri);
void nautilus_file_changes_queue_file_removed (const char *uri);
void nautilus_file_changes_queue_file_moved (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_copy (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_move (const char *from_uri,
const char *to_uri);
void nautilus_file_changes_queue_schedule_metadata_remove (const char *uri);
void nautilus_file_changes_queue_schedule_position_set (const char *uri,
GdkPoint point);
void nautilus_file_changes_queue_schedule_position_remove (const char *uri);
void nautilus_file_changes_consume_changes (gboolean consume_all);
void nautilus_file_changes_consume_changes (gboolean consume_all);
#endif /* NAUTILUS_FILE_CHANGES_QUEUE_H */
......@@ -20,9 +20,8 @@
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors:
Ettore Perazzoli <ettore@gnu.org>
Pavel Cisler <pavel@eazel.com>
Authors: Ettore Perazzoli <ettore@gnu.org>
Pavel Cisler <pavel@eazel.com>
*/
#include <config.h>
......@@ -127,13 +126,11 @@ icon_position_iterator_new (GArray *icon_positions, const GList *uris)
g_assert (icon_positions->len == g_list_length ((GList *)uris));
result = g_new (IconPositionIterator, 1);
result->icon_positions = g_new (GdkPoint, icon_positions->len);
/* make our own copy of the icon locations */
result->icon_positions = g_new (GdkPoint, icon_positions->len);
for (index = 0; index < icon_positions->len; index++) {
result->icon_positions[index] = g_array_index (icon_positions, GdkPoint, index);
}
result->last_icon_position_index = 0;
result->uris = nautilus_g_str_list_copy ((GList *)uris);
......@@ -154,6 +151,48 @@ icon_position_iterator_free (IconPositionIterator *position_iterator)
g_free (position_iterator);
}
static gboolean
icon_position_iterator_get_next (IconPositionIterator *position_iterator,
const char *next_uri,
GdkPoint *point)
{
if (position_iterator == NULL) {
return FALSE;
}
for (;;) {
if (position_iterator->last_uri == NULL) {
/* we are done, no more points left */
return FALSE;
}
/* Scan for the next point that matches the source_name
* uri.
*/
if (strcmp ((const char *) position_iterator->last_uri->data,
next_uri) == 0) {
break;
}
/* Didn't match -- a uri must have been skipped by the copy
* engine because of a name conflict. All we need to do is
* skip ahead too.
*/
position_iterator->last_uri = position_iterator->last_uri->next;
position_iterator->last_icon_position_index++;
}
/* apply the location to the target file */
*point = position_iterator->icon_positions
[position_iterator->last_icon_position_index];
/* advance to the next point for next time */
position_iterator->last_uri = position_iterator->last_uri->next;
position_iterator->last_icon_position_index++;
return TRUE;
}
/* Hack to get the GdkFont used by a GtkLabel in an error dialog.
* We need to do this because the string truncation needs to be
* done before a dialog is instantiated.
......@@ -1492,45 +1531,16 @@ update_transfer_callback (GnomeVFSAsyncHandle *handle,
static void
apply_one_position (IconPositionIterator *position_iterator,
const char *source_name, const char *target_name)
const char *source_name,
const char *target_name)
{
const char *item_uri;
if (position_iterator == NULL || position_iterator->last_uri == NULL) {
return;
}
for (;;) {
/* Scan for the next point that matches the source_name
* uri.
*/
if (strcmp ((const char *)position_iterator->last_uri->data,
source_name) == 0) {
break;
}
/* Didn't match -- a uri must have been skipped by the copy
* engine because of a name conflict. All we need to do is
* skip ahead too.
*/
position_iterator->last_uri = position_iterator->last_uri->next;
position_iterator->last_icon_position_index++;
GdkPoint point;
if (position_iterator->last_uri == NULL) {
/* we are done, no more points left */
return;
}
if (icon_position_iterator_get_next (position_iterator, source_name, &point)) {
nautilus_file_changes_queue_schedule_position_set (target_name, point);
} else {
nautilus_file_changes_queue_schedule_position_remove (target_name);
}
item_uri = target_name != NULL ? target_name : source_name;
/* apply the location to the target file */
nautilus_file_changes_queue_schedule_position_setting (target_name,
position_iterator->icon_positions
[position_iterator->last_icon_position_index]);
/* advance to the next point for next time */
position_iterator->last_uri = position_iterator->last_uri->next;
position_iterator->last_icon_position_index++;
}
typedef struct {
......@@ -1570,7 +1580,8 @@ sync_transfer_callback (GnomeVFSXferProgressInfo *progress_info, gpointer data)
nautilus_file_changes_queue_schedule_metadata_copy
(progress_info->source_name, progress_info->target_name);
apply_one_position (position_iterator, progress_info->source_name,
apply_one_position (position_iterator,
progress_info->source_name,
progress_info->target_name);
}
if (debuting_uris != NULL) {
......@@ -1587,7 +1598,8 @@ sync_transfer_callback (GnomeVFSXferProgressInfo *progress_info, gpointer data)
nautilus_file_changes_queue_schedule_metadata_move
(progress_info->source_name, progress_info->target_name);
apply_one_position (position_iterator, progress_info->source_name,
apply_one_position (position_iterator,
progress_info->source_name,
progress_info->target_name);
if (debuting_uris != NULL) {
......
......@@ -3,6 +3,7 @@
/* nautilus-file-operations: execute file operations.
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
......@@ -19,7 +20,8 @@
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Ettore Perazzoli <ettore@gnu.org>
Authors: Ettore Perazzoli <ettore@gnu.org>,
Pavel Cisler <pavel@eazel.com>
*/
#ifndef NAUTILUS_FILE_OPERATIONS_H
......
......@@ -33,6 +33,7 @@
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
#include <gdk/gdkx.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkselection.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkrc.h>
......@@ -2052,3 +2053,71 @@ nautilus_get_window_list_ordered_front_to_back (void)
return windows;
}
static guint
event_get_time (GdkEvent *event)
{
if (event != NULL) {
switch (event->type) {
case GDK_MOTION_NOTIFY:
return event->motion.time;
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
return event->button.time;
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
return event->key.time;
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
return event->crossing.time;
case GDK_PROPERTY_NOTIFY:
return event->property.time;
case GDK_SELECTION_CLEAR:
case GDK_SELECTION_REQUEST:
case GDK_SELECTION_NOTIFY:
return event->selection.time;
case GDK_PROXIMITY_IN:
case GDK_PROXIMITY_OUT:
return event->proximity.time;
case GDK_DRAG_ENTER:
case GDK_DRAG_LEAVE:
case GDK_DRAG_MOTION:
case GDK_DRAG_STATUS:
case GDK_DROP_START:
case GDK_DROP_FINISHED:
return event->dnd.time;
case GDK_CLIENT_EVENT:
case GDK_VISIBILITY_NOTIFY:
case GDK_NO_EXPOSE:
case GDK_CONFIGURE:
case GDK_FOCUS_CHANGE:
case GDK_NOTHING:
case GDK_DELETE:
case GDK_DESTROY:
case GDK_EXPOSE:
case GDK_MAP:
case GDK_UNMAP:
/* return current time */
break;
}
}
return GDK_CURRENT_TIME;
}
guint
nautilus_get_current_event_time (void)
{
GdkEvent *event;
guint time;
event = gtk_get_current_event ();
time = event_get_time (event);
if (event != NULL) {
gdk_event_free (event);
}
return time;
}
......@@ -103,6 +103,7 @@ void nautilus_gtk_widget_set_background_color (GtkWidge
void nautilus_gtk_widget_set_foreground_color (GtkWidget *widget,
const char *color_spec);
GtkWidget *nautilus_gtk_widget_find_windowed_ancestor (GtkWidget *widget);
guint nautilus_get_current_event_time (void);
/* GtkContainer */
GtkWidget *nautilus_gtk_container_get_first_child (GtkContainer *container);
......
......@@ -2,7 +2,7 @@
nautilus-link.c: xml-based link files.
Copyright (C) 1999, 2000 Eazel, Inc.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
......@@ -111,7 +111,7 @@ nautilus_link_local_create (const char *directory_path,
int result;
char *uri;
GList dummy_list;
NautilusFileChangesQueuePositionSetting item;
NautilusFileChangesQueuePosition item;
g_return_val_if_fail (directory_path != NULL, FALSE);
......@@ -151,17 +151,19 @@ nautilus_link_local_create (const char *directory_path,
dummy_list.next = NULL;
dummy_list.prev = NULL;
nautilus_directory_notify_files_added (&dummy_list);
nautilus_directory_schedule_metadata_remove (&dummy_list);
if (point != NULL) {
item.uri = uri;
item.set = TRUE;
item.point.x = point->x;
item.point.y = point->y;
item.uri = uri;
dummy_list.data = &item;
dummy_list.next = NULL;
dummy_list.prev = NULL;
nautilus_directory_schedule_position_setting (&dummy_list);
nautilus_directory_schedule_position_set (&dummy_list);
}
g_free (uri);
......
......@@ -611,6 +611,12 @@ nautilus_launch_application_from_command (const char *command_string,
char *quoted_full_command;
char *final_command;
/* FIXME bugzilla.eazel.com 7830: This needs to support things
* like the "xalf" hack. Perhaps the best way to do that is
* to use gnome_desktop_entry_launch_with_args instead of
* calling system or nautilus_gnome_open_terminal.
*/