summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-02-14 23:07:12 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit5436f9b8590e6022ce2dabefb23ffb037020784a (patch)
tree7de4df5ccae63f2bf57e95138d06a4f33680c362 /desktop-widgets/command.h
parentcddd5942f8accaa612d8e107b45c1bf3d47a5c95 (diff)
downloadsubsurface-5436f9b8590e6022ce2dabefb23ffb037020784a.tar.gz
Undo: move dive-list logic into edit commands
The edit-commands were called with a list of selected dives and the original value. Move the creation of the list and extraction of the original value into the edit-commmands. This removes the "current is last" rule and allows for more flexibility. Since the depth- and duration editing applies only to the current dive and not all selected dives, add a parameter to the edit-commands controlling whether only the current or all selected dives are edited. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command.h')
-rw-r--r--desktop-widgets/command.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/desktop-widgets/command.h b/desktop-widgets/command.h
index 4754a6937..7667f3482 100644
--- a/desktop-widgets/command.h
+++ b/desktop-widgets/command.h
@@ -52,20 +52,20 @@ void purgeUnusedDiveSites();
// 4) Dive editing related commands
-void editNotes(const QVector<dive *> dives, const QString &newValue, const QString &oldValue);
-void editSuit(const QVector<dive *> dives, const QString &newValue, const QString &oldValue);
-void editMode(const QVector<dive *> dives, int index, int newValue, int oldValue);
-void editRating(const QVector<dive *> dives, int newValue, int oldValue);
-void editVisibility(const QVector<dive *> dives, int newValue, int oldValue);
-void editAirTemp(const QVector<dive *> dives, int newValue, int oldValue);
-void editWaterTemp(const QVector<dive *> dives, int newValue, int oldValue);
-void editDepth(const QVector<dive *> dives, int newValue, int oldValue);
-void editDuration(const QVector<dive *> dives, int newValue, int oldValue);
-void editDiveSite(const QVector<dive *> dives, struct dive_site *newValue, struct dive_site *oldValue);
-void editDiveSiteNew(const QVector<dive *> dives, const QString &newName, struct dive_site *oldValue);
-void editTags(const QVector<dive *> &dives, const QStringList &newList, struct dive *d);
-void editBuddies(const QVector<dive *> &dives, const QStringList &newList, struct dive *d);
-void editDiveMaster(const QVector<dive *> &dives, const QStringList &newList, struct dive *d);
+void editNotes(const QString &newValue, bool currentDiveOnly);
+void editSuit(const QString &newValue, bool currentDiveOnly);
+void editMode(int index, int newValue, bool currentDiveOnly);
+void editRating(int newValue, bool currentDiveOnly);
+void editVisibility(int newValue, bool currentDiveOnly);
+void editAirTemp(int newValue, bool currentDiveOnly);
+void editWaterTemp(int newValue, bool currentDiveOnly);
+void editDepth(int newValue, bool currentDiveOnly);
+void editDuration(int newValue, bool currentDiveOnly);
+void editDiveSite(struct dive_site *newValue, bool currentDiveOnly);
+void editDiveSiteNew(const QString &newName, bool currentDiveOnly);
+void editTags(const QStringList &newList, bool currentDiveOnly);
+void editBuddies(const QStringList &newList, bool currentDiveOnly);
+void editDiveMaster(const QStringList &newList, bool currentDiveOnly);
} // namespace Command