1
1

1999-01-25 Federico Mena Quintero <federico@nuclecu.unam.mx>

* gdnd.c (get_action): Sensitize the menu items based on the
	allowed actions in the drag context.
	(actions): Add some underlined accelerators for the action menu.

	* gdesktop.c (icon_drag_motion): Use S_ISDIR() in addition to
	fe->f.link_to_dir.

	* gscreen.c (panel_file_list_scrolled): Removed this function, as
	it was not used for anything useful.

	* gdnd.c (gdnd_drop_on_directory): Duh.  Use context->action, not
	context->suggested_action.

1999-01-25  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* Makefile.am (libvfs_la_SOURCES): Added utilvfs.h.
	* Make-mc.in (VFSHDRS): Likewise.
Этот коммит содержится в:
Miguel de Icaza 1999-01-25 16:50:38 +00:00
родитель 7e4deeeda7
Коммит 9c81ea49fd
7 изменённых файлов: 44 добавлений и 23 удалений

Просмотреть файл

@ -1,3 +1,18 @@
1999-01-25 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdnd.c (get_action): Sensitize the menu items based on the
allowed actions in the drag context.
(actions): Add some underlined accelerators for the action menu.
* gdesktop.c (icon_drag_motion): Use S_ISDIR() in addition to
fe->f.link_to_dir.
* gscreen.c (panel_file_list_scrolled): Removed this function, as
it was not used for anything useful.
* gdnd.c (gdnd_drop_on_directory): Duh. Use context->action, not
context->suggested_action.
1999-01-24 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-01-24 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtkdtree.c (gtk_dtree_load_path): Keep track of when we are * gtkdtree.c (gtk_dtree_load_path): Keep track of when we are

Просмотреть файл

