From c6188bbe47469d72bcb9afba69eb27fb39646cc1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 21 Oct 2020 23:10:08 +0200 Subject: devices: connect DiveComputerModel to undo-command Instead of modifying the device table directly, call the undo commands. Moreover, don't keep our own copy in the mode - show the original version. Connect to the appropriate signals. This means that the calls from the DiveComputerManagement dialog have to be removed, since this mode of editing is not supported. The whole dialog will be removed in a future commit. Signed-off-by: Berthold Stoeger --- desktop-widgets/divecomputermanagementdialog.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/divecomputermanagementdialog.cpp b/desktop-widgets/divecomputermanagementdialog.cpp index bfeddf24f..92f7c2096 100644 --- a/desktop-widgets/divecomputermanagementdialog.cpp +++ b/desktop-widgets/divecomputermanagementdialog.cpp @@ -36,22 +36,10 @@ DiveComputerManagementDialog *DiveComputerManagementDialog::instance() void DiveComputerManagementDialog::tryRemove(const QModelIndex &index) { - if (index.column() != DiveComputerModel::REMOVE) - return; - - QMessageBox::StandardButton response = QMessageBox::question( - this, TITLE_OR_TEXT( - tr("Remove the selected dive computer?"), - tr("Are you sure that you want to \n remove the selected dive computer?")), - QMessageBox::Ok | QMessageBox::Cancel); - - if (response == QMessageBox::Ok) - model->remove(index); } void DiveComputerManagementDialog::accept() { - model->keepWorkingList(); hide(); close(); } -- cgit v1.2.3-70-g09d2