Commit graph

6 commits

Author SHA1 Message Date
Tomaz Canabrava
e175b1d1ab Remember Trip Selection.
This patch remembers the trip selection across the Dive Tree Model.
It's a tiny bit big because we used to have a variable 'selected
trips' that's now calculed dynamically - this is more future proof.

This is a start of Un-cluttering the view ( for 4.1 I hope to reduce the
code in this class to nearly a half. )

Fixes #303

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-26 11:25:50 -08:00
Dirk Hohndel
7813ac86bf Load translations at run time
This doesn't enable translation switching, but at least we try and load
the correct translation at startup.

We create two global pointers for the currently active translations.

This also removes the remainders of the gettext()/glib based translation
system.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-08 23:11:25 -07:00
Henrik Brautaset Aronsen
4d0b6e698a Changes to make the glib-removal-hack branch build on MacOSX
Tested with the Homebrew packaging system

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 10:42:32 -07:00
Dirk Hohndel
2c4ccc04bd Parse GPS text in C++ and re-implement GPS changed check
This is SO MUCH easier then the convoluted and fragile C / glib code it
replaces.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 10:42:32 -07:00
Benjamin
ae713763c7 Add a helper function to calculate weight display string
Add a helper function to unify the calculation of the
weight display string, instead of having the same calculation
in two places in the code.

Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 11:57:28 -07:00
Dirk Hohndel
29b242c703 Converting the device_info list into a Qt data structure
This data structure was quite fragile and made 'undo' when editing
rather hard to implement. So instead I decided to turn this into a
QMultiMap which seemed like the ideal data structure for it.

This map holds all the dive computer related data indexed by the model. As
QMultiMap it allows multiple entries per key (model string) and
disambiguates between them with the deviceId.

This commit turned out much larger than I wanted. But I didn't manage to
find a clean way to break it up and make the pieces make sense.

So this brings back the Ok / Cancel button for the dive computer edit
dialog. And it makes those two buttons actually do the right thing (which
is what started this whole process). For this to work we simply copy the
map to a working copy and do all edits on that one - and then copy that
over the 'real' map when we accept the changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18 00:24:28 -07:00