X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=info.c;h=d9379ac68b200976f08c9afada59bd87f88bb736;hb=9d46581913ce33664e333a4d6eaf7f4e26e20b1c;hp=17667a87bfad98f728b114297056a20053f6caf4;hpb=21fd73515f3bdcd606aaf0c5b16dae1775d7a37d;p=ext%2Fsubsurface.git diff --git a/info.c b/info.c index 17667a8..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: @@ -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);