2017-04-27 18:24:53 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2016-01-11 21:10:00 +00:00
|
|
|
#ifndef SETTINGSOBJECTWRAPPER_H
|
|
|
|
#define SETTINGSOBJECTWRAPPER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2016-09-04 14:52:18 +00:00
|
|
|
#include <QDate>
|
2016-01-11 21:10:00 +00:00
|
|
|
|
2018-06-29 06:57:27 +00:00
|
|
|
#include "core/pref.h"
|
2018-07-04 19:45:48 +00:00
|
|
|
#include "core/settings/qPref.h"
|
2016-01-11 21:10:00 +00:00
|
|
|
|
|
|
|
/* Wrapper class for the Settings. This will allow
|
|
|
|
* seamlessy integration of the settings with the QML
|
|
|
|
* and QWidget frontends. This class will be huge, since
|
|
|
|
* I need tons of properties, one for each option. */
|
|
|
|
|
2016-08-10 18:50:00 +00:00
|
|
|
class UpdateManagerSettings : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(bool dont_check_for_updates READ dontCheckForUpdates WRITE setDontCheckForUpdates NOTIFY dontCheckForUpdatesChanged)
|
|
|
|
Q_PROPERTY(QString last_version_used READ lastVersionUsed WRITE setLastVersionUsed NOTIFY lastVersionUsedChanged)
|
|
|
|
Q_PROPERTY(QDate next_check READ nextCheck WRITE nextCheckChanged)
|
|
|
|
public:
|
|
|
|
UpdateManagerSettings(QObject *parent);
|
|
|
|
bool dontCheckForUpdates() const;
|
2016-08-27 19:26:13 +00:00
|
|
|
bool dontCheckExists() const;
|
2016-08-10 18:50:00 +00:00
|
|
|
QString lastVersionUsed() const;
|
|
|
|
QDate nextCheck() const;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setDontCheckForUpdates(bool value);
|
|
|
|
void setLastVersionUsed(const QString& value);
|
|
|
|
void setNextCheck(const QDate& date);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void dontCheckForUpdatesChanged(bool value);
|
|
|
|
void lastVersionUsedChanged(const QString& value);
|
|
|
|
void nextCheckChanged(const QDate& date);
|
|
|
|
private:
|
2016-09-25 18:01:03 +00:00
|
|
|
const QString group = QStringLiteral("UpdateManager");
|
2016-08-10 18:50:00 +00:00
|
|
|
};
|
|
|
|
|
2016-01-11 21:10:00 +00:00
|
|
|
/* Control the state of the Partial Pressure Graphs preferences */
|
|
|
|
class PartialPressureGasSettings : public QObject {
|
|
|
|
Q_OBJECT
|
2017-11-18 15:06:41 +00:00
|
|
|
Q_PROPERTY(bool show_po2 READ showPo2 WRITE setShowPo2 NOTIFY showPo2Changed)
|
|
|
|
Q_PROPERTY(bool show_pn2 READ showPn2 WRITE setShowPn2 NOTIFY showPn2Changed)
|
|
|
|
Q_PROPERTY(bool show_phe READ showPhe WRITE setShowPhe NOTIFY showPheChanged)
|
2017-03-24 18:11:31 +00:00
|
|
|
Q_PROPERTY(double po2_threshold_min READ po2ThresholdMin WRITE setPo2ThresholdMin NOTIFY po2ThresholdMinChanged)
|
|
|
|
Q_PROPERTY(double po2_threshold_max READ po2ThresholdMax WRITE setPo2ThresholdMax NOTIFY po2ThresholdMaxChanged)
|
|
|
|
Q_PROPERTY(double pn2_threshold READ pn2Threshold WRITE setPn2Threshold NOTIFY pn2ThresholdChanged)
|
|
|
|
Q_PROPERTY(double phe_threshold READ pheThreshold WRITE setPheThreshold NOTIFY pheThresholdChanged)
|
2016-01-11 22:37:54 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
PartialPressureGasSettings(QObject *parent);
|
2017-11-18 15:06:41 +00:00
|
|
|
bool showPo2() const;
|
|
|
|
bool showPn2() const;
|
|
|
|
bool showPhe() const;
|
2017-03-24 18:11:31 +00:00
|
|
|
double po2ThresholdMin() const;
|
|
|
|
double po2ThresholdMax() const;
|
2016-01-11 22:37:54 +00:00
|
|
|
double pn2Threshold() const;
|
|
|
|
double pheThreshold() const;
|
|
|
|
|
|
|
|
public slots:
|
2017-11-18 15:06:41 +00:00
|
|
|
void setShowPo2(bool value);
|
|
|
|
void setShowPn2(bool value);
|
|
|
|
void setShowPhe(bool value);
|
2017-03-24 18:11:31 +00:00
|
|
|
void setPo2ThresholdMin(double value);
|
|
|
|
void setPo2ThresholdMax(double value);
|
2016-01-11 22:37:54 +00:00
|
|
|
void setPn2Threshold(double value);
|
|
|
|
void setPheThreshold(double value);
|
|
|
|
|
|
|
|
signals:
|
2017-11-18 15:06:41 +00:00
|
|
|
void showPo2Changed(bool value);
|
|
|
|
void showPn2Changed(bool value);
|
|
|
|
void showPheChanged(bool value);
|
2017-03-24 18:11:31 +00:00
|
|
|
void po2ThresholdMaxChanged(double value);
|
|
|
|
void po2ThresholdMinChanged(double value);
|
2016-01-11 22:37:54 +00:00
|
|
|
void pn2ThresholdChanged(double value);
|
|
|
|
void pheThresholdChanged(double value);
|
2016-09-25 18:01:03 +00:00
|
|
|
|
2016-01-22 19:46:15 +00:00
|
|
|
private:
|
2016-09-25 18:01:03 +00:00
|
|
|
const QString group = QStringLiteral("TecDetails");
|
2016-01-11 22:37:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class TechnicalDetailsSettings : public QObject {
|
2016-01-14 18:21:28 +00:00
|
|
|
Q_OBJECT
|
2017-11-12 13:26:34 +00:00
|
|
|
Q_PROPERTY(double modpO2 READ modpO2 WRITE setModpO2 NOTIFY modpO2Changed)
|
2016-01-25 18:49:51 +00:00
|
|
|
Q_PROPERTY(bool ead READ ead WRITE setEad NOTIFY eadChanged)
|
2016-08-10 18:50:00 +00:00
|
|
|
Q_PROPERTY(bool mod READ mod WRITE setMod NOTIFY modChanged)
|
2016-01-25 18:49:51 +00:00
|
|
|
Q_PROPERTY(bool dcceiling READ dcceiling WRITE setDCceiling NOTIFY dcceilingChanged)
|
|
|
|
Q_PROPERTY(bool redceiling READ redceiling WRITE setRedceiling NOTIFY redceilingChanged)
|
|
|
|
Q_PROPERTY(bool calcceiling READ calcceiling WRITE setCalcceiling NOTIFY calcceilingChanged)
|
|
|
|
Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE setCalcceiling3m NOTIFY calcceiling3mChanged)
|
|
|
|
Q_PROPERTY(bool calcalltissues READ calcalltissues WRITE setCalcalltissues NOTIFY calcalltissuesChanged)
|
|
|
|
Q_PROPERTY(bool calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged)
|
2016-10-03 14:25:48 +00:00
|
|
|
Q_PROPERTY(bool buehlmann READ buehlmann WRITE setBuehlmann NOTIFY buehlmannChanged)
|
2016-09-01 21:52:17 +00:00
|
|
|
Q_PROPERTY(int gflow READ gflow WRITE setGflow NOTIFY gflowChanged)
|
|
|
|
Q_PROPERTY(int gfhigh READ gfhigh WRITE setGfhigh NOTIFY gfhighChanged)
|
2016-09-24 08:02:08 +00:00
|
|
|
Q_PROPERTY(short vpmb_conservatism READ vpmbConservatism WRITE setVpmbConservatism NOTIFY vpmbConservatismChanged)
|
2016-01-25 18:49:51 +00:00
|
|
|
Q_PROPERTY(bool hrgraph READ hrgraph WRITE setHRgraph NOTIFY hrgraphChanged)
|
|
|
|
Q_PROPERTY(bool tankbar READ tankBar WRITE setTankBar NOTIFY tankBarChanged)
|
|
|
|
Q_PROPERTY(bool percentagegraph READ percentageGraph WRITE setPercentageGraph NOTIFY percentageGraphChanged)
|
|
|
|
Q_PROPERTY(bool rulergraph READ rulerGraph WRITE setRulerGraph NOTIFY rulerGraphChanged)
|
2016-01-11 21:58:33 +00:00
|
|
|
Q_PROPERTY(bool show_ccr_setpoint READ showCCRSetpoint WRITE setShowCCRSetpoint NOTIFY showCCRSetpointChanged)
|
|
|
|
Q_PROPERTY(bool show_ccr_sensors READ showCCRSensors WRITE setShowCCRSensors NOTIFY showCCRSensorsChanged)
|
2018-03-14 15:13:37 +00:00
|
|
|
Q_PROPERTY(bool show_scr_ocpo2 READ showSCROCpO2 WRITE setShowSCROCpO2 NOTIFY showSCROCpO2Changed)
|
2016-01-25 18:49:51 +00:00
|
|
|
Q_PROPERTY(bool zoomed_plot READ zoomedPlot WRITE setZoomedPlot NOTIFY zoomedPlotChanged)
|
|
|
|
Q_PROPERTY(bool show_sac READ showSac WRITE setShowSac NOTIFY showSacChanged)
|
|
|
|
Q_PROPERTY(bool display_unused_tanks READ displayUnusedTanks WRITE setDisplayUnusedTanks NOTIFY displayUnusedTanksChanged)
|
|
|
|
Q_PROPERTY(bool show_average_depth READ showAverageDepth WRITE setShowAverageDepth NOTIFY showAverageDepthChanged)
|
2018-02-05 14:58:25 +00:00
|
|
|
Q_PROPERTY(bool show_icd READ showIcd WRITE setShowIcd NOTIFY showIcdChanged)
|
2016-01-22 19:46:15 +00:00
|
|
|
Q_PROPERTY(bool show_pictures_in_profile READ showPicturesInProfile WRITE setShowPicturesInProfile NOTIFY showPicturesInProfileChanged)
|
2016-11-01 16:00:06 +00:00
|
|
|
Q_PROPERTY(deco_mode deco READ deco WRITE setDecoMode NOTIFY decoModeChanged)
|
|
|
|
|
2016-01-11 21:10:00 +00:00
|
|
|
public:
|
2016-01-11 22:37:54 +00:00
|
|
|
TechnicalDetailsSettings(QObject *parent);
|
|
|
|
|
2017-11-12 13:26:34 +00:00
|
|
|
double modpO2() const;
|
2016-01-25 18:49:51 +00:00
|
|
|
bool ead() const;
|
|
|
|
bool mod() const;
|
|
|
|
bool dcceiling() const;
|
|
|
|
bool redceiling() const;
|
|
|
|
bool calcceiling() const;
|
|
|
|
bool calcceiling3m() const;
|
|
|
|
bool calcalltissues() const;
|
|
|
|
bool calcndltts() const;
|
2016-10-03 14:25:48 +00:00
|
|
|
bool buehlmann() const;
|
2016-09-01 21:52:17 +00:00
|
|
|
int gflow() const;
|
|
|
|
int gfhigh() const;
|
2016-09-24 08:02:08 +00:00
|
|
|
short vpmbConservatism() const;
|
2016-01-25 18:49:51 +00:00
|
|
|
bool hrgraph() const;
|
|
|
|
bool tankBar() const;
|
|
|
|
bool percentageGraph() const;
|
|
|
|
bool rulerGraph() const;
|
2016-01-11 21:58:33 +00:00
|
|
|
bool showCCRSetpoint() const;
|
|
|
|
bool showCCRSensors() const;
|
2018-03-14 15:13:37 +00:00
|
|
|
bool showSCROCpO2() const;
|
2016-01-25 18:49:51 +00:00
|
|
|
bool zoomedPlot() const;
|
|
|
|
bool showSac() const;
|
|
|
|
bool displayUnusedTanks() const;
|
|
|
|
bool showAverageDepth() const;
|
2018-02-05 14:58:25 +00:00
|
|
|
bool showIcd() const;
|
2016-01-22 19:46:15 +00:00
|
|
|
bool showPicturesInProfile() const;
|
2016-11-01 16:00:06 +00:00
|
|
|
deco_mode deco() const;
|
2016-01-11 21:58:33 +00:00
|
|
|
|
2016-01-11 21:40:07 +00:00
|
|
|
public slots:
|
2016-01-25 18:49:51 +00:00
|
|
|
void setMod(bool value);
|
2017-11-12 13:26:34 +00:00
|
|
|
void setModpO2(double value);
|
2016-01-25 18:49:51 +00:00
|
|
|
void setEad(bool value);
|
|
|
|
void setDCceiling(bool value);
|
|
|
|
void setRedceiling(bool value);
|
|
|
|
void setCalcceiling(bool value);
|
|
|
|
void setCalcceiling3m(bool value);
|
|
|
|
void setCalcalltissues(bool value);
|
|
|
|
void setCalcndltts(bool value);
|
2016-10-03 14:25:48 +00:00
|
|
|
void setBuehlmann(bool value);
|
2016-09-01 21:52:17 +00:00
|
|
|
void setGflow(int value);
|
|
|
|
void setGfhigh(int value);
|
2016-09-24 08:02:08 +00:00
|
|
|
void setVpmbConservatism(short);
|
2016-01-25 18:49:51 +00:00
|
|
|
void setHRgraph(bool value);
|
|
|
|
void setTankBar(bool value);
|
|
|
|
void setPercentageGraph(bool value);
|
|
|
|
void setRulerGraph(bool value);
|
2016-01-11 22:33:50 +00:00
|
|
|
void setShowCCRSetpoint(bool value);
|
|
|
|
void setShowCCRSensors(bool value);
|
2018-03-14 15:13:37 +00:00
|
|
|
void setShowSCROCpO2(bool value);
|
2016-01-25 18:49:51 +00:00
|
|
|
void setZoomedPlot(bool value);
|
|
|
|
void setShowSac(bool value);
|
|
|
|
void setDisplayUnusedTanks(bool value);
|
|
|
|
void setShowAverageDepth(bool value);
|
2018-02-05 14:58:25 +00:00
|
|
|
void setShowIcd(bool value);
|
2016-01-22 19:46:15 +00:00
|
|
|
void setShowPicturesInProfile(bool value);
|
2016-11-01 16:00:06 +00:00
|
|
|
void setDecoMode(deco_mode d);
|
2016-01-11 22:06:01 +00:00
|
|
|
|
2016-01-11 21:40:07 +00:00
|
|
|
signals:
|
2016-01-11 22:06:01 +00:00
|
|
|
void modpO2Changed(double value);
|
2016-01-25 18:49:51 +00:00
|
|
|
void eadChanged(bool value);
|
|
|
|
void modChanged(bool value);
|
|
|
|
void dcceilingChanged(bool value);
|
|
|
|
void redceilingChanged(bool value);
|
|
|
|
void calcceilingChanged(bool value);
|
|
|
|
void calcceiling3mChanged(bool value);
|
|
|
|
void calcalltissuesChanged(bool value);
|
|
|
|
void calcndlttsChanged(bool value);
|
2016-10-03 14:25:48 +00:00
|
|
|
void buehlmannChanged(bool value);
|
2016-09-01 21:52:17 +00:00
|
|
|
void gflowChanged(int value);
|
|
|
|
void gfhighChanged(int value);
|
2016-09-24 08:02:08 +00:00
|
|
|
void vpmbConservatismChanged(short value);
|
2016-01-25 18:49:51 +00:00
|
|
|
void hrgraphChanged(bool value);
|
|
|
|
void tankBarChanged(bool value);
|
|
|
|
void percentageGraphChanged(bool value);
|
|
|
|
void rulerGraphChanged(bool value);
|
2016-01-11 22:06:01 +00:00
|
|
|
void showCCRSetpointChanged(bool value);
|
|
|
|
void showCCRSensorsChanged(bool value);
|
2018-03-14 15:13:37 +00:00
|
|
|
void showSCROCpO2Changed(bool value);
|
2016-01-25 18:49:51 +00:00
|
|
|
void zoomedPlotChanged(bool value);
|
|
|
|
void showSacChanged(bool value);
|
|
|
|
void displayUnusedTanksChanged(bool value);
|
|
|
|
void showAverageDepthChanged(bool value);
|
2018-02-05 14:58:25 +00:00
|
|
|
void showIcdChanged(bool value);
|
2016-01-22 19:46:15 +00:00
|
|
|
void showPicturesInProfileChanged(bool value);
|
2016-11-01 16:00:06 +00:00
|
|
|
void decoModeChanged(deco_mode m);
|
2016-09-25 18:01:03 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const QString group = QStringLiteral("TecDetails");
|
2016-01-11 21:10:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Control the state of the Geocoding preferences */
|
|
|
|
class GeocodingPreferences : public QObject {
|
|
|
|
Q_OBJECT
|
2016-01-13 19:36:11 +00:00
|
|
|
Q_PROPERTY(taxonomy_category first_category READ firstTaxonomyCategory WRITE setFirstTaxonomyCategory NOTIFY firstTaxonomyCategoryChanged)
|
|
|
|
Q_PROPERTY(taxonomy_category second_category READ secondTaxonomyCategory WRITE setSecondTaxonomyCategory NOTIFY secondTaxonomyCategoryChanged)
|
|
|
|
Q_PROPERTY(taxonomy_category third_category READ thirdTaxonomyCategory WRITE setThirdTaxonomyCategory NOTIFY thirdTaxonomyCategoryChanged)
|
2016-01-11 21:10:00 +00:00
|
|
|
public:
|
|
|
|
GeocodingPreferences(QObject *parent);
|
2016-01-13 19:36:11 +00:00
|
|
|
taxonomy_category firstTaxonomyCategory() const;
|
|
|
|
taxonomy_category secondTaxonomyCategory() const;
|
|
|
|
taxonomy_category thirdTaxonomyCategory() const;
|
|
|
|
|
|
|
|
public slots:
|
2016-10-15 17:21:44 +00:00
|
|
|
void setFirstTaxonomyCategory(taxonomy_category value);
|
|
|
|
void setSecondTaxonomyCategory(taxonomy_category value);
|
|
|
|
void setThirdTaxonomyCategory(taxonomy_category value);
|
2016-01-13 19:36:11 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void firstTaxonomyCategoryChanged(taxonomy_category value);
|
|
|
|
void secondTaxonomyCategoryChanged(taxonomy_category value);
|
|
|
|
void thirdTaxonomyCategoryChanged(taxonomy_category value);
|
|
|
|
private:
|
2016-09-25 18:01:03 +00:00
|
|
|
const QString group = QStringLiteral("geocoding");
|
2016-01-11 21:10:00 +00:00
|
|
|
};
|
|
|
|
|
2016-01-14 16:00:41 +00:00
|
|
|
class DivePlannerSettings : public QObject {
|
2016-01-14 18:21:28 +00:00
|
|
|
Q_OBJECT
|
2016-01-14 16:00:41 +00:00
|
|
|
Q_PROPERTY(bool last_stop READ lastStop WRITE setLastStop NOTIFY lastStopChanged)
|
|
|
|
Q_PROPERTY(bool verbatim_plan READ verbatimPlan WRITE setVerbatimPlan NOTIFY verbatimPlanChanged)
|
|
|
|
Q_PROPERTY(bool display_runtime READ displayRuntime WRITE setDisplayRuntime NOTIFY displayRuntimeChanged)
|
|
|
|
Q_PROPERTY(bool display_duration READ displayDuration WRITE setDisplayDuration NOTIFY displayDurationChanged)
|
|
|
|
Q_PROPERTY(bool display_transitions READ displayTransitions WRITE setDisplayTransitions NOTIFY displayTransitionsChanged)
|
2017-09-18 14:10:47 +00:00
|
|
|
Q_PROPERTY(bool display_variations READ displayVariations WRITE setDisplayVariations NOTIFY displayVariationsChanged)
|
2016-01-14 16:00:41 +00:00
|
|
|
Q_PROPERTY(bool doo2breaks READ doo2breaks WRITE setDoo2breaks NOTIFY doo2breaksChanged)
|
|
|
|
Q_PROPERTY(bool drop_stone_mode READ dropStoneMode WRITE setDropStoneMode NOTIFY dropStoneModeChanged)
|
|
|
|
Q_PROPERTY(bool safetystop READ safetyStop WRITE setSafetyStop NOTIFY safetyStopChanged)
|
|
|
|
Q_PROPERTY(bool switch_at_req_stop READ switchAtRequiredStop WRITE setSwitchAtRequiredStop NOTIFY switchAtRequiredStopChanged)
|
|
|
|
Q_PROPERTY(int ascrate75 READ ascrate75 WRITE setAscrate75 NOTIFY ascrate75Changed)
|
|
|
|
Q_PROPERTY(int ascrate50 READ ascrate50 WRITE setAscrate50 NOTIFY ascrate50Changed)
|
|
|
|
Q_PROPERTY(int ascratestops READ ascratestops WRITE setAscratestops NOTIFY ascratestopsChanged)
|
|
|
|
Q_PROPERTY(int ascratelast6m READ ascratelast6m WRITE setAscratelast6m NOTIFY ascratelast6mChanged)
|
|
|
|
Q_PROPERTY(int descrate READ descrate WRITE setDescrate NOTIFY descrateChanged)
|
2017-02-11 19:24:18 +00:00
|
|
|
Q_PROPERTY(int sacfactor READ sacfactor WRITE setSacFactor NOTIFY sacFactorChanged)
|
|
|
|
Q_PROPERTY(int problemsolvingtime READ problemsolvingtime WRITE setProblemSolvingTime NOTIFY problemSolvingTimeChanged)
|
2016-01-14 16:00:41 +00:00
|
|
|
Q_PROPERTY(int bottompo2 READ bottompo2 WRITE setBottompo2 NOTIFY bottompo2Changed)
|
|
|
|
Q_PROPERTY(int decopo2 READ decopo2 WRITE setDecopo2 NOTIFY decopo2Changed)
|
2016-05-21 10:14:23 +00:00
|
|
|
Q_PROPERTY(int bestmixend READ bestmixend WRITE setBestmixend NOTIFY bestmixendChanged)
|
2016-01-14 16:00:41 +00:00
|
|
|
Q_PROPERTY(int reserve_gas READ reserveGas WRITE setReserveGas NOTIFY reserveGasChanged)
|
|
|
|
Q_PROPERTY(int min_switch_duration READ minSwitchDuration WRITE setMinSwitchDuration NOTIFY minSwitchDurationChanged)
|
|
|
|
Q_PROPERTY(int bottomsac READ bottomSac WRITE setBottomSac NOTIFY bottomSacChanged)
|
2016-10-15 17:52:17 +00:00
|
|
|
Q_PROPERTY(int decosac READ decoSac WRITE setDecoSac NOTIFY decoSacChanged)
|
2016-01-14 18:08:34 +00:00
|
|
|
Q_PROPERTY(deco_mode decoMode READ decoMode WRITE setDecoMode NOTIFY decoModeChanged)
|
|
|
|
|
|
|
|
public:
|
|
|
|
DivePlannerSettings(QObject *parent = 0);
|
|
|
|
bool lastStop() const;
|
|
|
|
bool verbatimPlan() const;
|
|
|
|
bool displayRuntime() const;
|
|
|
|
bool displayDuration() const;
|
|
|
|
bool displayTransitions() const;
|
2017-09-18 14:10:47 +00:00
|
|
|
bool displayVariations() const;
|
2016-01-14 18:08:34 +00:00
|
|
|
bool doo2breaks() const;
|
|
|
|
bool dropStoneMode() const;
|
|
|
|
bool safetyStop() const;
|
|
|
|
bool switchAtRequiredStop() const;
|
|
|
|
int ascrate75() const;
|
|
|
|
int ascrate50() const;
|
|
|
|
int ascratestops() const;
|
|
|
|
int ascratelast6m() const;
|
|
|
|
int descrate() const;
|
2017-02-11 19:24:18 +00:00
|
|
|
int sacfactor() const;
|
|
|
|
int problemsolvingtime() const;
|
2016-01-14 18:08:34 +00:00
|
|
|
int bottompo2() const;
|
|
|
|
int decopo2() const;
|
2016-05-21 10:14:23 +00:00
|
|
|
int bestmixend() const;
|
2016-01-14 18:08:34 +00:00
|
|
|
int reserveGas() const;
|
|
|
|
int minSwitchDuration() const;
|
|
|
|
int bottomSac() const;
|
|
|
|
int decoSac() const;
|
|
|
|
deco_mode decoMode() const;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setLastStop(bool value);
|
|
|
|
void setVerbatimPlan(bool value);
|
|
|
|
void setDisplayRuntime(bool value);
|
|
|
|
void setDisplayDuration(bool value);
|
|
|
|
void setDisplayTransitions(bool value);
|
2017-09-18 14:10:47 +00:00
|
|
|
void setDisplayVariations(bool value);
|
2016-01-14 18:08:34 +00:00
|
|
|
void setDoo2breaks(bool value);
|
|
|
|
void setDropStoneMode(bool value);
|
|
|
|
void setSafetyStop(bool value);
|
|
|
|
void setSwitchAtRequiredStop(bool value);
|
|
|
|
void setAscrate75(int value);
|
|
|
|
void setAscrate50(int value);
|
|
|
|
void setAscratestops(int value);
|
|
|
|
void setAscratelast6m(int value);
|
|
|
|
void setDescrate(int value);
|
2017-02-11 19:24:18 +00:00
|
|
|
void setSacFactor(int value);
|
|
|
|
void setProblemSolvingTime(int value);
|
2016-01-14 18:08:34 +00:00
|
|
|
void setBottompo2(int value);
|
|
|
|
void setDecopo2(int value);
|
2016-05-21 10:14:23 +00:00
|
|
|
void setBestmixend(int value);
|
2016-01-14 18:08:34 +00:00
|
|
|
void setReserveGas(int value);
|
|
|
|
void setMinSwitchDuration(int value);
|
|
|
|
void setBottomSac(int value);
|
2016-10-15 17:52:17 +00:00
|
|
|
void setDecoSac(int value);
|
2016-01-14 18:08:34 +00:00
|
|
|
void setDecoMode(deco_mode value);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void lastStopChanged(bool value);
|
|
|
|
void verbatimPlanChanged(bool value);
|
|
|
|
void displayRuntimeChanged(bool value);
|
|
|
|
void displayDurationChanged(bool value);
|
|
|
|
void displayTransitionsChanged(bool value);
|
2017-09-18 14:10:47 +00:00
|
|
|
void displayVariationsChanged(bool value);
|
2016-01-14 18:08:34 +00:00
|
|
|
void doo2breaksChanged(bool value);
|
|
|
|
void dropStoneModeChanged(bool value);
|
|
|
|
void safetyStopChanged(bool value);
|
|
|
|
void switchAtRequiredStopChanged(bool value);
|
|
|
|
void ascrate75Changed(int value);
|
|
|
|
void ascrate50Changed(int value);
|
|
|
|
void ascratestopsChanged(int value);
|
|
|
|
void ascratelast6mChanged(int value);
|
|
|
|
void descrateChanged(int value);
|
2017-02-11 19:24:18 +00:00
|
|
|
void sacFactorChanged(int value);
|
|
|
|
void problemSolvingTimeChanged(int value);
|
2016-01-14 18:08:34 +00:00
|
|
|
void bottompo2Changed(int value);
|
|
|
|
void decopo2Changed(int value);
|
2016-05-21 10:14:23 +00:00
|
|
|
void bestmixendChanged(int value);
|
2016-01-14 18:08:34 +00:00
|
|
|
void reserveGasChanged(int value);
|
|
|
|
void minSwitchDurationChanged(int value);
|
|
|
|
void bottomSacChanged(int value);
|
|
|
|
void decoSacChanged(int value);
|
|
|
|
void decoModeChanged(deco_mode value);
|
2016-01-14 16:00:41 +00:00
|
|
|
|
|
|
|
private:
|
2016-09-25 18:01:03 +00:00
|
|
|
const QString group = QStringLiteral("Planner");
|
2016-01-14 16:00:41 +00:00
|
|
|
};
|
|
|
|
|
2016-01-14 18:21:28 +00:00
|
|
|
class UnitsSettings : public QObject {
|
|
|
|
Q_OBJECT
|
2016-01-22 20:37:18 +00:00
|
|
|
Q_PROPERTY(int length READ length WRITE setLength NOTIFY lengthChanged)
|
|
|
|
Q_PROPERTY(int pressure READ pressure WRITE setPressure NOTIFY pressureChanged)
|
|
|
|
Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged)
|
|
|
|
Q_PROPERTY(int temperature READ temperature WRITE setTemperature NOTIFY temperatureChanged)
|
|
|
|
Q_PROPERTY(int weight READ weight WRITE setWeight NOTIFY weightChanged)
|
2016-01-14 19:06:55 +00:00
|
|
|
Q_PROPERTY(QString unit_system READ unitSystem WRITE setUnitSystem NOTIFY unitSystemChanged)
|
2016-01-14 18:21:28 +00:00
|
|
|
Q_PROPERTY(bool coordinates_traditional READ coordinatesTraditional WRITE setCoordinatesTraditional NOTIFY coordinatesTraditionalChanged)
|
2016-01-22 20:37:18 +00:00
|
|
|
Q_PROPERTY(int vertical_speed_time READ verticalSpeedTime WRITE setVerticalSpeedTime NOTIFY verticalSpeedTimeChanged)
|
2017-05-06 20:44:22 +00:00
|
|
|
Q_PROPERTY(int duration_units READ durationUnits WRITE setDurationUnits NOTIFY durationUnitChanged)
|
2017-11-21 14:52:01 +00:00
|
|
|
Q_PROPERTY(bool show_units_table READ showUnitsTable WRITE setShowUnitsTable NOTIFY showUnitsTableChanged)
|
2016-01-14 18:21:28 +00:00
|
|
|
|
2016-01-14 19:06:55 +00:00
|
|
|
public:
|
|
|
|
UnitsSettings(QObject *parent = 0);
|
2016-01-22 20:37:18 +00:00
|
|
|
int length() const;
|
|
|
|
int pressure() const;
|
|
|
|
int volume() const;
|
|
|
|
int temperature() const;
|
|
|
|
int weight() const;
|
|
|
|
int verticalSpeedTime() const;
|
2017-05-06 20:44:22 +00:00
|
|
|
int durationUnits() const;
|
2017-11-21 14:52:01 +00:00
|
|
|
bool showUnitsTable() const;
|
2016-01-14 19:06:55 +00:00
|
|
|
QString unitSystem() const;
|
|
|
|
bool coordinatesTraditional() const;
|
|
|
|
|
|
|
|
public slots:
|
2016-01-22 20:37:18 +00:00
|
|
|
void setLength(int value);
|
|
|
|
void setPressure(int value);
|
|
|
|
void setVolume(int value);
|
|
|
|
void setTemperature(int value);
|
|
|
|
void setWeight(int value);
|
|
|
|
void setVerticalSpeedTime(int value);
|
2017-05-06 20:44:22 +00:00
|
|
|
void setDurationUnits(int value);
|
2017-11-21 14:52:01 +00:00
|
|
|
void setShowUnitsTable(bool value);
|
2016-01-14 19:06:55 +00:00
|
|
|
void setUnitSystem(const QString& value);
|
|
|
|
void setCoordinatesTraditional(bool value);
|
|
|
|
|
|
|
|
signals:
|
2016-01-22 20:37:18 +00:00
|
|
|
void lengthChanged(int value);
|
|
|
|
void pressureChanged(int value);
|
|
|
|
void volumeChanged(int value);
|
|
|
|
void temperatureChanged(int value);
|
|
|
|
void weightChanged(int value);
|
|
|
|
void verticalSpeedTimeChanged(int value);
|
2016-01-14 19:06:55 +00:00
|
|
|
void unitSystemChanged(const QString& value);
|
|
|
|
void coordinatesTraditionalChanged(bool value);
|
2017-05-06 20:44:22 +00:00
|
|
|
void durationUnitChanged(int value);
|
2017-11-21 14:52:01 +00:00
|
|
|
void showUnitsTableChanged(bool value);
|
2016-01-14 19:06:55 +00:00
|
|
|
private:
|
2016-09-25 18:01:03 +00:00
|
|
|
const QString group = QStringLiteral("Units");
|
2016-01-14 18:21:28 +00:00
|
|
|
};
|
|
|
|
|
2016-01-22 17:39:40 +00:00
|
|
|
class GeneralSettingsObjectWrapper : public QObject {
|
|
|
|
Q_OBJECT
|
2018-07-10 13:04:35 +00:00
|
|
|
Q_PROPERTY(QString default_filename READ defaultFilename WRITE setDefaultFilename NOTIFY defaultFilenameChanged)
|
|
|
|
Q_PROPERTY(QString default_cylinder READ defaultCylinder WRITE setDefaultCylinder NOTIFY defaultCylinderChanged)
|
|
|
|
Q_PROPERTY(short default_file_behavior READ defaultFileBehavior WRITE setDefaultFileBehavior NOTIFY defaultFileBehaviorChanged)
|
|
|
|
Q_PROPERTY(bool use_default_file READ useDefaultFile WRITE setUseDefaultFile NOTIFY useDefaultFileChanged)
|
|
|
|
Q_PROPERTY(int defaultsetpoint READ defaultSetPoint WRITE setDefaultSetPoint NOTIFY defaultSetPointChanged)
|
|
|
|
Q_PROPERTY(int o2consumption READ o2Consumption WRITE setO2Consumption NOTIFY o2ConsumptionChanged)
|
|
|
|
Q_PROPERTY(int pscr_ratio READ pscrRatio WRITE setPscrRatio NOTIFY pscrRatioChanged)
|
|
|
|
Q_PROPERTY(bool auto_recalculate_thumbnails READ autoRecalculateThumbnails WRITE setAutoRecalculateThumbnails NOTIFY autoRecalculateThumbnailsChanged)
|
|
|
|
Q_PROPERTY(bool extract_video_thumbnails READ extractVideoThumbnails WRITE setExtractVideoThumbnails NOTIFY extractVideoThumbnailsChanged)
|
|
|
|
Q_PROPERTY(int extract_video_thumbnails_position READ extractVideoThumbnailsPosition WRITE setExtractVideoThumbnailsPosition NOTIFY extractVideoThumbnailsPositionChanged)
|
|
|
|
Q_PROPERTY(QString ffmpeg_executable READ ffmpegExecutable WRITE setFfmpegExecutable NOTIFY ffmpegExecutableChanged)
|
2016-01-22 17:39:40 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
GeneralSettingsObjectWrapper(QObject *parent);
|
|
|
|
QString defaultFilename() const;
|
|
|
|
QString defaultCylinder() const;
|
|
|
|
short defaultFileBehavior() const;
|
|
|
|
bool useDefaultFile() const;
|
|
|
|
int defaultSetPoint() const;
|
|
|
|
int o2Consumption() const;
|
|
|
|
int pscrRatio() const;
|
2018-05-27 13:42:22 +00:00
|
|
|
bool autoRecalculateThumbnails() const;
|
2018-07-10 13:04:35 +00:00
|
|
|
bool extractVideoThumbnails() const;
|
|
|
|
int extractVideoThumbnailsPosition() const;
|
|
|
|
QString ffmpegExecutable() const;
|
2016-01-22 17:39:40 +00:00
|
|
|
|
|
|
|
public slots:
|
2018-05-27 13:42:22 +00:00
|
|
|
void setDefaultFilename (const QString& value);
|
|
|
|
void setDefaultCylinder (const QString& value);
|
|
|
|
void setDefaultFileBehavior (short value);
|
|
|
|
void setUseDefaultFile (bool value);
|
|
|
|
void setDefaultSetPoint (int value);
|
|
|
|
void setO2Consumption (int value);
|
|
|
|
void setPscrRatio (int value);
|
|
|
|
void setAutoRecalculateThumbnails (bool value);
|
2018-07-10 13:04:35 +00:00
|
|
|
void setExtractVideoThumbnails (bool value);
|
|
|
|
void setExtractVideoThumbnailsPosition (int value);
|
|
|
|
void setFfmpegExecutable (const QString &value);
|
2016-01-22 17:39:40 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void defaultFilenameChanged(const QString& value);
|
|
|
|
void defaultCylinderChanged(const QString& value);
|
|
|
|
void defaultFileBehaviorChanged(short value);
|
|
|
|
void useDefaultFileChanged(bool value);
|
|
|
|
void defaultSetPointChanged(int value);
|
|
|
|
void o2ConsumptionChanged(int value);
|
|
|
|
void pscrRatioChanged(int value);
|
2018-05-27 13:42:22 +00:00
|
|
|
void autoRecalculateThumbnailsChanged(int value);
|
2018-07-10 13:04:35 +00:00
|
|
|
void extractVideoThumbnailsChanged(bool value);
|
|
|
|
void extractVideoThumbnailsPositionChanged(int value);
|
|
|
|
void ffmpegExecutableChanged(const QString &value);
|
2016-01-22 17:39:40 +00:00
|
|
|
private:
|
2016-09-25 18:01:03 +00:00
|
|
|
const QString group = QStringLiteral("GeneralSettings");
|
2016-01-22 18:00:44 +00:00
|
|
|
};
|
2016-01-22 17:39:40 +00:00
|
|
|
|
2016-01-22 18:55:03 +00:00
|
|
|
class LanguageSettingsObjectWrapper : public QObject {
|
2016-01-11 21:10:00 +00:00
|
|
|
Q_OBJECT
|
2016-01-22 18:55:03 +00:00
|
|
|
Q_PROPERTY(QString language READ language WRITE setLanguage NOTIFY languageChanged)
|
2016-01-11 21:10:00 +00:00
|
|
|
Q_PROPERTY(QString time_format READ timeFormat WRITE setTimeFormat NOTIFY timeFormatChanged)
|
2016-01-22 18:55:03 +00:00
|
|
|
Q_PROPERTY(QString date_format READ dateFormat WRITE setDateFormat NOTIFY dateFormatChanged)
|
2016-01-11 21:10:00 +00:00
|
|
|
Q_PROPERTY(QString date_format_short READ dateFormatShort WRITE setDateFormatShort NOTIFY dateFormatShortChanged)
|
2016-10-17 16:23:45 +00:00
|
|
|
Q_PROPERTY(QString lang_locale READ langLocale WRITE setLangLocale NOTIFY langLocaleChanged)
|
2016-01-11 21:10:00 +00:00
|
|
|
Q_PROPERTY(bool time_format_override READ timeFormatOverride WRITE setTimeFormatOverride NOTIFY timeFormatOverrideChanged)
|
|
|
|
Q_PROPERTY(bool date_format_override READ dateFormatOverride WRITE setDateFormatOverride NOTIFY dateFormatOverrideChanged)
|
2016-01-22 18:55:03 +00:00
|
|
|
Q_PROPERTY(bool use_system_language READ useSystemLanguage WRITE setUseSystemLanguage NOTIFY useSystemLanguageChanged)
|
|
|
|
|
|
|
|
public:
|
|
|
|
LanguageSettingsObjectWrapper(QObject *parent);
|
|
|
|
QString language() const;
|
2016-10-17 16:23:45 +00:00
|
|
|
QString langLocale() const;
|
2016-01-22 18:55:03 +00:00
|
|
|
QString timeFormat() const;
|
|
|
|
QString dateFormat() const;
|
|
|
|
QString dateFormatShort() const;
|
|
|
|
bool timeFormatOverride() const;
|
|
|
|
bool dateFormatOverride() const;
|
|
|
|
bool useSystemLanguage() const;
|
|
|
|
|
|
|
|
public slots:
|
2016-09-20 19:35:49 +00:00
|
|
|
void setLangLocale (const QString& value);
|
2016-01-22 18:55:03 +00:00
|
|
|
void setLanguage (const QString& value);
|
|
|
|
void setTimeFormat (const QString& value);
|
|
|
|
void setDateFormat (const QString& value);
|
|
|
|
void setDateFormatShort (const QString& value);
|
|
|
|
void setTimeFormatOverride (bool value);
|
|
|
|
void setDateFormatOverride (bool value);
|
|
|
|
void setUseSystemLanguage (bool value);
|
|
|
|
signals:
|
|
|
|
void languageChanged(const QString& value);
|
2016-10-17 16:23:45 +00:00
|
|
|
void langLocaleChanged(const QString& value);
|
2016-01-22 18:55:03 +00:00
|
|
|
void timeFormatChanged(const QString& value);
|
|
|
|
void dateFormatChanged(const QString& value);
|
|
|
|
void dateFormatShortChanged(const QString& value);
|
|
|
|
void timeFormatOverrideChanged(bool value);
|
|
|
|
void dateFormatOverrideChanged(bool value);
|
|
|
|
void useSystemLanguageChanged(bool value);
|
|
|
|
|
|
|
|
private:
|
2016-09-25 18:01:03 +00:00
|
|
|
const QString group = QStringLiteral("Language");
|
2016-01-22 18:55:03 +00:00
|
|
|
};
|
|
|
|
|
2016-01-22 19:46:15 +00:00
|
|
|
class LocationServiceSettingsObjectWrapper : public QObject {
|
|
|
|
Q_OBJECT
|
2016-01-11 21:10:00 +00:00
|
|
|
Q_PROPERTY(int time_threshold READ timeThreshold WRITE setTimeThreshold NOTIFY timeThresholdChanged)
|
|
|
|
Q_PROPERTY(int distance_threshold READ distanceThreshold WRITE setDistanceThreshold NOTIFY distanceThresholdChanged)
|
2016-01-22 19:46:15 +00:00
|
|
|
public:
|
|
|
|
LocationServiceSettingsObjectWrapper(QObject *parent);
|
|
|
|
int timeThreshold() const;
|
|
|
|
int distanceThreshold() const;
|
|
|
|
public slots:
|
|
|
|
void setTimeThreshold(int value);
|
|
|
|
void setDistanceThreshold(int value);
|
|
|
|
signals:
|
|
|
|
void timeThresholdChanged(int value);
|
|
|
|
void distanceThresholdChanged(int value);
|
|
|
|
private:
|
2016-11-01 10:28:08 +00:00
|
|
|
const QString group = QStringLiteral("LocationService");
|
2016-01-22 19:46:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SettingsObjectWrapper : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(TechnicalDetailsSettings* techical_details MEMBER techDetails CONSTANT)
|
|
|
|
Q_PROPERTY(PartialPressureGasSettings* pp_gas MEMBER pp_gas CONSTANT)
|
2018-07-23 15:49:12 +00:00
|
|
|
Q_PROPERTY(qPrefFacebook* facebook MEMBER facebook CONSTANT)
|
2016-01-22 19:46:15 +00:00
|
|
|
Q_PROPERTY(GeocodingPreferences* geocoding MEMBER geocoding CONSTANT)
|
2018-07-27 19:55:49 +00:00
|
|
|
Q_PROPERTY(qPrefProxy* proxy MEMBER proxy CONSTANT)
|
2018-07-14 14:52:25 +00:00
|
|
|
Q_PROPERTY(qPrefCloudStorage* cloud_storage MEMBER cloud_storage CONSTANT)
|
2016-01-22 19:46:15 +00:00
|
|
|
Q_PROPERTY(DivePlannerSettings* planner MEMBER planner_settings CONSTANT)
|
|
|
|
Q_PROPERTY(UnitsSettings* units MEMBER unit_settings CONSTANT)
|
|
|
|
|
|
|
|
Q_PROPERTY(GeneralSettingsObjectWrapper* general MEMBER general_settings CONSTANT)
|
2018-07-04 19:45:48 +00:00
|
|
|
Q_PROPERTY(qPrefDisplay* display MEMBER display_settings CONSTANT)
|
2016-01-22 19:46:15 +00:00
|
|
|
Q_PROPERTY(LanguageSettingsObjectWrapper* language MEMBER language_settings CONSTANT)
|
2018-07-12 08:25:28 +00:00
|
|
|
Q_PROPERTY(qPrefAnimations* animation MEMBER animation_settings CONSTANT)
|
2016-01-22 19:46:15 +00:00
|
|
|
Q_PROPERTY(LocationServiceSettingsObjectWrapper* Location MEMBER location_settings CONSTANT)
|
2016-08-10 18:50:00 +00:00
|
|
|
|
|
|
|
Q_PROPERTY(UpdateManagerSettings* update MEMBER update_manager_settings CONSTANT)
|
2018-07-22 14:19:22 +00:00
|
|
|
Q_PROPERTY(qPrefDiveComputer* dive_computer MEMBER dive_computer_settings CONSTANT)
|
2016-01-22 19:46:15 +00:00
|
|
|
public:
|
2016-01-25 17:54:23 +00:00
|
|
|
static SettingsObjectWrapper *instance();
|
2016-01-11 21:10:00 +00:00
|
|
|
|
2016-01-11 22:37:54 +00:00
|
|
|
TechnicalDetailsSettings *techDetails;
|
2016-01-11 21:10:00 +00:00
|
|
|
PartialPressureGasSettings *pp_gas;
|
2018-07-23 15:49:12 +00:00
|
|
|
qPrefFacebook *facebook;
|
2016-01-11 21:10:00 +00:00
|
|
|
GeocodingPreferences *geocoding;
|
2018-07-27 19:55:49 +00:00
|
|
|
qPrefProxy *proxy;
|
2018-07-14 14:52:25 +00:00
|
|
|
qPrefCloudStorage *cloud_storage;
|
2016-01-14 16:00:41 +00:00
|
|
|
DivePlannerSettings *planner_settings;
|
2016-01-14 19:06:55 +00:00
|
|
|
UnitsSettings *unit_settings;
|
2016-01-22 17:39:40 +00:00
|
|
|
GeneralSettingsObjectWrapper *general_settings;
|
2018-07-04 19:45:48 +00:00
|
|
|
qPrefDisplay *display_settings;
|
2016-01-22 19:46:15 +00:00
|
|
|
LanguageSettingsObjectWrapper *language_settings;
|
2018-07-12 08:25:28 +00:00
|
|
|
qPrefAnimations *animation_settings;
|
2016-01-22 19:46:15 +00:00
|
|
|
LocationServiceSettingsObjectWrapper *location_settings;
|
2016-08-10 18:50:00 +00:00
|
|
|
UpdateManagerSettings *update_manager_settings;
|
2018-07-22 14:19:22 +00:00
|
|
|
qPrefDiveComputer *dive_computer_settings;
|
2016-08-10 21:10:15 +00:00
|
|
|
|
2016-08-26 19:01:31 +00:00
|
|
|
void sync();
|
|
|
|
void load();
|
2016-01-25 17:54:23 +00:00
|
|
|
private:
|
|
|
|
SettingsObjectWrapper(QObject *parent = NULL);
|
2016-01-11 21:10:00 +00:00
|
|
|
};
|
|
|
|
|
2016-01-22 19:46:15 +00:00
|
|
|
#endif
|