From 147a36647ce6148ef2eccbe393faa658d0fe6834 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 2 Nov 2019 21:19:29 +0100 Subject: 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 --- desktop-widgets/tab-widgets/TabDiveEquipment.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'desktop-widgets/tab-widgets') 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) -- cgit v1.2.3-70-g09d2