subsurface/desktop-widgets/tab-widgets/TabDiveInformation.h
Rafael M. Salvioni 1e082affdd Fix salinity combo/icon when DC doesnt have salinity info
Today salinity combo is editable if one of these rules matches: The dive was manually entered or if salinity edition is allowed in preferences.
However we can have cases that dives were downloaded but its doesn't have salinity info.

This fix considers if there's a DC salinity info to decides combo edition and if salinity change indicator will be showed or not.
If DC doesn't have salinity, the UI behavior is the same of a manual dive

Signed-off-by: Rafael M. Salvioni <rafael.salvioni@gmail.com>
2023-07-09 20:36:46 +12:00

49 lines
1.4 KiB
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef TAB_DIVE_INFORMATION_H
#define TAB_DIVE_INFORMATION_H
#include "TabBase.h"
#include "core/subsurface-qt/divelistnotifier.h"
namespace Ui {
class TabDiveInformation;
};
class TabDiveInformation : public TabBase {
Q_OBJECT
public:
TabDiveInformation(MainTab *parent);
~TabDiveInformation();
void updateData(const std::vector<dive *> &selection, dive *currentDive, int currentDC) override;
void clear() override;
void updateUi(QString titleColor) 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);
void on_visibility_valueChanged(int value);
void on_wavesize_valueChanged(int value);
void on_current_valueChanged(int value);
void on_surge_valueChanged(int value);
void on_chill_valueChanged(int value);
void on_airtemp_editingFinished();
void on_watertemp_editingFinished();
void on_waterTypeCombo_activated(int index);
private:
Ui::TabDiveInformation *ui;
void updateProfile();
int updateSalinityComboIndex(int salinity);
void checkDcSalinityOverWritten();
void updateWhen();
int pressTypeIndex;
void updateWaterTypeWidget();
void updateTextBox(int event);
void updateMode();
void divesEdited(int);
void closeWarning();
void showCurrentWidget(bool show, int position);
};
#endif