diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-11-02 21:19:29 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-05 10:14:25 -0800 |
commit | 147a36647ce6148ef2eccbe393faa658d0fe6834 (patch) | |
tree | 853ff1272cfdb8859a81a60f886dbf55dbd29bbc /desktop-widgets | |
parent | 76a5a38f5e8aad339061f534df8130b426079a03 (diff) | |
download | subsurface-147a36647ce6148ef2eccbe393faa658d0fe6834.tar.gz |
Undo: make adding of weights an undoable action
Introduce an AddWeight undo command. This is modelled after the
numerous dive-edit undo commands. The redo and undo actions are
connected to the WeightModel via two new signals, weightAdded
and weightRemoved.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveEquipment.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveEquipment.cpp b/desktop-widgets/tab-widgets/TabDiveEquipment.cpp index 110472e56..1ea57e703 100644 --- a/desktop-widgets/tab-widgets/TabDiveEquipment.cpp +++ b/desktop-widgets/tab-widgets/TabDiveEquipment.cpp @@ -158,8 +158,7 @@ void TabDiveEquipment::addCylinder_clicked() void TabDiveEquipment::addWeight_clicked() { - MainWindow::instance()->mainTab->enableEdition(); - weightModel->add(); + divesEdited(Command::addWeight(false)); } void TabDiveEquipment::editCylinderWidget(const QModelIndex &index) |