[PATCH] Added a dive add/edit/delete dialog

Lubomir I. Ivanov neolit123 at gmail.com
Fri Nov 11 07:02:42 PST 2011

----- Original Message ----- 
From: "John Van Ostrand" <john at netdirect.ca>
To: <subsurface at hohndel.org>
Sent: Friday, November 11, 2011 3:06 PM
Subject: [PATCH] Added a dive add/edit/delete dialog

> Dives can now be manually entered, altered and deleted. A new edit menu
> option exists that provides three options, Add, Edit and Delete dive.

the new dialog looks useful,
i was working on delete functionality, but didn't go that far.

a couple of notes on the patch:
"tm.tm_gmtoff" and "tm.tm_zone" aren't really part of the c99 standard and
therefore there are some issues with those. they either have different
deffinitions for different compilers and library implementations or are simply
missing - like in the case of mingw/win32 (there are some workaround which
aren't pretty).

/* Zero out unused tm members so comparison works. */
detail->data.when.tm_gmtoff = 0;
perhaps an initial "memset(...,0,sizeof(tm));" somewhere will do ?

..time_of_day_widget(.......,uint hour, uint min, uint sec)

i don't think "uint" is part of the standard as well. "uint32_t" from "stdint.h"
should be much more portable...or simply "unsigned int" i guess.

you could add some keyboard and mouse interaction in the list.
this is the "double click" / "click" action that could open the edit dialog:

dive_list_delete_selected(...) clears multiple entries from the list (not from
memory though..)
key_cb handles the delete key:
it should show the yes/no dialog as well.


More information about the subsurface mailing list