Implement Close menu option that allows closing the data file

This requires some helper routines that allow us to clear out all the
widgets.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-09-10 14:32:55 -07:00
parent 78c5aa9f07
commit a8fd77865c
5 changed files with 83 additions and 2 deletions

11
info.c
View file

@ -113,6 +113,17 @@ void show_dive_info(struct dive *dive)
const char *text;
char buffer[80];
if (!dive) {
gtk_window_set_title(GTK_WINDOW(main_window), "Subsurface");
SET_TEXT_VALUE(divemaster);
SET_TEXT_VALUE(buddy);
SET_TEXT_VALUE(location);
SET_TEXT_VALUE(suit);
gtk_entry_set_text(rating, star_strings[0]);
gtk_text_buffer_set_text(gtk_text_view_get_buffer(notes), "", -1);
return;
}
/* dive number and location (or lacking that, the date) go in the window title */
text = dive->location;
if (!text)