aboutsummaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-01 22:22:25 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-01 22:22:25 -0700
commit8042246df6f7673873e02f5255029370b1f42e3c (patch)
tree91c55b6102a564af928a2b7a1c6070f5a6833b04 /info.c
parent2cd2cafdf4fc1ea37872f172a62d3d38220adf64 (diff)
downloadsubsurface-8042246df6f7673873e02f5255029370b1f42e3c.tar.gz
Show temperature in the info summary
If it exists, it really does help identify the dive. At least it does for me: "local or Maui"? Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/info.c b/info.c
index 3adbe15d1..dc3a95bde 100644
--- a/info.c
+++ b/info.c
@@ -5,7 +5,7 @@
#include "dive.h"
#include "display.h"
-static GtkWidget *divedate, *divetime, *depth, *duration;
+static GtkWidget *divedate, *divetime, *depth, *duration, *temperature;
static GtkTextBuffer *location, *notes;
static int location_changed = 1, notes_changed = 1;
static struct dive *buffered_dive;
@@ -85,6 +85,13 @@ void update_dive_info(struct dive *dive)
dive->duration.seconds / 60);
gtk_label_set_text(GTK_LABEL(duration), buffer);
+ *buffer = 0;
+ if (dive->watertemp.mkelvin)
+ snprintf(buffer, sizeof(buffer),
+ "%d C",
+ to_C(dive->watertemp));
+ gtk_label_set_text(GTK_LABEL(temperature), buffer);
+
text = dive->location ? : "";
gtk_text_buffer_set_text(location, text, -1);
text = dive->notes ? : "";
@@ -115,6 +122,7 @@ GtkWidget *dive_info_frame(void)
divetime = info_label(hbox, "time");
depth = info_label(hbox, "depth");
duration = info_label(hbox, "duration");
+ temperature = info_label(hbox, "temperature");
return frame;
}