This header is a rebase artifact and introduces a pointless
column in the cylinder tables. It was erroneously introduced
in 6622f42aab.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
As of today some of the icons that we need are no longer in the git repoo but
instead created via script. Instead of making this work everywhere, let's just
use a working SHA...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Nobody was ever listening to this signal(?) and the last sender
was removed in ac52034778.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The DiveFilter class defined the showDive() function to test
whether a dive should be filtered or not. This was used in
DiveTripModel to loop over all dives or all dives affected by
an editing action.
This restricts us in how we do filtering: We can't use indexes
that give us directly the result. To make the filtering more
flexible, move the actual loops that do the filtering to
the DiveFilter class.
The undo-commands likewise called directly the showDive()
function to check whether newly added dives are shown.
Use the new interface here as well.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When changing the filter-criterion and the current dive is
hidden, a new dive is made current. However, when a dive is
hidden because it was edited, it is still shown.
Make this consistent by also selecing a new current dive
in the latter case. Do this by comparing the current_dive
before and after calculating the filter. Since this is now
done in multiple places move this code to the ShownChange
class.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Since we now filter at the model level, items are by definition
shown. No need for a flag.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This role was used by the filter-proxy model as filter criterion.
Since we don't use that model to filter anymore, we can remove
the role.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Since we're doing the filtering at the core, don't filter
in the sort-model (which is now inappropriately named).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We use a QFilterProxyModel to filter out dives that are hidden
according to the current filter-criterion. Instead, filter the
dives already at the DiveTripModel level. Filter out hidden
dives immediately when receiving them. The only difficult case
is when dives are changed, because then visibility can change.
This means that we have three cases to consider:
1) Visibility unchanged -> send change signal
2) Change from hidden to unhidden -> add dives to model
3) Change from unhidden to hidden -> remove dives from model
Things get complicated by the fact that the tree-version of
the model might have to add/remove full trips!
Suggested-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In moveDiveToTrip(), the dive was first removed from its old trip
and then added to the new trip. This function is also used to
remove the dive from its trip (by moving it to the "null-trip"
if you whish). Even in that case add_dive_to_trip() was called.
The only reason why this didn't crash is that add_dive_to_trip()
checks whether old and new trip are the same. This is the case
when adding to the "null-trip", since the dive was removed from
the trip just before.
To cut a long story short, to trust on add_dive_to_trip() not
crashing if moving from the null-trip to the null-trip is
way to subtly. If we remove a dive from its trip, don't call
add_dive_to_trip() in the first place.
Reported-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Use the TemplateRadioButton to get the default styling - and by switching to the
RadioButton from Controls.2 we also get exclusivity by default.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace passive voice 'one' with active voice 'you'. More strongly articulate
the limitations for FTDI / cable based downloads on mobile devices.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When running mobile on desktop there are some odd jumps in the mouse position while in
drag mode (press and hold, then move). They make the user interface seem jerky.
But I haven't observed the same behavior on the mobile device when testing. So
I'm not sure what to do with that.
Using opacity to indicate that the user is able to pan the profile seems reasonably
obvious; not sure if it's the best possible way to do this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should never have been merged as it was. The UI was atrocious and the
functionality was by and large untested.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There is no native file dialog, access to the file system is highly restricted
and will be much more so in Android 11. Let's not even start with this.
This should never have been merged as it was.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A tablet or phone is not a computer. What would you do with a CSV or TeX/LaTeX
file on a phone. Yeah, I get it, feature parity.
This should never have been merged.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Because of the multiple string confusion, we'd get the names wrong for
modechange events. If we then made other changes to the dive and saved
the end result back, they'd now be wrong in the git cloud storage too.
Fix it up manually by just noticing that there's a 'divemode' string on
the event line, which can only happen with modechange events.
Maybe we should report the fixup? This just silently fixes it (but only
for the git save format).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We had some fairly obscure rules for how strings were parsed, and it
actually caused bugs when the same line had multiple strings in it.
That normally doesn't happen, and the cases where it was _supposed_ to
happen had special cases for it (divecomputer ID lines, and tag lines).
But by mistake, we had introduced a case of that for the event line
handling in commit b9174332d ("Read and write divemode changes (xml and
git)"), and nobody realized that the divemode string addition meant that
"oops, now it's corrupting the event name". An event line could look
like this:
event 40:00 type=8 divemode="OC" name="modechange"
where we now had both that "OC" and "modechange" strings, and the code
to pick the name just picked the first string. So we'd end up
effectively mis-parsing the above line as
event 40:00 type=8 divemode="OC" name="OC"
which is obviously wrong.
The dive mode didn't really need to be a string in the first place
(there is nothing to quote, and no spaces in it), but hey, here we are.
We can't just magially fix the existing broken saves.
So make it more straightforward to handle strings in the git format line
parser. We still stash the different decoded strings together in one
special memory buffer, but now the parser helpers automatically untangle
it as they traverse the key value pairs.
This is still overly subtle code, and it doesn't fix the cases where
we've saved the wrong data back. That comes later.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- fix Oceanic VT Pro date parsing
- add Sherwood Wisdom 4 and Scubapro Aladin A1 IDs from Janice McLaughlin
- fix Cressi gasmix index and depth parsing (the gasmix index bit had been
misparsed as very deep depth)
- Implement the gas mix sample
- Limit the depth value to 11 bits
- Add support for the Scubapro A1
- Add support for the Sherwood Wisdom 4
- Fix the vtpro datetime parsing
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we change the gps location of a dive that didn't have a dive site associated
before (which is the normal case when a dive was just downloaded from a dive
computer), a new dive site is created with that GPS fix and added to the dive.
We need to mark that dive as changed in order for the changes to be saved to
storage.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This changes the 'GPS' entry to be called 'Location', moves the 'Map' entry
below that, and reuses the map icon for both the map inside this submenu and
for the main menu item.
It moves the 'About' entry under 'Help' and both 'Export' and 'Dive summary'
under 'Dive management'.
This way we have only five (or with 'Developer' enabled, six) entries in the
main menu making it much more appropriate for really tiny screens.
Additionally, the entrieis moved into sub-menus are ones that are not all that
commonly used.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the official Qt binaries can no longer be installed without disclosing
credentials (well, sure, that could be done through secrets), I decided that
we should go back to packaging just the part of the iOS Qt SDK that we need.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is intended for testing on the desktop; this way a developer can reproduce
the screen size (in grid units) that a user might experience.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the planner we used to filter out "unused" cylinders as in the
equipment tab. It is unclear whether that makes sense or can even
easily be reproduced, since such cylinders have to come from an
imported dive.
To be on the save side, let's not do this. Replace the
CylindersFilteredModel introduced recently by a plain
CylindersModel.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The cylinder-model had an instance() function, but actually
there were two cylinder models: one used by the equipment tab,
one used by the planner.
This is misleading. Therefore, remove the instance() function
and make the cylinder-model a subobject of the planner-model.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When the show_unused_cylinders flag is not set, the cylinder tables
in the equipment tab and the planner should not show unused cylinders.
However, the code in CylindersModel is fundamentally broken if the
unused cylinders are not at the end of the list: The correct number
of cylinders is shown, but not the correct cylinders.
Therefore, add a higher-level CylindersModelFiltered model on top
of CylindersModel that does the actual filtering. Some calls are
routed through to the base model (notably those that take indexes,
as these have to be mapped), for some calls the caller has to get
access to the source model first. We might want to adjust this.
For filtering, reuse the already existing show_cylinder function
and export it via CylindersModel.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Currently, we do substring search. Implement starts-with and
exact mode (for example when search for "Cave vs. Cavern" tags).
For each textual search criterion add a combo-box.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Buttons ignore the width of the enclosed label and base their width on the
illogically named implicitWidth instead.
Also translate the button text.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Creating more space for the header column and a little visual separation for
the different sections.
The commit is much smaller than it looks - try 'git show -w'.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>