* NOTW: NULL and "" need to be treated as "unchanged" */
static int text_changed(const char *old, const char *new)
{
* NOTW: NULL and "" need to be treated as "unchanged" */
static int text_changed(const char *old, const char *new)
{
- return ((old && strcmp(old,new)) ||
- (!old && strcmp("",new)));
+ return (old && strcmp(old,new)) ||
+ (!old && strcmp("",new));
info->divemaster = text_entry(hbox, "Dive master", people_list, dive->divemaster);
info->buddy = text_entry(hbox, "Buddy", people_list, dive->buddy);
info->divemaster = text_entry(hbox, "Dive master", people_list, dive->divemaster);
info->buddy = text_entry(hbox, "Buddy", people_list, dive->buddy);
info->rating = text_entry(hbox, "Rating", star_list, star_strings[dive->rating]);
info->notes = text_view(box, "Notes", READ_WRITE);
if (dive->notes && *dive->notes)
gtk_text_buffer_set_text(gtk_text_view_get_buffer(info->notes), dive->notes, -1);
info->rating = text_entry(hbox, "Rating", star_list, star_strings[dive->rating]);
info->notes = text_view(box, "Notes", READ_WRITE);
if (dive->notes && *dive->notes)
gtk_text_buffer_set_text(gtk_text_view_get_buffer(info->notes), dive->notes, -1);
frame = gtk_frame_new("Cylinder");
cylinder = cylinder_list_widget();
gtk_container_add(GTK_CONTAINER(frame), cylinder);
frame = gtk_frame_new("Cylinder");
cylinder = cylinder_list_widget();
gtk_container_add(GTK_CONTAINER(frame), cylinder);
- gtk_box_pack_start(GTK_BOX(box), frame, FALSE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, TRUE, 0);
divemaster = text_value(hbox, "Divemaster");
buddy = text_value(hbox, "Buddy");
divemaster = text_value(hbox, "Divemaster");
buddy = text_value(hbox, "Buddy");
rating = text_value(hbox, "Rating");
notes = text_view(vbox, "Notes", READ_ONLY);
rating = text_value(hbox, "Rating");
notes = text_view(vbox, "Notes", READ_ONLY);