]> git.tdb.fi Git - ext/subsurface.git/blobdiff - info.c
Separate out single dive statistics and total statistics
[ext/subsurface.git] / info.c
diff --git a/info.c b/info.c
index a298a07e3e2080769e8936553bb6ee19b215f1fb..6a4a296b004013d7b77ba9bb746b79225385f6d7 100644 (file)
--- a/info.c
+++ b/info.c
@@ -38,8 +38,8 @@ static char *get_text(GtkTextView *view)
  * 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));
 }
 
 static char *get_combo_box_entry_text(GtkComboBoxEntry *combo_box, char **textp)
@@ -258,13 +258,13 @@ void add_location(const char *string)
 
 static int get_rating(const char *string)
 {
-       int rating = 0;
+       int rating_val = 0;
        int i;
 
        for (i = 0; i <= 5; i++)
                if (!strcmp(star_strings[i],string))
-                       rating = i;
-       return rating;
+                       rating_val = i;
+       return rating_val;
 }
 
 struct dive_info {
@@ -333,16 +333,23 @@ static void dive_info_widget(GtkWidget *box, struct dive *dive, struct dive_info
 
        info->divemaster = text_entry(hbox, "Dive master", people_list, dive->divemaster);
        info->buddy = text_entry(hbox, "Buddy", people_list, dive->buddy);
+
+       hbox = gtk_hbox_new(FALSE, 3);
+       gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, TRUE, 0);
+
        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);
 
+       hbox = gtk_hbox_new(FALSE, 3);
+       gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, TRUE, 0);
+
        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);
 }
 
 int edit_dive_info(struct dive *dive)
@@ -397,6 +404,10 @@ GtkWidget *extended_dive_info_widget(void)
 
        divemaster = text_value(hbox, "Divemaster");
        buddy = text_value(hbox, "Buddy");
+
+       hbox = gtk_hbox_new(FALSE, 3);
+       gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
+
        rating = text_value(hbox, "Rating");
 
        notes = text_view(vbox, "Notes", READ_ONLY);