diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-03-03 23:17:08 +0100 |
---|---|---|
committer | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-07 00:13:35 +0200 |
commit | 9a4718b46f5fa74c7c67a92d0c09ab805f364e12 (patch) | |
tree | e344542764813c1b6dfb41e945d8cb6e5bac3c91 /desktop-widgets/simplewidgets.cpp | |
parent | adb53f9c18070e524a2635c5a1d983556f21d5ea (diff) | |
download | subsurface-9a4718b46f5fa74c7c67a92d0c09ab805f364e12.tar.gz |
undo: switch SetpointDialog from divecomputer to dive + dc-number
Since pointers to divecomputers may not be stable, the undo
commands take a dive + a divecomputer number. Update the
SetpointDialog accordingly.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/simplewidgets.cpp')
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index 4b85a8b50..c31c93676 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -176,8 +176,8 @@ RenumberDialog::RenumberDialog(QWidget *parent) : QDialog(parent), selectedOnly( void SetpointDialog::buttonClicked(QAbstractButton *button) { - if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole && dc) { - add_event(dc, time, SAMPLE_EVENT_PO2, 0, (int)(1000.0 * ui.spinbox->value()), + if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) { + add_event(get_dive_dc(d, dcNr), time, SAMPLE_EVENT_PO2, 0, (int)(1000.0 * ui.spinbox->value()), QT_TRANSLATE_NOOP("gettextFromC", "SP change")); invalidate_dive_cache(current_dive); } @@ -185,8 +185,8 @@ void SetpointDialog::buttonClicked(QAbstractButton *button) MainWindow::instance()->graphics->replot(); } -SetpointDialog::SetpointDialog(struct divecomputer *dcIn, int seconds) : QDialog(MainWindow::instance()), - dc(dcIn), time(seconds < 0 ? 0 : seconds) +SetpointDialog::SetpointDialog(struct dive *dIn, int dcNrIn, int seconds) : QDialog(MainWindow::instance()), + d(dIn), dcNr(dcNrIn), time(seconds < 0 ? 0 : seconds) { ui.setupUi(this); connect(ui.buttonBox, &QDialogButtonBox::clicked, this, &SetpointDialog::buttonClicked); |