1999-02-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gdesktop.c (desktop_drag_data_received): Simplify. * gscreen.c (panel_icon_list_drag_data_received): Pass the full path to gdnd_perform_drop. (panel_clist_drag_data_received): same. * gdnd.c (drop_on_directory): We no longer take a file_entry here. The directory we get passed is already a fully qualified name of the target location. * gwidget.c (x_create_input): Hook to the changed signal and sync the input with our view of the entry. This fixes the paste bug reported.
Этот коммит содержится в:
родитель
3e9b39c9e1
Коммит
ca444518b8
@ -1,3 +1,19 @@
|
||||
1999-02-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* gdesktop.c (desktop_drag_data_received): Simplify.
|
||||
|
||||
* gscreen.c (panel_icon_list_drag_data_received): Pass the full
|
||||
path to gdnd_perform_drop.
|
||||
(panel_clist_drag_data_received): same.
|
||||
|
||||
* gdnd.c (drop_on_directory): We no longer take a file_entry
|
||||
here. The directory we get passed is already a fully qualified
|
||||
name of the target location.
|
||||
|
||||
* gwidget.c (x_create_input): Hook to the changed signal and sync
|
||||
the input with our view of the entry. This fixes the paste bug
|
||||
reported.
|
||||
|
||||
Tue Feb 23 01:57:22 1999 George Lebl <jirka@5z.com>
|
||||
|
||||
* gmount.c: fix obvious typos, use str in option_has_user, fix
|
||||
|
@ -1991,20 +1991,14 @@ desktop_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x,
|
||||
drop_desktop_icons (context, data, x, y);
|
||||
else {
|
||||
file_entry *desktop_fe;
|
||||
char *directory, *p;
|
||||
|
||||
desktop_fe = file_entry_from_file (desktop_directory);
|
||||
if (!desktop_fe)
|
||||
return; /* eeek */
|
||||
|
||||
p = strrchr (desktop_directory, PATH_SEP);
|
||||
g_assert (p);
|
||||
directory = g_strndup (desktop_directory, p - desktop_directory);
|
||||
|
||||
if (gdnd_perform_drop (context, data, directory, desktop_fe))
|
||||
if (gdnd_perform_drop (context, data, desktop_directory, desktop_fe))
|
||||
desktop_reload_icons (TRUE, x, y);
|
||||
|
||||
g_free (directory);
|
||||
file_entry_free (desktop_fe);
|
||||
}
|
||||
}
|
||||
|
13
gnome/gdnd.c
13
gnome/gdnd.c
@ -290,23 +290,20 @@ drop_url_on_directory (GdkDragContext *context, GtkSelectionData *selection_data
|
||||
/* Drop stuff on a directory */
|
||||
static int
|
||||
drop_on_directory (GdkDragContext *context, GtkSelectionData *selection_data,
|
||||
GdkDragAction action, char *directory, file_entry *dest_fe)
|
||||
GdkDragAction action, char *directory)
|
||||
{
|
||||
char *full_name;
|
||||
int retval;
|
||||
|
||||
retval = FALSE;
|
||||
full_name = g_concat_dir_and_file (directory, dest_fe->fname);
|
||||
|
||||
if (gdnd_drag_context_has_target (context, TARGET_URI_LIST)) {
|
||||
drop_uri_list_on_directory (context, selection_data, action, full_name);
|
||||
drop_uri_list_on_directory (context, selection_data, action, directory);
|
||||
retval = TRUE;
|
||||
} else if (gdnd_drag_context_has_target (context, TARGET_URL)) {
|
||||
drop_url_on_directory (context, selection_data, full_name);
|
||||
drop_url_on_directory (context, selection_data, directory);
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
g_free (full_name);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -337,7 +334,7 @@ drop_on_file (GdkDragContext *context, GtkSelectionData *selection_data,
|
||||
|
||||
mime_type = gnome_mime_type_or_default (full_name, NULL);
|
||||
if (mime_type) {
|
||||
char *action;
|
||||
const char *action;
|
||||
|
||||
action = gnome_mime_get_value (mime_type, "drop-action");
|
||||
if (action) {
|
||||
@ -413,7 +410,7 @@ gdnd_perform_drop (GdkDragContext *context, GtkSelectionData *selection_data,
|
||||
action = context->action;
|
||||
|
||||
if (S_ISDIR (dest_fe->buf.st_mode) || dest_fe->f.link_to_dir)
|
||||
return drop_on_directory (context, selection_data, action, directory, dest_fe);
|
||||
return drop_on_directory (context, selection_data, action, directory);
|
||||
else
|
||||
return drop_on_file (context, selection_data, directory, dest_fe);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ ensure_icon_image (IconSet *iset, IconType type)
|
||||
* the file could not be loaded.
|
||||
*/
|
||||
static IconSet *
|
||||
get_icon_set (char *filename)
|
||||
get_icon_set (const char *filename)
|
||||
{
|
||||
GdkImlibImage *im;
|
||||
IconSet *iset;
|
||||
@ -392,7 +392,7 @@ gicon_get_icon_for_file (char *directory, file_entry *fe, gboolean do_quick)
|
||||
|
||||
mime_type = gnome_mime_type_or_default (fe->fname, NULL);
|
||||
if (mime_type) {
|
||||
char *icon_name;
|
||||
const char *icon_name;
|
||||
|
||||
icon_name = gnome_mime_get_value (mime_type, "icon-filename");
|
||||
if (icon_name) {
|
||||
|
@ -805,7 +805,7 @@ panel_icon_list_drag_data_received (GtkWidget *widget,
|
||||
free_fe = FALSE;
|
||||
}
|
||||
|
||||
reload = gdnd_perform_drop (context, selection_data, panel->cwd, fe);
|
||||
reload = gdnd_perform_drop (context, selection_data, file, fe);
|
||||
|
||||
if (free_file)
|
||||
g_free (file);
|
||||
@ -860,7 +860,7 @@ panel_clist_drag_data_received (GtkWidget *widget,
|
||||
free_fe = FALSE;
|
||||
}
|
||||
|
||||
reload = gdnd_perform_drop (context, selection_data, panel->cwd, fe);
|
||||
reload = gdnd_perform_drop (context, selection_data, file, fe);
|
||||
|
||||
if (free_file)
|
||||
g_free (file);
|
||||
|
@ -275,6 +275,15 @@ entry_release (GtkEditable *entry, GdkEvent *event, WInput *in)
|
||||
in->first = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
wentry_changed (GtkEditable *editable, WInput *in)
|
||||
{
|
||||
char *text = gtk_entry_get_text (GTK_ENTRY (editable));
|
||||
|
||||
assign_text (in, text);
|
||||
input_set_point (in, editable->current_pos);
|
||||
}
|
||||
|
||||
int
|
||||
x_create_input (Dlg_head *h, widget_data parent, WInput *in)
|
||||
{
|
||||
@ -308,6 +317,9 @@ x_create_input (Dlg_head *h, widget_data parent, WInput *in)
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (entry), "button_release_event",
|
||||
GTK_SIGNAL_FUNC (entry_release), in);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||
GTK_SIGNAL_FUNC (wentry_changed), in);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -330,13 +342,19 @@ x_update_input (WInput *in)
|
||||
entry = GTK_ENTRY (in->widget.wdata);
|
||||
#endif
|
||||
|
||||
/* Block the signal handler */
|
||||
gtk_signal_handler_block_by_func (
|
||||
GTK_OBJECT (entry),
|
||||
GTK_SIGNAL_FUNC(wentry_changed), in);
|
||||
|
||||
/* Do the actual work */
|
||||
if (in->first == -1){
|
||||
gtk_editable_select_region (GTK_EDITABLE (entry), 0, 0);
|
||||
in->first = 0;
|
||||
}
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||
|
||||
|
||||
if (text && strcmp (text, in->buffer)){
|
||||
gtk_entry_set_text (entry, in->buffer);
|
||||
draw = 1;
|
||||
@ -346,6 +364,12 @@ x_update_input (WInput *in)
|
||||
gtk_entry_set_position (entry, in->point);
|
||||
draw = 1;
|
||||
}
|
||||
|
||||
/* Unblock the signal handler */
|
||||
gtk_signal_handler_unblock_by_func (
|
||||
GTK_OBJECT (entry),
|
||||
GTK_SIGNAL_FUNC(wentry_changed), in);
|
||||
|
||||
|
||||
if (draw){
|
||||
#ifdef USE_GNOME_ENTRY
|
||||
|
@ -821,8 +821,8 @@ setup_gui (void)
|
||||
g_status_label, TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
|
||||
gtk_widget_show_all (g_find_dlg);
|
||||
gtk_widget_hide (find_do_view);
|
||||
gtk_widget_hide (find_do_edit);
|
||||
gtk_widget_hide (GTK_WIDGET (find_do_view));
|
||||
gtk_widget_hide (GTK_WIDGET (find_do_edit));
|
||||
}
|
||||
|
||||
static int
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user