[PATCH] Add lake and river to the list of supported tags

Pierre-Yves Chibon pingou at pingoured.fr
Tue Apr 9 13:40:16 PDT 2013


Signed-off-by: Pierre-Yves Chibon <pingou at pingoured.fr>
---

Here is a patch adding Lake and River to the list of tags.

Pierre


 dive.h       |    2 ++
 info.c       |   10 ++++++++++
 statistics.c |    3 ++-
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/dive.h b/dive.h
index 4daa541..8c4ed9a 100644
--- a/dive.h
+++ b/dive.h
@@ -40,6 +40,8 @@
 #define DTAG_CAVE		(1 << 8)
 #define DTAG_ALTITUDE		(1 << 9)
 #define DTAG_POOL		(1 << 10)
+#define DTAG_LAKE		(1 << 11)
+#define DTAG_RIVER		(1 << 12)
 #define DTAG_NR			11
 /* defined in statistics.c */
 extern char *dtag_names[DTAG_NR];
diff --git a/info.c b/info.c
index d79b44f..3acd405 100644
--- a/info.c
+++ b/info.c
@@ -907,6 +907,16 @@ static void dive_info_widget(GtkWidget *obox, struct dive *dive, struct dive_inf
 	gtk_box_pack_start(GTK_BOX(sbox), button, FALSE, FALSE, 6);
 	g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_POOL));
 
+        button = gtk_check_button_new_with_label(_("Lake Dive"));
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_LAKE);
+        gtk_box_pack_start(GTK_BOX(sbox), button, FALSE, FALSE, 6);
+        g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_LAKE));
+
+        button = gtk_check_button_new_with_label(_("River Dive"));
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_RIVER);
+        gtk_box_pack_start(GTK_BOX(sbox), button, FALSE, FALSE, 6);
+        g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_RIVER));
+
 	sbox = gtk_hbox_new(FALSE, 6);
 	gtk_box_pack_start(GTK_BOX(framebox), sbox, TRUE, FALSE, 3);
 /* 2nd line */
diff --git a/statistics.c b/statistics.c
index acb9ee3..0413941 100644
--- a/statistics.c
+++ b/statistics.c
@@ -19,7 +19,8 @@
  * in save-xml.c */
 char *dtag_names[DTAG_NR] = {
 	N_("invalid"), N_("boat"), N_("shore"), N_("drift"), N_("deep"), N_("cavern"),
-	N_("ice"), N_("wreck"), N_("cave"), N_("altitude"), N_("pool")
+	N_("ice"), N_("wreck"), N_("cave"), N_("altitude"), N_("pool"), N_("lake"),
+	N_("river")
 };
 
 typedef struct {
-- 
1.7.1



More information about the subsurface mailing list