X-Git-Url: http://git.tdb.fi/?p=ext%2Fsubsurface.git;a=blobdiff_plain;f=info.c;h=d9379ac68b200976f08c9afada59bd87f88bb736;hp=8db606344e7394ecbe44d5dbc961788d669c0dce;hb=HEAD;hpb=0c0ec7e4f60d9678c3950757ccb8f791f10d033c diff --git a/info.c b/info.c index 8db6063..d9379ac 100644 --- a/info.c +++ b/info.c @@ -1,7 +1,7 @@ /* info.c */ -/* creates the UI for the info frame - +/* creates the UI for the info frame - * controlled through the following interfaces: - * + * * void show_dive_info(struct dive *dive) * * called from gtk-ui: @@ -482,7 +482,7 @@ void update_equipment_data(struct dive *dive, struct dive *master) if ( ! cylinders_equal(remember_cyl, master->cylinder) && (no_cylinders(dive->cylinder) || cylinders_equal(dive->cylinder, remember_cyl))) - memcpy(dive->cylinder, master->cylinder, CYL_BYTES); + copy_cylinders(master->cylinder, dive->cylinder); if (! weightsystems_equal(remember_ws, master->weightsystem) && (no_weightsystems(dive->weightsystem) || weightsystems_equal(dive->weightsystem, remember_ws))) @@ -496,6 +496,7 @@ int edit_multi_dive_info(struct dive *single_dive) GtkWidget *dialog, *vbox; struct dive_info info; struct dive *master; + gboolean multi; dialog = gtk_dialog_new_with_buttons("Dive Info", GTK_WINDOW(main_window), @@ -508,7 +509,22 @@ int edit_multi_dive_info(struct dive *single_dive) master = single_dive; if (!master) master = current_dive; - dive_info_widget(vbox, master, &info, !single_dive); + + /* See if we should use multi dive mode */ + multi = FALSE; + if (!single_dive) { + int i; + struct dive *dive; + + for_each_dive(i, dive) { + if (dive != master && dive->selected) { + multi = TRUE; + break; + } + } + } + + dive_info_widget(vbox, master, &info, multi); show_dive_equipment(master, W_IDX_SECONDARY); save_equipment_data(master); gtk_widget_show_all(dialog);