1999-03-09 Miguel de Icaza <miguel@nuclecu.unam.mx>

* gdesktop.c (icon_drag_data_received): Pass the full directory
	name to gdnd_perform_drop.

	* gpopup.c (create_regexp_actions): This routine no longer creates
	the default copy/move/delete context menu entries.

	(file_actions): Include the copy/move/delete options here.  This
	also enabled me to reorder things to put "Delete" closer to the
	top, as it is a pretty common operation.
This commit is contained in:
Miguel de Icaza 1999-03-10 17:54:33 +00:00
parent 2bd8584197
commit d80cea83fa
5 changed files with 24 additions and 41 deletions

View File

@ -1,3 +1,15 @@
1999-03-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gdesktop.c (icon_drag_data_received): Pass the full directory
name to gdnd_perform_drop.
* gpopup.c (create_regexp_actions): This routine no longer creates
the default copy/move/delete context menu entries.
(file_actions): Include the copy/move/delete options here. This
also enabled me to reorder things to put "Delete" closer to the
top, as it is a pretty common operation.
1999-03-08 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-03-08 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gmain.c (session_save_state): Add call to gnome_config_sync(). * gmain.c (session_save_state): Add call to gnome_config_sync().

View File

@ -143,7 +143,6 @@ void
gnome_close_panel (GtkWidget *widget, WPanel *panel) gnome_close_panel (GtkWidget *widget, WPanel *panel)
{ {
Dlg_head *h = panel->widget.parent; Dlg_head *h = panel->widget.parent;
g_print ("closing the panel\n");
if (panel->timer_id){ if (panel->timer_id){
gtk_timeout_remove (panel->timer_id); gtk_timeout_remove (panel->timer_id);
panel->timer_id = -1; panel->timer_id = -1;

View File

@ -1654,14 +1654,16 @@ icon_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gin
full_name = g_concat_dir_and_file (desktop_directory, dii->filename); full_name = g_concat_dir_and_file (desktop_directory, dii->filename);
fe = file_entry_from_file (full_name); fe = file_entry_from_file (full_name);
g_free (full_name); if (!fe){
if (!fe) g_free (full_name);
return; /* eeeek */ return;
}
if (gdnd_perform_drop (context, data, desktop_directory, fe)) if (gdnd_perform_drop (context, data, full_name, fe))
desktop_reload_icons (FALSE, 0, 0); desktop_reload_icons (FALSE, 0, 0);
file_entry_free (fe); file_entry_free (fe);
g_free (full_name);
} }
} }

View File

