The trip selection code was an awkward layering violation.
Whereas dive selections due to dive undo-commands trickled
down via DiveTripModel-->MultiFilterSortModel-->DiveListView,
for trip editing, the DiveListView directly intercepted the
TripEdited signal.
Instead, mimic the dive-selection code. This is a bit longer
but more consistent and logical. The undo/redo of trip changes
is now also a "programmatical" change of the selection.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The way inheritance is implemented for the undo commands confuses the Qt
translation tooling - with the result that the context assumed by the
tools used to extract the strings doesn't match the context calculated
at runtime - so all the translations for the strings in undo commands
fail (including creating proper numerus forms).
This change forces a consistant context tag, at the price of creating a
significant delta for the source strings (the strings themselves stay
the same, but the context for a lot of them changes). I am hoping that
Transifex is smart enough to automagically add the correct translations
for these, but I guess I won't know until I try.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The file command_private.cpp had functions concerning selections
only. To make these functions accessible from outside the undo
machinery, turn it into a part of the core-library. Currently,
only C++ functions are exported. We might think about also
exporting a C interface.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In the future we might want to use undo-commands for mobile as
well (even if not implementing undo).
Therefore, move the undo-command source from desktop-widgets
to their own commands top-level folder.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-11-14 21:02:07 +01:00
Renamed from desktop-widgets/command_edit_trip.cpp (Browse further)