Merge branch 'subsurface-icon' of github.com:henrik242/subsurface
Updated Russian translation in preparation for v3.0

Some strings are not translated yet due to minor bugs.
Needs to be discussed on the mailing list.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Increase the buffer for the gas text in planner

Translations that use UTF-8 could easily create more characters than I had
initially specified.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Imitialize gc y range for GF factor print

It seemed so smart to just base the coordinates on what's already in the
graphics context. Except that we apparently got a 0 to 0 range for y
coordinates if there are no pressure samples for a dive.

This fixes the problem and GF values are shown even for dives without
pressure samples.

Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly reset stop depth if we receive NDL sample from libdivecomputer

The existing code forgot to reset the stopdepth to 0 which resulted in a
bogus safety stop being displayed on some divecomputers after the diver
finished their deco obligation.

Reported-by: Jan.Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix compiling, old api of parse_xml_buffer

Commit 8843ee61 changes the api of 'parse_xml_buffer'. Unfortunately one
occurrence has been left which fails if LIBZIP has been defined.

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly parse translated cardinal directions

We now compare to both the standard English characters ('N', 'E', etc) as
well as to the translated strings (_("N"), _("E")) when parsing GPS
strings.

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Distinguish the two uses of "Gas Used" for translation purposes

One is about the amount, the other about the specific type of gar that was
used.

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update PO files again

Commit acd5a935850 ("Distinguish the two uses of "Gas Used" for
translation purposes") requires us to recreate the PO files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Merge branch 'po-files'

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>

Conflicts:
	po/nb_NO.po
	po/ru_RU.po
Update German translation for "Gas used"

Commit acd5a935850 ("Distinguish the two uses of "Gas Used" for
translation purposes") allows us to get this right.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Updated Norwegian translation

Fixed the different usages of "Gas used", as well as a couple
of other small fixes

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add default GPS location for dive sites we already know about

When editing a new dive, and using a dive site name that we have
already seen previously, and have GPS information for, pick up that
GPS information from the previous dive by default.

NOTE! When editing dive site locations for dives that already have GPS
information, or when we've modified the GPS information explicitly
some way while editing the dive (either through map input or by
editing the text field directly) we do *not* use this automatic logic.

So if you messed up the GPS information some way and want to
re-populate it with the automatic mode, you need to explicitly clear
the GPS text-field, at which point we go back to "ok, let's try to
pick up automatic GPS data from previous dives with the same name"
mode.

Also note that we do the automatic location lookup only when actually
editing the location field. So if you already wrote the dive site
name, then cleared the GPS field, you now need to go back to the dive
site name and edit it again to get the automatic GPS filling.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Allow using the map picker to refine a GPS address in info widget

This sets the dive gps location before calling the gps picker widget.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update Russian translation for "Gas used"

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Increase the buffer for the gas text in planner

UTF-8 strings could create more characters.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix air temperature for multi-dive editing

The air temperature editing was broken when you edited multiple dives at
once: even if you didn't actually change the air temperature, all dives
would be reset to that particular temperature.

The logic for editing dives is that we have a 'master' dive (which is
the dive that all the entries get filled in from), and only if the
entries have changed from what the master dive information was (ie the
user actually edited it) do we change that particular piece of
information.

And we only change it for dives that match the master dive for that
entry.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Sort the devices when adding them to the device list

This doesn't change any real semantics, but it means that we will write
out the device computer information in a well-defined order, rather than
in some random order (before this: reverse order of reading them in).

Having the XML file be as stable as possible is important so that *real*
changes stand out when you make changes to your dives.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Get printing parameters in the begining

- Set parameters for scaling the layout ( w and h_scale_factor),
  number of prints per page and rotation.
- Let draw_page() manage the whole print whith the received params.
- Remove draw_oneperpage() as it's unused.
- Use the w_scale_factor for scaling the fonts.
- Change option text in the GTK menu.

TODO:
- A GTK menu which let the user select the print params directly or ...
- Introduce new predefined options in the printing menu.
- Modify draw_page() for printing "landscaped" 6 dives if selected.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Better fix for translated cardinal directions

The previous attempt in commit f305c5c83fe1 ("Correctly parse translated
cardinal directions") suffered from a bit of false advertising in that it
wasn't, actually, "correct". It made silly assumptions about the length of
the translated strings being 1 and also forgot the middle part of the
algorithm where we use the appearance of 'E' or 'W' (and their translated
brethren) as indication that there are no minutes for the the latitude.

Hopefully this version does better.

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>