Commit graph

6 commits

Author SHA1 Message Date
Berthold Stoeger
3c786e35c3 undo: fix annoying warning message when deleting pictures
The RemovePictures command filters the pictures provided by the
UI: only actually existing pictures are removed. The code was
buggy: the original list was copied and then the filtered list
was added. Thus, every picture was listed twice leading to
annoying warning messages. Remove the copy.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-19 20:19:51 +01:00
Berthold Stoeger
77566fe285 undo: add \n to console warning error messages
To make the output more readable.

Moreover, fix a comment-typo.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-19 20:19:51 +01:00
Berthold Stoeger
ab6cac9799 media: give newly created dive sites a name
When adding a picture with GPS information, a dive site was added
if the dive didn't have any. The dive site had the empty string as
name, leading to a confusing UI experience.

We could catch the empty string at numerous places and replace it
by some dummy string. This commit goes the distinctly less invasive
route and adds the dive site with the "unnamed dive site" string
(translated to the user language) as name.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-08 08:51:37 -07:00
Berthold Stoeger
4374605c12 undo: make adding of pictures undoable
This one is a bit hairy, because two things might happen if the
picture has a geo location:
- A dive gets a newly generated dive site set.
- The dive site of a dive is edited.
Therefore the undo command has to store keep track of that.
Oh my.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-06 13:58:09 -07:00
Berthold Stoeger
434644b381 undo: make picture (media) deletion undoable
The code is rather complex. Firstly, we have different representations
of pictures throughout the code. Secondly, this tries to do add the
pictures in batches to the divepicture model and that is always rather
tricky.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-06 13:58:09 -07:00
Berthold Stoeger
e61641c79c undo: implement undo of setting a picture time by drag&drop
Even though the functionality is seemingly trivial, this is a bit
invasive, as the code has to be split into two distinct parts:
1) Post undo command
2) React to changes to the divelist

Don't compile that code on mobile.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-06 13:58:09 -07:00