@ -256,6 +256,8 @@ fill_menu (GtkMenuShell *menu_shell, GnomeUIInfo *uiinfo, int pos)
*/ */
static struct action file_actions[] = { static struct action file_actions[] = {
{ N_("Properties"), F_SINGLE | F_PANEL, (GtkSignalFunc) panel_action_properties }, { N_("Properties"), F_SINGLE | F_PANEL, (GtkSignalFunc) panel_action_properties },
{ N_("Delete"), F_PANEL | F_ALL, (GtkSignalFunc) delete_cmd },
{ N_("Delete"), F_DICON | F_ALL, (GtkSignalFunc) dicon_delete },
{ N_("Properties"), F_SINGLE | F_DICON, (GtkSignalFunc) dicon_properties }, { N_("Properties"), F_SINGLE | F_DICON, (GtkSignalFunc) dicon_properties },
{ N_("Mount device"), F_SINGLE|F_MOUNTABLE|F_DICON, (GtkSignalFunc) dicon_mount }, { N_("Mount device"), F_SINGLE|F_MOUNTABLE|F_DICON, (GtkSignalFunc) dicon_mount },
{ N_("Unmount device"), F_SINGLE|F_UNMOUNTABLE|F_DICON, (GtkSignalFunc) dicon_unmount }, { N_("Unmount device"), F_SINGLE|F_UNMOUNTABLE|F_DICON, (GtkSignalFunc) dicon_unmount },
@ -268,34 +270,15 @@ static struct action file_actions[] = {
{ N_("View unfiltered"), F_PANEL | F_NOTDIR, (GtkSignalFunc) panel_action_view_unfiltered }, { N_("View unfiltered"), F_PANEL | F_NOTDIR, (GtkSignalFunc) panel_action_view_unfiltered },
{ N_("Edit"), F_PANEL | F_NOTDIR, (GtkSignalFunc) panel_action_edit }, { N_("Edit"), F_PANEL | F_NOTDIR, (GtkSignalFunc) panel_action_edit },
{ "", 0, NULL }, { "", 0, NULL },
{ N_("Move/rename..."), F_PANEL | F_ALL, (GtkSignalFunc) ren_cmd },
{ N_("Copy..."), F_PANEL | F_ALL, (GtkSignalFunc) copy_cmd },
{ "", 0, NULL },
{ N_("Link..."), F_PANEL | F_REGULAR | F_SINGLE, (GtkSignalFunc) link_cmd }, { N_("Link..."), F_PANEL | F_REGULAR | F_SINGLE, (GtkSignalFunc) link_cmd },
{ N_("Symlink..."), F_PANEL | F_SINGLE, (GtkSignalFunc) symlink_cmd }, { N_("Symlink..."), F_PANEL | F_SINGLE, (GtkSignalFunc) symlink_cmd },
{ N_("Edit symlink..."), F_PANEL | F_SYMLINK, (GtkSignalFunc) edit_symlink_cmd }, { N_("Edit symlink..."), F_PANEL | F_SYMLINK, (GtkSignalFunc) edit_symlink_cmd },
{ NULL, 0, NULL }, { NULL, 0, NULL },
}; };
/* Menu entries for files from a panel window */
static GnomeUIInfo panel_actions[] = {
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_NONE (N_("Move/rename..."), NULL, ren_cmd),
GNOMEUIINFO_ITEM_NONE (N_("Copy..."), NULL, copy_cmd),
GNOMEUIINFO_ITEM_NONE (N_("Delete"), NULL, delete_cmd),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_END
};
/* Menu entries for files from desktop icons */
static GnomeUIInfo dicon_actions[] = {
GNOMEUIINFO_SEPARATOR,
#if 0
GNOMEUIINFO_ITEM_NONE (N_("Move/rename..."), NULL, dicon_move),
GNOMEUIINFO_ITEM_NONE (N_("Copy..."), NULL, dicon_copy),
#endif
GNOMEUIINFO_ITEM_NONE (N_("Delete"), NULL, dicon_delete),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_END
};
/* Creates the menu items for the standard actions. Returns the position at which additional menu /* Creates the menu items for the standard actions. Returns the position at which additional menu
* items should be inserted. * items should be inserted.
@ -528,7 +511,6 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel,
int panel_row, char *filename, int insert_pos) int panel_row, char *filename, int insert_pos)
{ {
gpointer closure, regex_closure; gpointer closure, regex_closure;
GnomeUIInfo *a_uiinfo;
int i; int i;
GtkSignalFunc regex_callback; GtkSignalFunc regex_callback;
const char *mime_type; const char *mime_type;
@ -538,26 +520,15 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel,
GNOMEUIINFO_END GNOMEUIINFO_END
}; };
regex_callback = mime_command_from_desktop_icon;
if (panel) { if (panel) {
a_uiinfo = panel_actions;
closure = panel; closure = panel;
regex_callback = mime_command_from_desktop_icon;
regex_closure = filename; regex_closure = filename;
} else { } else {
a_uiinfo = dicon_actions;
closure = dii; closure = dii;
regex_callback = mime_command_from_desktop_icon;
regex_closure = filename; regex_closure = filename;
} }
/* Fill in the common part of the menus */
for (i = 0; a_uiinfo [i].type != GNOME_APP_UI_ENDOFINFO; i++)
a_uiinfo[i].user_data = closure;
fill_menu (GTK_MENU_SHELL (menu), a_uiinfo, insert_pos);
insert_pos += 5; /* the number of items from the common menus */
/* Fill in the regex command part */ /* Fill in the regex command part */
mime_type = gnome_mime_type_or_default (filename, NULL); mime_type = gnome_mime_type_or_default (filename, NULL);

View File

@ -132,7 +132,6 @@ int my_system_get_child_pid (int flags, const char *shell, const char *command,
} }
if ((*pid = fork ()) < 0){ if ((*pid = fork ()) < 0){
fprintf (stderr, "\n\nfork () = -1\n");
return -1; return -1;
} }
if (*pid == 0){ if (*pid == 0){