@ -1147,7 +1147,7 @@ icon_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, gu
&& (context->actions & GDK_ACTION_MOVE)) && (context->actions & GDK_ACTION_MOVE))
action = GDK_ACTION_MOVE; action = GDK_ACTION_MOVE;
else if (gdnd_drag_context_has_target (context, TARGET_URI_LIST)) { else if (gdnd_drag_context_has_target (context, TARGET_URI_LIST)) {
if (fe->f.link_to_dir) if (S_ISDIR (fe->buf.st_mode) || fe->f.link_to_dir)
action = context->suggested_action; action = context->suggested_action;
else if (is_exe (fe->buf.st_mode) else if (is_exe (fe->buf.st_mode)
&& if_link_is_exe (fe) && if_link_is_exe (fe)
@ -1344,7 +1344,7 @@ icon_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gin
drop_desktop_icons (context, data, x + dii->x, y + dii->y); drop_desktop_icons (context, data, x + dii->x, y + dii->y);
else else
printf ("FIXME: what do drop?\n"); /* FIXME */ printf ("FIXME: what do drop?\n"); /* FIXME */
break; break;
case TARGET_URI_LIST: case TARGET_URI_LIST:

Просмотреть файл

@ -46,9 +46,9 @@ gdnd_init (void)
/* The menu of DnD actions */ /* The menu of DnD actions */
static GnomeUIInfo actions[] = { static GnomeUIInfo actions[] = {
GNOMEUIINFO_ITEM_NONE (N_("Move here"), NULL, NULL), GNOMEUIINFO_ITEM_NONE (N_("_Move here"), NULL, NULL),
GNOMEUIINFO_ITEM_NONE (N_("Copy here"), NULL, NULL), GNOMEUIINFO_ITEM_NONE (N_("_Copy here"), NULL, NULL),
GNOMEUIINFO_ITEM_NONE (N_("Link here"), NULL, NULL), GNOMEUIINFO_ITEM_NONE (N_("_Link here"), NULL, NULL),
GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_NONE (N_("Cancel drag"), NULL, NULL), GNOMEUIINFO_ITEM_NONE (N_("Cancel drag"), NULL, NULL),
GNOMEUIINFO_END GNOMEUIINFO_END
@ -56,13 +56,22 @@ static GnomeUIInfo actions[] = {
/* Pops up a menu of actions to perform on dropped files */ /* Pops up a menu of actions to perform on dropped files */
static GdkDragAction static GdkDragAction
get_action (void) get_action (GdkDragContext *context)
{ {
GtkWidget *menu; GtkWidget *menu;
int a; int a;
GdkDragAction action; GdkDragAction action;
/* Create the menu and set the sensitivity of the items based on the
* allowed actions.
*/
menu = gnome_popup_menu_new (actions); menu = gnome_popup_menu_new (actions);
gtk_widget_set_sensitive (actions[0].widget, (context->actions & GDK_ACTION_MOVE) != 0);
gtk_widget_set_sensitive (actions[1].widget, (context->actions & GDK_ACTION_COPY) != 0);
gtk_widget_set_sensitive (actions[2].widget, (context->actions & GDK_ACTION_LINK) != 0);
a = gnome_popup_menu_do_popup_modal (menu, NULL, NULL, NULL, NULL); a = gnome_popup_menu_do_popup_modal (menu, NULL, NULL, NULL, NULL);
switch (a) { switch (a) {
@ -285,29 +294,29 @@ gdnd_drop_on_directory (GdkDragContext *context, GtkSelectionData *selection_dat
WPanel *source_panel; WPanel *source_panel;
GList *names; GList *names;
if (context->suggested_action == GDK_ACTION_ASK) { if (context->action == GDK_ACTION_ASK) {
action = get_action (); action = get_action (context);
if (action == GDK_ACTION_ASK) if (action == GDK_ACTION_ASK)
return FALSE; return FALSE;
} else } else
action = context->suggested_action; action = context->action;
/* If we are dragging from a file panel, we can display a nicer status display */ /* If we are dragging from a file panel, we can display a nicer status display */
source_panel = find_panel_owning_window (context); source_panel = find_panel_owning_window (context);
/* Check if the user did not drag the information to the same directory */ /* Check if the user did not drag the information to the same directory */
if (source_panel){ if (source_panel) {
if (strcmp (source_panel->cwd, destdir) == 0) if (strcmp (source_panel->cwd, destdir) == 0)
return FALSE; return FALSE;
} }
/* Symlinks do not use file.c */ /* Symlinks do not use file.c */
if (source_panel && action != GDK_ACTION_LINK) if (source_panel && action != GDK_ACTION_LINK)
perform_action_on_panel (source_panel, action, destdir, perform_action_on_panel (source_panel, action, destdir,
context->suggested_action == GDK_ACTION_ASK); context->action == GDK_ACTION_ASK);
else { else {
names = gnome_uri_list_extract_uris (selection_data->data); names = gnome_uri_list_extract_uris (selection_data->data);

Просмотреть файл

@ -619,15 +619,6 @@ panel_setup_drag_motion (WPanel *panel, int x, int y, desirable_fn desirable, sc
return FALSE; return FALSE;
} }
static void
panel_file_list_scrolled (GtkAdjustment *adj, WPanel *panel)
{
if (!GTK_IS_ADJUSTMENT (adj)) {
fprintf (stderr, "file_list_is_scrolled is called and there are not enough boats!\n");
exit (1);
}
}
static void static void
panel_configure_file_list (WPanel *panel, GtkWidget *sw, GtkWidget *file_list) panel_configure_file_list (WPanel *panel, GtkWidget *sw, GtkWidget *file_list)
{ {
@ -661,8 +652,6 @@ panel_configure_file_list (WPanel *panel, GtkWidget *sw, GtkWidget *file_list)
/* Configure the scrolbars */ /* Configure the scrolbars */
adjustment = GTK_OBJECT (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw))); adjustment = GTK_OBJECT (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw)));
gtk_signal_connect_after (adjustment, "value_changed",
GTK_SIGNAL_FUNC (panel_file_list_scrolled), panel);
} }
/* /*
@ -1118,6 +1107,7 @@ panel_icon_list_scroll (gpointer data)
return TRUE; return TRUE;
} }
/** /**
* panel_icon_list_drag_motion: * panel_icon_list_drag_motion:
* *

Просмотреть файл

@ -1,3 +1,8 @@
1999-01-25 Federico Mena Quintero <federico@nuclecu.unam.mx>
* Makefile.am (libvfs_la_SOURCES): Added utilvfs.h.
* Make-mc.in (VFSHDRS): Likewise.
1999-01-21 Federico Mena Quintero <federico@nuclecu.unam.mx> 1999-01-21 Federico Mena Quintero <federico@nuclecu.unam.mx>
* utilvfs.c (append_path_sep): Fixed, it was broken for paths * utilvfs.c (append_path_sep): Fixed, it was broken for paths

Просмотреть файл

@ -62,6 +62,7 @@ VFSHDRS = \
names.h \ names.h \
tar.h \ tar.h \
tcputil.h \ tcputil.h \
utilvfs.h \
vfs.h \ vfs.h \
xdirentry.h xdirentry.h

Просмотреть файл

@ -40,6 +40,7 @@ libvfs_la_SOURCES = \
tcputil.c \ tcputil.c \
undelfs.c \ undelfs.c \
utilvfs.c \ utilvfs.c \
utilvfs.h \
vfs.c \ vfs.c \
container.h \ container.h \
extfs.h \ extfs.h \