[PATCH] Add tags for night and freshwater

Pablo Wolter pwolter at gmail.com
Tue Apr 9 15:39:47 PDT 2013


Sorry, accidentally I just reply to Dirk and not the list.
*
*
*Saludos,*
*
Pablo Wolter
pwolter at gmail.com

*


On Tue, Apr 9, 2013 at 3:29 PM, Pablo Wolter <pwolter at gmail.com> wrote:

> I think default it to saltwater is a good choice, unless you are lucky
> enough to live in Playa del Carmen, Mexico or Florida and do cave dive
> every day .... all the time (said with jealousy).
>
> The shore/boat depends too. I do lots of shore dives mainly. But it might
> be people who do only boat diving. Maybe put this in the user's preferences?
> *
> *
> *Saludos,*
> *
> Pablo Wolter
> pwolter at gmail.com
>
> *
>
>
> On Tue, Apr 9, 2013 at 2:17 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
>>
>> This patch brings up an interesting idea... should we have "automatic"
>> tags for the things that are mutually exclusive? Henrik just adds
>> "freshwater" but no "saltwater". So the UI could display "saltwater" if
>> there isn't a "freshwater" tag (and I'll need to add plumbing that
>> automagically sets this tag if a salinity of 1.0 is in the dive).
>>
>> We could do the same things with "boat" and "shore". Default to "shore"
>> but allow users to switch to "boat" (is there another alternative value?)
>>
>> Are there other logical pairs that I'm missing? Is this a good idea?
>>
>> /D
>>
>> subsurface at henrik.synth.no writes:
>>
>> > From: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>
>> >
>> > Also trim the redundant "Dive" text from "Lake Dive", "Pool Dive", ....
>> >
>> > Signed-off-by: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>
>> > ---
>> >  dive.h       |  4 +++-
>> >  info.c       | 44 +++++++++++++++++++++++++++-----------------
>> >  statistics.c |  2 +-
>> >  3 files changed, 31 insertions(+), 19 deletions(-)
>> >
>> > diff --git a/dive.h b/dive.h
>> > index 7702b44..eaf60d3 100644
>> > --- a/dive.h
>> > +++ b/dive.h
>> > @@ -42,7 +42,9 @@
>> >  #define DTAG_POOL            (1 << 10)
>> >  #define DTAG_LAKE            (1 << 11)
>> >  #define DTAG_RIVER           (1 << 12)
>> > -#define DTAG_NR                      13
>> > +#define DTAG_NIGHT           (1 << 13)
>> > +#define DTAG_FRESH           (1 << 14)
>> > +#define DTAG_NR                      15
>> >  /* defined in statistics.c */
>> >  extern char *dtag_names[DTAG_NR];
>> >
>> > diff --git a/info.c b/info.c
>> > index 707fd9a..4400d53 100644
>> > --- a/info.c
>> > +++ b/info.c
>> > @@ -892,67 +892,77 @@ static void dive_info_widget(GtkWidget *obox,
>> struct dive *dive, struct dive_inf
>> >       sbox = gtk_hbox_new(FALSE, 6);
>> >       gtk_box_pack_start(GTK_BOX(framebox), sbox, TRUE, FALSE, 3);
>> >  /* 1st line */
>> > -     button = gtk_check_button_new_with_label(_("Boat Dive"));
>> > +     button = gtk_check_button_new_with_label(_("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 (DTAG_BOAT));
>> >
>> > -     button = gtk_check_button_new_with_label(_("Shore Dive"));
>> > +     button = gtk_check_button_new_with_label(_("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 (DTAG_SHORE));
>> >
>> > -     button = gtk_check_button_new_with_label(_("Pool Dive"));
>> > +     button = gtk_check_button_new_with_label(_("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 (DTAG_POOL));
>> >
>> > -        button = gtk_check_button_new_with_label(_("Lake Dive"));
>> > +        button = gtk_check_button_new_with_label(_("Lake"));
>> >          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));
>> >
>> > -     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(_("River Dive"));
>> > +        button = gtk_check_button_new_with_label(_("River"));
>> >          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));
>> >
>> > -     button = gtk_check_button_new_with_label(_("Drift Dive"));
>> > +     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"));
>> >       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 (DTAG_DRIFT));
>> >
>> > -     button = gtk_check_button_new_with_label(_("Deep Dive"));
>> > +     button = gtk_check_button_new_with_label(_("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 (DTAG_DEEP));
>> >
>> > -     button = gtk_check_button_new_with_label(_("Cavern Dive"));
>> > +     button = gtk_check_button_new_with_label(_("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 (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"));
>> > +     button = gtk_check_button_new_with_label(_("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 (DTAG_ICE));
>> >
>> > -     button = gtk_check_button_new_with_label(_("Wreck Dive"));
>> > +     button = gtk_check_button_new_with_label(_("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 (DTAG_WRECK));
>> >
>> > -     button = gtk_check_button_new_with_label(_("Cave Dive"));
>> > +     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(_("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 (DTAG_CAVE));
>> >
>> > +     button = gtk_check_button_new_with_label(_("Night"));
>> > +     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
>> dive->dive_tags & DTAG_NIGHT);
>> > +     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_NIGHT));
>> > +
>> > +     button = gtk_check_button_new_with_label(_("Freshwater"));
>> > +     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
>> dive->dive_tags & DTAG_FRESH);
>> > +     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_FRESH));
>> > +
>> >       /* only show notes if editing a single dive */
>> >       if (multi) {
>> >               info->notes = NULL;
>> > diff --git a/statistics.c b/statistics.c
>> > index 0413941..241e592 100644
>> > --- a/statistics.c
>> > +++ b/statistics.c
>> > @@ -20,7 +20,7 @@
>> >  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_("lake"),
>> > -     N_("river")
>> > +     N_("river"), N_("night"), N_("freshwater")
>> >  };
>> >
>> >  typedef struct {
>> > --
>> > 1.8.1.3
>> >
>> > _______________________________________________
>> > subsurface mailing list
>> > subsurface at hohndel.org
>> > http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>
>> --
>> Dirk Hohndel
>> Intel Open Source Technology Center
>> _______________________________________________
>> subsurface mailing list
>> subsurface at hohndel.org
>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130409/f7aaa593/attachment-0001.html>


More information about the subsurface mailing list