1
1

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

* gscreen.c (file_list_popup_items): Use "New Directory", not "New
	Folder", to be consistent with the desktop and File menus.  Thanks
	to Kevin Fox for pointing this out.
	(panel_icon_list_drag_data_received): Update the panels properly.
	(panel_clist_drag_data_received): Likewise.
	(panel_tree_drag_data_received): Likewise.

	* gcmd.c (gnome_close_panel): Doh.  Do not access g_free()d
	memory.

	* glayout.c (copy_uiinfo_widgets): Return the copied array as a
	return value, not in an argument.

	* gcmd.c (set_view_type): Added a sanity check.
Этот коммит содержится в:
Miguel de Icaza 1999-04-05 05:39:26 +00:00
родитель 950ba36516
Коммит c7a8f4846e
5 изменённых файлов: 52 добавлений и 26 удалений

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

@ -1,3 +1,20 @@
1999-04-04 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gscreen.c (file_list_popup_items): Use "New Directory", not "New
Folder", to be consistent with the desktop and File menus. Thanks
to Kevin Fox for pointing this out.
(panel_icon_list_drag_data_received): Update the panels properly.
(panel_clist_drag_data_received): Likewise.
(panel_tree_drag_data_received): Likewise.
* gcmd.c (gnome_close_panel): Doh. Do not access g_free()d
memory.
* glayout.c (copy_uiinfo_widgets): Return the copied array as a
return value, not in an argument.
* gcmd.c (set_view_type): Added a sanity check.
1999-04-01 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtkdtree.c (scan_subtree): Moved the functionality to scan a

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

