aboutsummaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-11 11:54:55 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-11 11:54:55 -0700
commit9580109406f79698b570e917c21b8844f9de34b5 (patch)
tree9417340e9fd6850df099639af8f8d7fac2e4404d /info.c
parent6538e5bba00b51a7253b6cff927c8774f1b39e2b (diff)
downloadsubsurface-9580109406f79698b570e917c21b8844f9de34b5.tar.gz
Show dive number (if it exists) in the location note
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/info.c b/info.c
index 9cb048b80..32b830dd8 100644
--- a/info.c
+++ b/info.c
@@ -51,6 +51,7 @@ void show_dive_info(struct dive *dive)
struct tm *tm;
char buffer[80];
char *text;
+ int len;
if (!dive) {
gtk_label_set_text(GTK_LABEL(divedate), "no dive");
@@ -115,7 +116,12 @@ void show_dive_info(struct dive *dive)
text = dive->location ? : "";
gtk_entry_set_text(location, text);
- gtk_label_set_text(GTK_LABEL(locationnote), text);
+
+ len = 0;
+ if (dive->nr)
+ len = snprintf(buffer, sizeof(buffer), "%d. ", dive->nr);
+ snprintf(buffer+len, sizeof(buffer)-len, "%s", text);
+ gtk_label_set_text(GTK_LABEL(locationnote), buffer);
text = dive->notes ? : "";
gtk_text_buffer_set_text(notes, text, -1);