1998-12-11 Owen Taylor <otaylor@redhat.com>
* gscreen.c gdesktop.c gdnd.h: enable dragging locale files into Netscape.
Этот коммит содержится в:
родитель
b14a0d3432
Коммит
bb4317f961
@ -1,3 +1,8 @@
|
||||
1998-12-11 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gscreen.c gdesktop.c gdnd.h: enable dragging locale files
|
||||
into Netscape.
|
||||
|
||||
1998-12-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gicon.c (gicon_get_icon_for_file): First try to fetch the inline
|
||||
|
@ -95,7 +95,8 @@ static struct desktop_icon_info *last_selected_icon;
|
||||
static GtkTargetEntry dnd_icon_sources[] = {
|
||||
{ "application/x-mc-desktop-icon", 0, TARGET_MC_DESKTOP_ICON },
|
||||
{ "text/uri-list", 0, TARGET_URI_LIST },
|
||||
{ "text/plain", 0, TARGET_TEXT_PLAIN }
|
||||
{ "text/plain", 0, TARGET_TEXT_PLAIN },
|
||||
{ "_NETSCAPE_URL", 0, TARGET_URL }
|
||||
};
|
||||
|
||||
static GtkTargetEntry dnd_icon_targets[] = {
|
||||
@ -953,25 +954,39 @@ drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *sel
|
||||
struct desktop_icon_info *dii;
|
||||
char *filelist;
|
||||
int len;
|
||||
GList *files;
|
||||
|
||||
dii = data;
|
||||
filelist = build_selected_icons_uri_list (&len);
|
||||
|
||||
switch (info) {
|
||||
case TARGET_MC_DESKTOP_ICON:
|
||||
case TARGET_URI_LIST:
|
||||
case TARGET_TEXT_PLAIN:
|
||||
filelist = build_selected_icons_uri_list (&len);
|
||||
gtk_selection_data_set (selection_data,
|
||||
selection_data->target,
|
||||
8,
|
||||
filelist,
|
||||
len);
|
||||
g_free (filelist);
|
||||
break;
|
||||
|
||||
case TARGET_URL:
|
||||
files = gnome_uri_list_extract_uris (filelist);
|
||||
if (files) {
|
||||
gtk_selection_data_set (selection_data,
|
||||
selection_data->target,
|
||||
8,
|
||||
files->data,
|
||||
strlen (files->data));
|
||||
}
|
||||
gnome_uri_list_free_strings (files);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
g_free (filelist);
|
||||
}
|
||||
|
||||
/* Set up a desktop icon as a DnD source */
|
||||
|
@ -16,7 +16,8 @@
|
||||
enum {
|
||||
TARGET_MC_DESKTOP_ICON,
|
||||
TARGET_URI_LIST,
|
||||
TARGET_TEXT_PLAIN
|
||||
TARGET_TEXT_PLAIN,
|
||||
TARGET_URL
|
||||
};
|
||||
|
||||
|
||||
|
@ -55,7 +55,8 @@ GdkPixmap *icon_dev_pixmap;
|
||||
GdkBitmap *icon_dev_mask;
|
||||
static GtkTargetEntry drag_types [] = {
|
||||
{ "text/uri-list", 0, TARGET_URI_LIST },
|
||||
{ "text/plain", 0, TARGET_TEXT_PLAIN }
|
||||
{ "text/plain", 0, TARGET_TEXT_PLAIN },
|
||||
{ "_NETSCAPE_URL", 0, TARGET_URL }
|
||||
};
|
||||
|
||||
static GtkTargetEntry drop_types [] = {
|
||||
@ -675,15 +676,30 @@ panel_drag_data_get (GtkWidget *widget,
|
||||
{
|
||||
int len;
|
||||
char *data;
|
||||
GList *files;
|
||||
|
||||
data = panel_build_selected_file_list (panel, &len);
|
||||
|
||||
switch (info){
|
||||
case TARGET_URI_LIST:
|
||||
case TARGET_TEXT_PLAIN:
|
||||
data = panel_build_selected_file_list (panel, &len);
|
||||
gtk_selection_data_set (selection_data, selection_data->target, 8, data, len);
|
||||
g_free (data);
|
||||
break;
|
||||
|
||||
case TARGET_URL:
|
||||
files = gnome_uri_list_extract_uris (data);
|
||||
if (files) {
|
||||
gtk_selection_data_set (selection_data,
|
||||
selection_data->target,
|
||||
8,
|
||||
files->data,
|
||||
strlen (files->data));
|
||||
}
|
||||
gnome_uri_list_free_strings (files);
|
||||
break;
|
||||
}
|
||||
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user