From 9e4f9fad19bd4696bf08da67b60ed9d2eb29b446 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 9 Apr 2013 13:06:30 -0700 Subject: Store the tag names instead of an opaque number And as we need the names for that, simplify the way we show the tags in the Dive Info tab (and mark them for translation while we are at it). In the process I renamed the constants to DTAG_ from DTYPE_ (and made their nature as being just bits more obvious). Also mark the box on the Info tab "Dive Tags", not "Dive Type". Signed-off-by: Dirk Hohndel --- info.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'info.c') diff --git a/info.c b/info.c index 26a3f471a..d79b44faa 100644 --- a/info.c +++ b/info.c @@ -893,55 +893,55 @@ static void dive_info_widget(GtkWidget *obox, struct dive *dive, struct dive_inf gtk_box_pack_start(GTK_BOX(framebox), sbox, TRUE, FALSE, 3); /* 1st line */ button = gtk_check_button_new_with_label(_("Boat Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_BOAT); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_BOAT); 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 (DTYPE_BOAT)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_BOAT)); button = gtk_check_button_new_with_label(_("Shore Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_SHORE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_SHORE); 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 (DTYPE_SHORE)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_SHORE)); button = gtk_check_button_new_with_label(_("Pool Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_POOL); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_POOL); 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 (DTYPE_POOL)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_POOL)); sbox = gtk_hbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(framebox), sbox, TRUE, FALSE, 3); /* 2nd line */ button = gtk_check_button_new_with_label(_("Drift Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_DRIFT); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_DRIFT); 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 (DTYPE_DRIFT)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_DRIFT)); button = gtk_check_button_new_with_label(_("Deep Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_DEEP); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_DEEP); 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 (DTYPE_DEEP)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_DEEP)); button = gtk_check_button_new_with_label(_("Cavern Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_CAVERN); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_CAVERN); 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 (DTYPE_CAVERN)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_CAVERN)); sbox = gtk_hbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(framebox), sbox, TRUE, FALSE, 3); /* 3rd line */ button = gtk_check_button_new_with_label(_("Ice Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_ICE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_ICE); 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 (DTYPE_ICE)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_ICE)); button = gtk_check_button_new_with_label(_("Wreck Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_WRECK); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_WRECK); 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 (DTYPE_WRECK)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_WRECK)); button = gtk_check_button_new_with_label(_("Cave Dive")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTYPE_CAVE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), dive->dive_tags & DTAG_CAVE); 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 (DTYPE_CAVE)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(divetag_toggle_cb), GINT_TO_POINTER (DTAG_CAVE)); /* only show notes if editing a single dive */ if (multi) { -- cgit v1.2.3-70-g09d2