summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/TabDiveInformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets/TabDiveInformation.cpp')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveInformation.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveInformation.cpp b/desktop-widgets/tab-widgets/TabDiveInformation.cpp
index a91151fed..e73de4148 100644
--- a/desktop-widgets/tab-widgets/TabDiveInformation.cpp
+++ b/desktop-widgets/tab-widgets/TabDiveInformation.cpp
@@ -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)