1
1

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

* gdesktop.c (create_panel_from_desktop): Do not assert that
	panel->count > 0, because we may actually not have any icons in
	the desktop.
	(desktop_popup): Reload the desktop once the popup menu is done.
Этот коммит содержится в:
Miguel de Icaza 1999-03-12 23:48:36 +00:00
родитель 8cb5ff2882
Коммит 26556bcf3b
3 изменённых файлов: 44 добавлений и 39 удалений

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

@ -1,5 +1,10 @@
1999-03-12 Federico Mena Quintero <federico@nuclecu.unam.mx> 1999-03-12 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (create_panel_from_desktop): Do not assert that
panel->count > 0, because we may actually not have any icons in
the desktop.
(desktop_popup): Reload the desktop once the popup menu is done.
* gnome-file-property-dialog.c (gnome_file_property_dialog_init): * gnome-file-property-dialog.c (gnome_file_property_dialog_init):
Set the dialog to not destroy-on-close. Set the dialog to not destroy-on-close.

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

@ -1311,8 +1311,6 @@ create_panel_from_desktop (void)
/* Create the file entry list */ /* Create the file entry list */
panel->dir.size = nicons; panel->dir.size = nicons;
panel->dir.list = g_new (file_entry, nicons);
fe = panel->dir.list;
count = 0; count = 0;
marked_count = 0; marked_count = 0;
@ -1320,37 +1318,40 @@ create_panel_from_desktop (void)
total = 0; total = 0;
selected_index = -1; selected_index = -1;
for (i = 0; i < layout_cols * layout_rows; i++) if (nicons != 0) {
for (l = layout_slots[i].icons; l; l = l->next) { panel->dir.list = g_new (file_entry, nicons);
DesktopIconInfo *dii;
char *full_name;
dii = l->data; fe = panel->dir.list;
full_name = g_concat_dir_and_file (desktop_directory, dii->filename);
if (mc_lstat (full_name, &s) == -1) { for (i = 0; i < layout_cols * layout_rows; i++)
g_warning ("Could not stat %s, bad things will happen", full_name); for (l = layout_slots[i].icons; l; l = l->next) {
continue; DesktopIconInfo *dii;
char *full_name;
dii = l->data;
full_name = g_concat_dir_and_file (desktop_directory, dii->filename);
if (mc_lstat (full_name, &s) == -1) {
g_warning ("Could not stat %s, bad things will happen",
full_name);
continue;
}
file_entry_fill (fe, &s, full_name);
if (dii->selected) {
marked_count++;
fe->f.marked = TRUE;
if (S_ISDIR (fe->buf.st_mode))
dir_marked_count++;
total += fe->buf.st_size;
}
g_free (full_name);
fe++;
count++;
} }
}
file_entry_fill (fe, &s, full_name);
if (dii->selected) {
#if 0
if (selected_index == -1)
selected_index = count;
#endif
marked_count++;
fe->f.marked = TRUE;
if (S_ISDIR (fe->buf.st_mode))
dir_marked_count++;
total += fe->buf.st_size;
}
g_free (full_name);
fe++;
count++;
}
/* Fill the rest of the panel structure */ /* Fill the rest of the panel structure */
@ -1362,11 +1363,7 @@ create_panel_from_desktop (void)
panel->total = total; panel->total = total;
panel->selected = selected_index; panel->selected = selected_index;
panel->is_a_desktop_panel = TRUE; panel->is_a_desktop_panel = TRUE;
g_assert (panel->count > 0);
#if 0
g_assert (panel->selected != -1);
#endif
return panel; return panel;
} }
@ -1405,7 +1402,9 @@ free_panel_from_desktop (WPanel *panel)
for (i = 0; i < panel->count; i++) for (i = 0; i < panel->count; i++)
g_free (panel->dir.list[i].fname); g_free (panel->dir.list[i].fname);
g_free (panel->dir.list); if (panel->dir.list)
g_free (panel->dir.list);
g_free (panel); g_free (panel);
} }
@ -2427,7 +2426,6 @@ desktop_popup (GdkEventButton *event)
WPanel *panel; WPanel *panel;
gint i; gint i;
popup = gnome_popup_menu_new (desktop_popup_items); popup = gnome_popup_menu_new (desktop_popup_items);
/* First thing we want to do is strip off the STUPID tear off menu... S-: */ /* First thing we want to do is strip off the STUPID tear off menu... S-: */
shell = gnome_panel_new_menu[0].widget->parent; shell = gnome_panel_new_menu[0].widget->parent;
@ -2451,6 +2449,8 @@ desktop_popup (GdkEventButton *event)
layout_panel_gone (panel); layout_panel_gone (panel);
free_panel_from_desktop (panel); free_panel_from_desktop (panel);
gtk_widget_destroy (popup); gtk_widget_destroy (popup);
desktop_reload_icons (FALSE, 0, 0);
} }
/* Draws the rubberband rectangle for selecting icons on the desktop */ /* Draws the rubberband rectangle for selecting icons on the desktop */

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

@ -314,7 +314,7 @@ gnome_exit (void)
w = gnome_message_box_new ( w = gnome_message_box_new (
_("Notice that if you choose to terminate the file manager, you will\n" _("Notice that if you choose to terminate the file manager, you will\n"
"also terminate the GNOME desktop handler.\n\n" "also terminate the GNOME desktop handler.\n\n"
"Are you sure you want to quit?"), "Are you sure you want to exit?"),
GNOME_MESSAGE_BOX_WARNING, GNOME_MESSAGE_BOX_WARNING,
GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_YES,
GNOME_STOCK_BUTTON_NO, GNOME_STOCK_BUTTON_NO,