mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:33:24 +00:00
Created a placeholder for the Equipment Edition.
This creates a placeholder for the equipment edition, it will ease the 'revert' and 'apply' when editing multi dives. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
95e094c325
commit
4f0112c420
2 changed files with 12 additions and 2 deletions
|
@ -329,8 +329,10 @@ void MainTab::updateDiveInfo(int dive)
|
|||
ui->timeLimits->setAverage(get_time_string(seconds, 0));
|
||||
ui->timeLimits->setMaximum(get_time_string(stats_selection.longest_time.seconds, 0));
|
||||
ui->timeLimits->setMinimum(get_time_string(stats_selection.shortest_time.seconds, 0));
|
||||
cylindersModel->setDive(d);
|
||||
weightModel->setDive(d);
|
||||
|
||||
multiEditEquipmentPlaceholder = *d;
|
||||
cylindersModel->setDive(&multiEditEquipmentPlaceholder);
|
||||
weightModel->setDive(&multiEditEquipmentPlaceholder);
|
||||
} else {
|
||||
/* clear the fields */
|
||||
ui->rating->setCurrentStars(0);
|
||||
|
|
|
@ -81,6 +81,14 @@ private:
|
|||
WeightModel *weightModel;
|
||||
CylindersModel *cylindersModel;
|
||||
QMap<dive*, NotesBackup> notesBackup;
|
||||
|
||||
/* since the multi-edition of the equipment is fairly more
|
||||
* complex than a single item, because it involves a Qt
|
||||
* Model to edit things, we are copying the first selected
|
||||
* dive to this structure, making all editions there,
|
||||
* then applying the changes on the other dives.*/
|
||||
struct dive multiEditEquipmentPlaceholder;
|
||||
|
||||
enum { NONE, DIVE, TRIP, ADD } editMode;
|
||||
Completers completers;
|
||||
void enableEdition();
|
||||
|
|
Loading…
Add table
Reference in a new issue