mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: update information tab when cylinders change
The SAC rate, etc were only updated when switching between dives. They should always be updated when an undo command changes (adds, edits, removes) the cylinders of a dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
30133946e0
commit
16a35a8bbe
2 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,9 @@ TabDiveInformation::TabDiveInformation(QWidget *parent) : TabBase(parent), ui(ne
|
|||
{
|
||||
ui->setupUi(this);
|
||||
connect(&diveListNotifier, &DiveListNotifier::divesChanged, this, &TabDiveInformation::divesChanged);
|
||||
connect(&diveListNotifier, &DiveListNotifier::cylinderAdded, this, &TabDiveInformation::cylinderChanged);
|
||||
connect(&diveListNotifier, &DiveListNotifier::cylinderRemoved, this, &TabDiveInformation::cylinderChanged);
|
||||
connect(&diveListNotifier, &DiveListNotifier::cylinderEdited, this, &TabDiveInformation::cylinderChanged);
|
||||
QStringList atmPressTypes { "mbar", get_depth_unit() ,tr("Use DC")};
|
||||
ui->atmPressType->insertItems(0, atmPressTypes);
|
||||
pressTypeIndex = 0;
|
||||
|
@ -292,6 +295,14 @@ void TabDiveInformation::on_waterTypeCombo_activated(int index) {
|
|||
ui->salinityOverWrittenIcon->setVisible(true);
|
||||
}
|
||||
|
||||
void TabDiveInformation::cylinderChanged(dive *d)
|
||||
{
|
||||
// If this isn't the current dive, do nothing
|
||||
if (current_dive != d)
|
||||
return;
|
||||
updateProfile();
|
||||
}
|
||||
|
||||
// This function gets called if a field gets updated by an undo command.
|
||||
// Refresh the corresponding UI field.
|
||||
void TabDiveInformation::divesChanged(const QVector<dive *> &dives, DiveField field)
|
||||
|
|
|
@ -18,6 +18,7 @@ public:
|
|||
void clear() override;
|
||||
private slots:
|
||||
void divesChanged(const QVector<dive *> &dives, DiveField field);
|
||||
void cylinderChanged(dive *d);
|
||||
void diveModeChanged(int index);
|
||||
void on_atmPressVal_editingFinished();
|
||||
void on_atmPressType_currentIndexChanged(int index);
|
||||
|
|
Loading…
Add table
Reference in a new issue