mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
4467477389
commit
c6188bbe47
4 changed files with 36 additions and 41 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue