extern int add_new_dive(struct dive *dive);
extern int edit_dive_info(struct dive *dive);
-extern int edit_multi_dive_info(int idx);
+extern int edit_multi_dive_info(struct dive *single_dive);
extern void dive_list_update_dives(void);
extern void flush_divelist(struct dive *dive);
void edit_dive_cb(GtkWidget *menuitem, gpointer data)
{
- edit_multi_dive_info(-1);
+ edit_multi_dive_info(NULL);
}
static void expand_all_cb(GtkWidget *menuitem, GtkTreeView *tree_view)
static void info_menu_edit_cb(GtkMenuItem *menuitem, gpointer user_data)
{
- edit_multi_dive_info(-1);
+ edit_multi_dive_info(NULL);
}
static void info_menu_delete_cb(GtkMenuItem *menuitem, gpointer user_data)
}
/* A negative index means "all selected" */
-int edit_multi_dive_info(int index)
+int edit_multi_dive_info(struct dive *single_dive)
{
int success;
GtkWidget *dialog, *vbox;
NULL);
vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
- master = get_dive(index);
+ master = single_dive;
if (!master)
master = current_dive;
- dive_info_widget(vbox, master, &info, index < 0);
+ dive_info_widget(vbox, master, &info, !single_dive);
show_dive_equipment(master, W_IDX_SECONDARY);
save_equipment_data(master);
gtk_widget_show_all(dialog);
success = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT;
if (success) {
/* Update the non-current selected dives first */
- if (index < 0) {
+ if (!single_dive) {
int i;
struct dive *dive;
int edit_dive_info(struct dive *dive)
{
- int idx;
-
if (!dive)
return 0;
- idx = dive->number;
- return edit_multi_dive_info(idx);
+ return edit_multi_dive_info(dive);
}
static GtkWidget *frame_box(GtkWidget *vbox, const char *fmt, ...)