@ -163,16 +163,16 @@ gnome_close_panel (GtkWidget *widget, WPanel *panel)
remove_widget (h, panel->filter_w);
remove_widget (h, panel);
/* Kill them */
/* Free our own internal stuff */
g_free (panel->view_menu_items);
g_free (panel->view_toolbar_items);
/* Kill the widgets */
destroy_widget (panel->current_dir);
destroy_widget (panel->filter_w);
destroy_widget ((Widget *)panel);
layout_panel_gone (panel);
g_free (panel->view_menu_items);
g_free (panel->view_toolbar_items);
mc_chdir ("/");
}
@ -209,7 +209,7 @@ set_view_type (GtkWidget *widget, WPanel *panel, enum list_types type)
/* Synchronize the widgets */
for (i = 0; ; i++)
for (i = 0; panel->view_menu_items[i] && panel->view_toolbar_items[i]; i++)
if (widget == panel->view_menu_items[i]) {
gtk_signal_handler_block_by_data (
GTK_OBJECT (panel->view_toolbar_items[i]), panel);

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

@ -133,7 +133,7 @@ set_current_panel (WPanel *panel)
if (g_list_length (containers) > 1)
other_panel_ptr = current_panel_ptr;
for (p = containers; p; p = p->next){
if (((PanelContainer *)p->data)->panel == panel){
current_panel_ptr = p->data;
@ -675,19 +675,20 @@ my_app_create_menus (GnomeApp *app, GnomeUIInfo *uiinfo, void *data)
/**
* copy_uiinfo_widgets:
* @uiinfo: A GnomeUIInfo array
* @dest: The destination array will be placed here
*
* Allocates an array of widgets and copies the widgets from the uiinfo array to
* it. The array will be NULL-terminated.
*
* Returns: The allocated array of widgets.
**/
void
copy_uiinfo_widgets (GnomeUIInfo *uiinfo, gpointer **dest)
gpointer *
copy_uiinfo_widgets (GnomeUIInfo *uiinfo)
{
gpointer *dest;
int n;
int i;
g_return_if_fail (uiinfo != NULL);
g_return_if_fail (dest != NULL);
g_return_val_if_fail (uiinfo != NULL, NULL);
/* Count number of items */
@ -695,12 +696,14 @@ copy_uiinfo_widgets (GnomeUIInfo *uiinfo, gpointer **dest)
/* Copy the widgets */
*dest = g_new (gpointer, n + 1);
dest = g_new (gpointer, n + 1);
for (i = 0; i < n; i++)
(*dest)[i] = uiinfo[i].widget;
dest[i] = uiinfo[i].widget;
(*dest)[i] = NULL;
dest[i] = NULL;
return dest;
}
WPanel *
@ -747,7 +750,7 @@ create_container (Dlg_head *h, char *name, char *geometry)
uiinfo = gnome_panel_menu_with_desktop;
my_app_create_menus (GNOME_APP (app), uiinfo, panel);
copy_uiinfo_widgets (panel_view_menu_uiinfo, &panel->view_menu_items);
panel->view_menu_items = copy_uiinfo_widgets (panel_view_menu_uiinfo);
create_new_menu (GNOME_APP (app), panel);
@ -794,8 +797,8 @@ new_panel_with_geometry_at (char *dir, char *geometry)
mc_chdir (dir);
panel = create_container (desktop_dlg, dir, geometry);
add_widget (desktop_dlg, panel);
set_current_panel (panel);
add_widget (desktop_dlg, panel);
#if 0
x_flush_events ();
#endif

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

@ -828,8 +828,8 @@ panel_icon_list_drag_data_received (GtkWidget *widget,
file_entry_free (fe);
if (reload) {
update_one_panel_widget (panel, 0, UP_KEEPSEL);
panel_update_contents (panel);
update_panels (UP_OPTIMIZE, UP_KEEPSEL);
repaint_screen ();
}
}
@ -889,8 +889,8 @@ panel_clist_drag_data_received (GtkWidget *widget,
file_entry_free (fe);
if (reload) {
update_one_panel_widget (panel, 0, UP_KEEPSEL);
panel_update_contents (panel);
update_panels (UP_OPTIMIZE, UP_KEEPSEL);
repaint_screen ();
}
}
@ -914,6 +914,7 @@ panel_tree_drag_data_received (GtkWidget *widget,
int row, col;
file_entry *fe;
char *path;
int reload;
if (!gtk_clist_get_selection_info (GTK_CLIST (dtree), x, y, &row, &col))
return;
@ -928,10 +929,15 @@ panel_tree_drag_data_received (GtkWidget *widget,
if (!fe)
return; /* eeeek */
gdnd_perform_drop (context, selection_data, path, fe);
reload = gdnd_perform_drop (context, selection_data, path, fe);
file_entry_free (fe);
g_free (path);
if (reload) {
update_panels (UP_OPTIMIZE, UP_KEEPSEL);
repaint_screen ();
}
}
static void
@ -1469,9 +1475,9 @@ handle_rescan_directory (GtkWidget *widget, gpointer data)
/* The popup menu for file panels */
static GnomeUIInfo file_list_popup_items[] = {
GNOMEUIINFO_ITEM_NONE (N_("Rescan Directory"), N_("Reloads the current directory"),
GNOMEUIINFO_ITEM_NONE (N_("_Rescan Directory"), N_("Reloads the current directory"),
handle_rescan_directory),
GNOMEUIINFO_ITEM_NONE (N_("New folder"), N_("Creates a new folder here"),
GNOMEUIINFO_ITEM_NONE (N_("New _Directory..."), N_("Creates a new directory here"),
gnome_mkdir_cmd),
GNOMEUIINFO_END
};
@ -2473,7 +2479,7 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
GNOME_DOCK_TOP,
2, 0, 0);
copy_uiinfo_widgets (panel_view_toolbar_uiinfo, &panel->view_toolbar_items);
panel->view_toolbar_items = copy_uiinfo_widgets (panel_view_toolbar_uiinfo);
panel->back_b = toolbar[0].widget;
panel->up_b = toolbar[1].widget;

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

@ -8,7 +8,7 @@ extern GnomeUIInfo panel_view_toolbar_uiinfo[];
WPanel *create_container (Dlg_head *h, char *str, char *geometry);
void copy_uiinfo_widgets (GnomeUIInfo *uiinfo, gpointer **dest);
gpointer *copy_uiinfo_widgets (GnomeUIInfo *uiinfo);
typedef struct {
int splitted;