summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-12-07 11:58:16 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-12-07 15:11:06 -0800
commitaf290d5eb281662d336b8186a9df1a489d78ec9d (patch)
tree66305a529612c97d6f262c24ce6d024022546f2b /dive.h
parentce6c3ee56d372e2ef8386a065fbf4bce4cfa0ffc (diff)
downloadsubsurface-af290d5eb281662d336b8186a9df1a489d78ec9d.tar.gz
Add typical 0 to 5 star rating for dives
This works ok-ish, but doesn't allow us to click on the stars and edit them in the divelist, which a user might expect to be able to do - in most "star rating UIs" you simply click on the n-th star to set that rating. Here you need to edit the dive and pick the rating from a drop down menu. Minor oddity: you can actually (if you force it) write anything you want into the star rating. But anything that isn't one of the predefined strings simply results in a zero star rating. Overall the UI feels a bit... forced. But I think this is quite useful anyway. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index ccb007dcb..f0808efb4 100644
--- a/dive.h
+++ b/dive.h
@@ -199,6 +199,7 @@ struct dive {
char *location;
char *notes;
char *divemaster, *buddy;
+ int rating;
double latitude, longitude;
depth_t maxdepth, meandepth;
duration_t duration, surfacetime;
@@ -313,5 +314,14 @@ const char *monthname(int mon);
#define UTF8_DEGREE "\xc2\xb0"
#define UTF8_SUBSCRIPT_2 "\xe2\x82\x82"
+#define UTF8_WHITESTAR "\xe2\x98\x86"
+#define UTF8_BLACKSTAR "\xe2\x98\x85"
+#define ZERO_STARS UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR
+#define ONE_STARS UTF8_BLACKSTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR
+#define TWO_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR
+#define THREE_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_WHITESTAR UTF8_WHITESTAR
+#define FOUR_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_WHITESTAR
+#define FIVE_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR
+extern const char *star_strings[];
#endif /* DIVE_H */