1999-02-03 Federico Mena Quintero <federico@nuclecu.unam.mx>

* gdnd.c (gdnd_validate_action): Show the correct feedback when
	dragging URLs.
This commit is contained in:
Miguel de Icaza 1999-02-04 03:35:26 +00:00
parent f6a9eb9d1d
commit b698ebfe03
3 changed files with 27 additions and 16 deletions

View File

@ -1,3 +1,8 @@
1999-02-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdnd.c (gdnd_validate_action): Show the correct feedback when
dragging URLs.
1999-02-03 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gdesktop.c (desktop_icon_info_open): Use gmc_open_filename

View File

@ -393,7 +393,7 @@ gdnd_perform_drop (GdkDragContext *context, GtkSelectionData *selection_data,
return FALSE;
} else
action = context->action;
if (S_ISDIR (dest_fe->buf.st_mode) || dest_fe->f.link_to_dir)
return drop_on_directory (context, selection_data, dest_name);
else
@ -497,12 +497,14 @@ gdnd_validate_action (GdkDragContext *context,
&& (!dest_fe || dest_selected))
return GDK_ACTION_MOVE;
if (gdnd_drag_context_has_target (context, TARGET_URI_LIST)) {
if (dest_fe) {
on_directory = S_ISDIR (dest_fe->buf.st_mode) || dest_fe->f.link_to_dir;
on_exe = is_exe (dest_fe->buf.st_mode) && if_link_is_exe (dest_fe);
}
/* See what kind of file the destination is, if any */
if (dest_fe) {
on_directory = S_ISDIR (dest_fe->buf.st_mode) || dest_fe->f.link_to_dir;
on_exe = is_exe (dest_fe->buf.st_mode) && if_link_is_exe (dest_fe);
}
if (gdnd_drag_context_has_target (context, TARGET_URI_LIST)) {
if (dest_fe) {
if (same_source && dest_selected)
return 0;
@ -538,11 +540,17 @@ gdnd_validate_action (GdkDragContext *context,
}
if (gdnd_drag_context_has_target (context, TARGET_URL)) {
/* FIXME: right now we only allow links. We should see if we
* can move or copy stuff instead (for ftp instead of http
* sites, for example).
/* FIXME: right now we only allow linking to directories. We
* should see if we can move or copy stuff instead (for ftp
* instead of http sites, for example).
*/
if (context->actions & GDK_ACTION_LINK)
if (dest_fe) {
if (on_directory) {
if (context->actions & GDK_ACTION_LINK)
return GDK_ACTION_LINK;
} else if (context->actions & GDK_ACTION_COPY)
return GDK_ACTION_COPY;
} else if (context->actions & GDK_ACTION_LINK)
return GDK_ACTION_LINK;
}

View File

@ -78,9 +78,6 @@ GtkWidget *drag_multiple = NULL;
GtkWidget *drag_multiple_ok = NULL;
static void panel_file_list_configure_contents (GtkWidget *sw, WPanel *panel, int main_width, int height);
#define CLIST_FROM_SW(panel_list) GTK_CLIST (GTK_BIN (panel_list)->child)
@ -485,7 +482,6 @@ panel_file_list_select_row (GtkWidget *file_list, int row, int column, GdkEvent
display_mini_info (panel);
execute_hooks (select_file_hook);
if (!event)
return;
@ -496,7 +492,8 @@ panel_file_list_select_row (GtkWidget *file_list, int row, int column, GdkEvent
if (S_ISDIR (panel->dir.list [row].buf.st_mode) ||
panel->dir.list [row].f.link_to_dir){
fullname = concat_dir_and_file (panel->cwd, panel->dir.list [row].fname);
fullname = concat_dir_and_file (panel->cwd,
panel->dir.list [row].fname);
new_panel_at (fullname);
g_free (fullname);
}
@ -1366,7 +1363,8 @@ panel_icon_list_select_icon (GtkWidget *widget, int index, GdkEvent *event, WPan
switch (event->type){
case GDK_BUTTON_PRESS:
if (event->button.button == 3)
gpopup_do_popup ((GdkEventButton *) event, panel, NULL, index, panel->dir.list[index].fname);
gpopup_do_popup ((GdkEventButton *) event, panel, NULL, index,
panel->dir.list[index].fname);
break;
case GDK_BUTTON_RELEASE: