Since no dive site field editing enters edit mode anymore,
the whole edit mode state and code can be removed from the
widget.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Simply copy the code of note editing. It's a bit more complex,
since we have to parse the Gps coordinates. For consitency,
rename the COORD field to LOCATION (the field in the dive_site
struct is called LOCATION).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Simply copy the code of notes editing, but use the taxonomy_* functions
to read and set the value. Moreover, replace the three TAXONOMY_n field
ids by a single TAXONOMY id. We will probably never show one column per
taxonomy field, but rather a single column with a string derived from all
taxonomy fields.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Implement a dive site addition undo command and connect it to
the add dive site button. The added dive site has a default
name ("new dive site").
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Simply duplicate the code of dive site name editing. Split out
the common functionality that swaps a C and a Qt string.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Implement an undo command that edits the name of a dive site.
Connect it to the dive site table, so that names can be edited
directly in the table.
Send signals on undo / redo so that the dive site table and
the dive site edit widget can be updated.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Create a new undo-command for deleting dive sites. If there are dives
associated with that site, the dives will be removed. The frontend
is not yet updated in such a case, as that infrastructure is in a
different PR.
Connect the trashcan icon of the dive site table to the undo command.
Currently, this code is in the dive site model, which makes little
sense, but is how the TableView class works. We might want to change
that when cylinder and weight editing are made undoable.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>