| 
									
										
										
										
											2018-07-23 23:41:23 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "command.h"
 | 
					
						
							|  |  |  | #include "command_divelist.h"
 | 
					
						
							| 
									
										
										
										
											2019-03-12 22:35:43 +01:00
										 |  |  | #include "command_divesite.h"
 | 
					
						
							| 
									
										
										
										
											2019-01-25 18:27:31 +01:00
										 |  |  | #include "command_edit.h"
 | 
					
						
							| 
									
										
										
										
											2019-02-24 21:22:33 +01:00
										 |  |  | #include "command_edit_trip.h"
 | 
					
						
							| 
									
										
										
										
											2018-07-23 23:41:23 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Command { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Dive-list related commands
 | 
					
						
							| 
									
										
										
										
											2019-03-28 17:23:35 +01:00
										 |  |  | void addDive(dive *d, bool autogroup, bool newNumber) | 
					
						
							| 
									
										
										
										
											2018-07-23 23:41:23 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-03-28 17:23:35 +01:00
										 |  |  | 	execute(new AddDive(d, autogroup, newNumber)); | 
					
						
							| 
									
										
										
										
											2018-07-23 23:41:23 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-03 15:12:22 +01:00
										 |  |  | void importDives(struct dive_table *dives, struct trip_table *trips, struct dive_site_table *sites, int flags, const QString &source) | 
					
						
							| 
									
										
										
										
											2018-12-23 23:45:12 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-03-03 15:12:22 +01:00
										 |  |  | 	execute(new ImportDives(dives, trips, sites, flags, source)); | 
					
						
							| 
									
										
										
										
											2018-12-23 23:45:12 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-23 23:41:23 +02:00
										 |  |  | void deleteDive(const QVector<struct dive*> &divesToDelete) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new DeleteDive(divesToDelete)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void shiftTime(const QVector<dive *> &changedDives, int amount) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new ShiftTime(changedDives, amount)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-30 15:55:29 +02:00
										 |  |  | void renumberDives(const QVector<QPair<dive *, int>> &divesToRenumber) | 
					
						
							| 
									
										
										
										
											2018-07-23 23:41:23 +02:00
										 |  |  | { | 
					
						
							|  |  |  | 	execute(new RenumberDives(divesToRenumber)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void removeDivesFromTrip(const QVector<dive *> &divesToRemove) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new RemoveDivesFromTrip(divesToRemove)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void removeAutogenTrips() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new RemoveAutogenTrips); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void addDivesToTrip(const QVector<dive *> &divesToAddIn, dive_trip *trip) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new AddDivesToTrip(divesToAddIn, trip)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void createTrip(const QVector<dive *> &divesToAddIn) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new CreateTrip(divesToAddIn)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void autogroupDives() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new AutogroupDives); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void mergeTrips(dive_trip *trip1, dive_trip *trip2) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new MergeTrips(trip1, trip2)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void splitDives(dive *d, duration_t time) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new SplitDives(d, time)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-31 10:20:13 +02:00
										 |  |  | void splitDiveComputer(dive *d, int dc_num) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new SplitDiveComputer(d, dc_num)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-17 22:22:55 +02:00
										 |  |  | void moveDiveComputerToFront(dive *d, int dc_num) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new MoveDiveComputerToFront(d, dc_num)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-19 14:27:10 +02:00
										 |  |  | void deleteDiveComputer(dive *d, int dc_num) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new DeleteDiveComputer(d, dc_num)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-23 23:41:23 +02:00
										 |  |  | void mergeDives(const QVector <dive *> &dives) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new MergeDives(dives)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-12 22:35:43 +01:00
										 |  |  | // Dive site related commands
 | 
					
						
							|  |  |  | void deleteDiveSites(const QVector <dive_site *> &sites) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new DeleteDiveSites(sites)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-12 23:51:39 +01:00
										 |  |  | void editDiveSiteName(dive_site *ds, const QString &value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new EditDiveSiteName(ds, value)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-13 20:10:22 +01:00
										 |  |  | void editDiveSiteDescription(dive_site *ds, const QString &value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new EditDiveSiteDescription(ds, value)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-14 00:00:54 +01:00
										 |  |  | void editDiveSiteNotes(dive_site *ds, const QString &value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new EditDiveSiteNotes(ds, value)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-14 08:26:50 +01:00
										 |  |  | void editDiveSiteCountry(dive_site *ds, const QString &value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new EditDiveSiteCountry(ds, value)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-14 23:28:45 +01:00
										 |  |  | void editDiveSiteLocation(dive_site *ds, location_t value) | 
					
						
							| 
									
										
										
										
											2019-03-14 22:07:48 +01:00
										 |  |  | { | 
					
						
							|  |  |  | 	execute(new EditDiveSiteLocation(ds, value)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-15 14:32:55 +01:00
										 |  |  | void editDiveSiteTaxonomy(dive_site *ds, taxonomy_data &value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new EditDiveSiteTaxonomy(ds, value)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-13 20:58:25 +01:00
										 |  |  | void addDiveSite(const QString &name) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new AddDiveSite(name)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-04 20:40:27 -07:00
										 |  |  | void importDiveSites(struct dive_site_table *sites, const QString &source) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new ImportDiveSites(sites, source)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-15 17:41:31 +01:00
										 |  |  | void mergeDiveSites(dive_site *ds, const QVector<dive_site *> &sites) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new MergeDiveSites(ds, sites)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-19 19:52:54 +01:00
										 |  |  | void purgeUnusedDiveSites() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new PurgeUnusedDiveSites); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | // Execute an edit-command and return number of edited dives
 | 
					
						
							|  |  |  | static int execute_edit(EditDivesBase *cmd) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-24 21:17:22 +02:00
										 |  |  | 	int count = cmd->numDives(); | 
					
						
							|  |  |  | 	return execute(cmd) ? count : 0; | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-25 18:27:31 +01:00
										 |  |  | // Dive editing related commands
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editNotes(const QString &newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-01-25 18:27:31 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditNotes(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-01-25 18:27:31 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editMode(int index, int newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-01-28 18:35:27 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditMode(index, newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-07-17 15:49:45 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int editNumber(int newValue, bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new EditNumber(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-01-28 18:35:27 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editSuit(const QString &newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-01-28 21:42:59 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditSuit(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-01-28 21:42:59 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editRating(int newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-01-28 22:35:07 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditRating(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-01-28 22:35:07 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editVisibility(int newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-01-28 22:35:07 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditVisibility(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-01-28 22:35:07 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-28 21:04:52 +02:00
										 |  |  | int editWaveSize(int newValue, bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new EditWaveSize(newValue, currentDiveOnly)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int editCurrent(int newValue, bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new EditCurrent(newValue, currentDiveOnly)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int editSurge(int newValue, bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new EditSurge(newValue, currentDiveOnly)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int editChill(int newValue, bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new EditChill(newValue, currentDiveOnly)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editAirTemp(int newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-01-30 22:13:24 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditAirTemp(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-01-30 22:13:24 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editWaterTemp(int newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-01-30 22:13:24 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditWaterTemp(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-01-30 22:13:24 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editAtmPress(int newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-04-30 12:42:33 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditAtmPress(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-04-30 12:42:33 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-19 19:16:45 +02:00
										 |  |  | int editWaterTypeUser(int newValue, bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new EditWaterTypeUser(newValue, currentDiveOnly)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editDepth(int newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-02-10 17:37:06 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditDepth(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-02-10 17:37:06 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editDuration(int newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-02-10 17:37:06 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditDuration(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-02-10 17:37:06 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editDiveSite(struct dive_site *newValue, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-03-20 21:46:58 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditDiveSite(newValue, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-03-20 21:46:58 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editDiveSiteNew(const QString &newName, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-03-20 21:46:58 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditDiveSiteNew(newName, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-03-20 21:46:58 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editTags(const QStringList &newList, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-02-07 19:59:34 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditTags(newList, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-02-07 19:59:34 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editBuddies(const QStringList &newList, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-02-07 21:00:09 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditBuddies(newList, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-02-07 21:00:09 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | int editDiveMaster(const QStringList &newList, bool currentDiveOnly) | 
					
						
							| 
									
										
										
										
											2019-02-07 21:23:00 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-23 20:27:19 +02:00
										 |  |  | 	return execute_edit(new EditDiveMaster(newList, currentDiveOnly)); | 
					
						
							| 
									
										
										
										
											2019-02-07 21:23:00 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-23 18:17:20 +01:00
										 |  |  | void pasteDives(const dive *d, dive_components what) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new PasteDives(d, what)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-06 20:54:25 +02:00
										 |  |  | void replanDive(dive *d) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-11-30 15:51:34 +01:00
										 |  |  | 	execute(new ReplanDive(d, false)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void editProfile(dive *d) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new ReplanDive(d, true)); | 
					
						
							| 
									
										
										
										
											2019-10-06 20:54:25 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-02 21:19:29 +01:00
										 |  |  | int addWeight(bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new AddWeight(currentDiveOnly)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-03 15:04:48 +01:00
										 |  |  | int removeWeight(int index, bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new RemoveWeight(index, currentDiveOnly)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-08 22:47:38 +01:00
										 |  |  | int editWeight(int index, weightsystem_t ws, bool currentDiveOnly) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return execute_edit(new EditWeight(index, ws, currentDiveOnly)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-23 20:30:10 +02:00
										 |  |  | // Trip editing related commands
 | 
					
						
							| 
									
										
										
										
											2019-02-24 21:22:33 +01:00
										 |  |  | void editTripLocation(dive_trip *trip, const QString &s) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new EditTripLocation(trip, s)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void editTripNotes(dive_trip *trip, const QString &s) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	execute(new EditTripNotes(trip, s)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-23 23:41:23 +02:00
										 |  |  | } // namespace Command
 |