mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make it compile
This is not hoocked up on Subsurface code yet, but it's already being compilled. now I just need to hoock things up. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b01bca7953
commit
fd175e8781
4 changed files with 146 additions and 89 deletions
|
@ -84,7 +84,7 @@ set(SUBSURFACE_CORE_LIB_SRCS
|
||||||
|
|
||||||
#Subsurface Qt have the Subsurface structs QObjectified for easy access via QML.
|
#Subsurface Qt have the Subsurface structs QObjectified for easy access via QML.
|
||||||
subsurface-qt/DiveObjectHelper.cpp
|
subsurface-qt/DiveObjectHelper.cpp
|
||||||
#subsurface-qt/SettingsObjectWrapper.cpp
|
subsurface-qt/SettingsObjectWrapper.cpp
|
||||||
${SERIAL_FTDI}
|
${SERIAL_FTDI}
|
||||||
${PLATFORM_SRC}
|
${PLATFORM_SRC}
|
||||||
${BT_CORE_SRC_FILES}
|
${BT_CORE_SRC_FILES}
|
||||||
|
|
|
@ -809,15 +809,10 @@ void CloudStorageSettings::setBackgroundSync(bool value)
|
||||||
|
|
||||||
void CloudStorageSettings::setBaseUrl(const QString& value)
|
void CloudStorageSettings::setBaseUrl(const QString& value)
|
||||||
{
|
{
|
||||||
free(prefs.cloud_base_url);
|
free((void*)prefs.cloud_base_url);
|
||||||
free(prefs.cloud_git_url);
|
free((void*)prefs.cloud_git_url);
|
||||||
prefs.cloud_base_url = copy_string(qPrintable(value));
|
prefs.cloud_base_url = copy_string(qPrintable(value));
|
||||||
prefs.cloud_git_url = strdup(qPrintable(QString(prefs.cloud_base_url) + "/git"));
|
prefs.cloud_git_url = copy_string(qPrintable(QString(prefs.cloud_base_url) + "/git"));
|
||||||
}
|
|
||||||
|
|
||||||
void CloudStorageSettings::setCloudUrl(const QString& value) /* no-op */
|
|
||||||
{
|
|
||||||
Q_UNUSED(value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloudStorageSettings::setGitUrl(const QString& value)
|
void CloudStorageSettings::setGitUrl(const QString& value)
|
||||||
|
@ -1060,7 +1055,7 @@ void DivePlannerSettings::setAscratelast6m(int value)
|
||||||
s.beginGroup(group);
|
s.beginGroup(group);
|
||||||
s.setValue("ascratelast6m", value);
|
s.setValue("ascratelast6m", value);
|
||||||
prefs.ascratelast6m = value;
|
prefs.ascratelast6m = value;
|
||||||
emit ascratelast6mChanged();
|
emit ascratelast6mChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivePlannerSettings::setDescrate(int value)
|
void DivePlannerSettings::setDescrate(int value)
|
||||||
|
@ -1144,46 +1139,46 @@ void DivePlannerSettings::setDecoMode(deco_mode value)
|
||||||
emit decoModeChanged(value);
|
emit decoModeChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
UnitsSettings::UnitsSettings(QObject *parent = 0) :
|
UnitsSettings::UnitsSettings(QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
group(QStringLiteral("Units"))
|
group(QStringLiteral("Units"))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
units::length UnitsSettings::length() const
|
int UnitsSettings::length() const
|
||||||
{
|
{
|
||||||
return prefs.units.length;
|
return prefs.units.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
units::pressure UnitsSettings::pressure() const
|
int UnitsSettings::pressure() const
|
||||||
{
|
{
|
||||||
return prefs.units.pressure;
|
return prefs.units.pressure;
|
||||||
}
|
}
|
||||||
|
|
||||||
units::volume UnitsSettings::volume() const
|
int UnitsSettings::volume() const
|
||||||
{
|
{
|
||||||
return prefs.units.volume;
|
return prefs.units.volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
units::temperature UnitsSettings::temperature() const
|
int UnitsSettings::temperature() const
|
||||||
{
|
{
|
||||||
return prefs.units.temperature;
|
return prefs.units.temperature;
|
||||||
}
|
}
|
||||||
|
|
||||||
units::weight UnitsSettings::weight() const
|
int UnitsSettings::weight() const
|
||||||
{
|
{
|
||||||
return prefs.units.weight;
|
return prefs.units.weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
units::vertical_speed_time UnitsSettings::verticalSpeedTime() const
|
int UnitsSettings::verticalSpeedTime() const
|
||||||
{
|
{
|
||||||
return prefs.units.vertical_speed_time;
|
return prefs.units.vertical_speed_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString UnitsSettings::unitSystem() const
|
QString UnitsSettings::unitSystem() const
|
||||||
{
|
{
|
||||||
return prefs.unit_system;
|
return QString(); /*FIXME: there's no char * units on the prefs. */
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UnitsSettings::coordinatesTraditional() const
|
bool UnitsSettings::coordinatesTraditional() const
|
||||||
|
@ -1191,57 +1186,57 @@ bool UnitsSettings::coordinatesTraditional() const
|
||||||
return prefs.coordinates_traditional;
|
return prefs.coordinates_traditional;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnitsSettings::setLength(units::length value)
|
void UnitsSettings::setLength(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(group);
|
s.beginGroup(group);
|
||||||
s.setValue("length", value);
|
s.setValue("length", value);
|
||||||
prefs.units.length = value;
|
prefs.units.length = (units::LENGHT) value;
|
||||||
emit lengthChanged(value);
|
emit lengthChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnitsSettings::setPressure(units::pressure value)
|
void UnitsSettings::setPressure(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(group);
|
s.beginGroup(group);
|
||||||
s.setValue("pressure", value);
|
s.setValue("pressure", value);
|
||||||
prefs.units.pressure = value;
|
prefs.units.pressure = (units::PRESSURE) value;
|
||||||
emit pressureChanged(value);
|
emit pressureChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnitsSettings::setVolume(units::volume value)
|
void UnitsSettings::setVolume(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(group);
|
s.beginGroup(group);
|
||||||
s.setValue("volume", value);
|
s.setValue("volume", value);
|
||||||
prefs.units.volume = value;
|
prefs.units.volume = (units::VOLUME) value;
|
||||||
emit volumeChanged(value);
|
emit volumeChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnitsSettings::setTemperature(units::temperature value)
|
void UnitsSettings::setTemperature(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(group);
|
s.beginGroup(group);
|
||||||
s.setValue("temperature", value);
|
s.setValue("temperature", value);
|
||||||
prefs.units.temperature = value;
|
prefs.units.temperature = (units::TEMPERATURE) value;
|
||||||
emit temperatureChanged(value);
|
emit temperatureChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnitsSettings::setWeight(units::weight value)
|
void UnitsSettings::setWeight(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(group);
|
s.beginGroup(group);
|
||||||
s.setValue("weight", value);
|
s.setValue("weight", value);
|
||||||
prefs.units.weight = value;
|
prefs.units.weight = (units::WEIGHT) value;
|
||||||
emit weightChanged(value);
|
emit weightChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnitsSettings::setVerticalSpeedTime(units::vertical_speed_time value)
|
void UnitsSettings::setVerticalSpeedTime(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(group);
|
s.beginGroup(group);
|
||||||
s.setValue("vertical_speed_time", value);
|
s.setValue("vertical_speed_time", value);
|
||||||
prefs.units.vertical_speed_time = value;
|
prefs.units.vertical_speed_time = (units::TIME) value;
|
||||||
emit verticalSpeedTimeChanged(value);
|
emit verticalSpeedTimeChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1249,7 +1244,7 @@ void UnitsSettings::setCoordinatesTraditional(bool value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("coordinates", value);
|
s.setValue("coordinates", value);
|
||||||
prefs.coordinates_traditional = value.;
|
prefs.coordinates_traditional = value;
|
||||||
emit coordinatesTraditionalChanged(value);
|
emit coordinatesTraditionalChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1257,7 +1252,6 @@ void UnitsSettings::setUnitSystem(const QString& value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("unit_system", value);
|
s.setValue("unit_system", value);
|
||||||
prefs.unit_system = value;
|
|
||||||
|
|
||||||
if (value == QStringLiteral("metric")) {
|
if (value == QStringLiteral("metric")) {
|
||||||
prefs.unit_system = METRIC;
|
prefs.unit_system = METRIC;
|
||||||
|
@ -1334,7 +1328,7 @@ void GeneralSettingsObjectWrapper::setDefaultFileBehavior(short value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("default_file_behavior", value);
|
s.setValue("default_file_behavior", value);
|
||||||
prefs.default_file_behavior = value.;
|
prefs.default_file_behavior = value;
|
||||||
if (prefs.default_file_behavior == UNDEFINED_DEFAULT_FILE) {
|
if (prefs.default_file_behavior == UNDEFINED_DEFAULT_FILE) {
|
||||||
// undefined, so check if there's a filename set and
|
// undefined, so check if there's a filename set and
|
||||||
// use that, otherwise go with no default file
|
// use that, otherwise go with no default file
|
||||||
|
@ -1350,7 +1344,7 @@ void GeneralSettingsObjectWrapper::setUseDefaultFile(bool value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("use_default_file", value);
|
s.setValue("use_default_file", value);
|
||||||
prefs.use_default_file = value.;
|
prefs.use_default_file = value;
|
||||||
emit useDefaultFileChanged(value);
|
emit useDefaultFileChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1358,7 +1352,7 @@ void GeneralSettingsObjectWrapper::setDefaultSetPoint(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("defaultsetpoint", value);
|
s.setValue("defaultsetpoint", value);
|
||||||
prefs.defaultsetpoint = value.;
|
prefs.defaultsetpoint = value;
|
||||||
emit defaultSetPointChanged(value);
|
emit defaultSetPointChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1366,7 +1360,7 @@ void GeneralSettingsObjectWrapper::setO2Consumption(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("o2consumption", value);
|
s.setValue("o2consumption", value);
|
||||||
prefs.o2consumption = value.;
|
prefs.o2consumption = value;
|
||||||
emit o2ConsumptionChanged(value);
|
emit o2ConsumptionChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1374,7 +1368,7 @@ void GeneralSettingsObjectWrapper::setPscrRatio(int value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("pscr_ratio", value);
|
s.setValue("pscr_ratio", value);
|
||||||
prefs.pscr_ratio = value.;
|
prefs.pscr_ratio = value;
|
||||||
emit pscrRatioChanged(value);
|
emit pscrRatioChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1403,22 +1397,23 @@ void DisplaySettingsObjectWrapper::setDivelistFont(const QString& value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("divelist_font", value);
|
s.setValue("divelist_font", value);
|
||||||
|
QString newValue = value;
|
||||||
if (value.contains(","))
|
if (value.contains(","))
|
||||||
value = value.left(value.indexOf(","));
|
newValue = value.left(value.indexOf(","));
|
||||||
|
|
||||||
if (!subsurface_ignore_font(value.toUtf8().constData())) {
|
if (!subsurface_ignore_font(newValue.toUtf8().constData())) {
|
||||||
free((void *)prefs.divelist_font);
|
free((void *)prefs.divelist_font);
|
||||||
prefs.divelist_font = strdup(value.toUtf8().constData());
|
prefs.divelist_font = strdup(newValue.toUtf8().constData());
|
||||||
qApp->setFont(QFont(value));
|
qApp->setFont(QFont(newValue));
|
||||||
}
|
}
|
||||||
emit divelistFontChanged(value);
|
emit divelistFontChanged(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplaySettingsObjectWrapper::setFontSize(double value)
|
void DisplaySettingsObjectWrapper::setFontSize(double value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("font_size", value);
|
s.setValue("font_size", value);
|
||||||
prefs.font_size = value.;
|
prefs.font_size = value;
|
||||||
QFont defaultFont = qApp->font();
|
QFont defaultFont = qApp->font();
|
||||||
defaultFont.setPointSizeF(prefs.font_size);
|
defaultFont.setPointSizeF(prefs.font_size);
|
||||||
qApp->setFont(defaultFont);
|
qApp->setFont(defaultFont);
|
||||||
|
@ -1429,7 +1424,7 @@ void DisplaySettingsObjectWrapper::setDisplayInvalidDives(short value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("displayinvalid", value);
|
s.setValue("displayinvalid", value);
|
||||||
prefs.display_invalid_dives = value.;
|
prefs.display_invalid_dives = value;
|
||||||
emit displayInvalidDivesChanged(value);
|
emit displayInvalidDivesChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1518,7 +1513,7 @@ void LanguageSettingsObjectWrapper::setTimeFormatOverride(bool value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("time_format_override", value);
|
s.setValue("time_format_override", value);
|
||||||
prefs.time_format_override = value.;
|
prefs.time_format_override = value;
|
||||||
emit timeFormatOverrideChanged(value);
|
emit timeFormatOverrideChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1526,24 +1521,86 @@ void LanguageSettingsObjectWrapper::setDateFormatOverride(bool value)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("date_format_override", value);
|
s.setValue("date_format_override", value);
|
||||||
prefs.date_format_override = value.;
|
prefs.date_format_override = value;
|
||||||
emit dateFormatOverrideChanged(value);
|
emit dateFormatOverrideChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AnimationsSettingsObjectWrapper::AnimationsSettingsObjectWrapper(QObject* parent):
|
||||||
|
QObject(parent),
|
||||||
|
group("Animations")
|
||||||
|
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int AnimationsSettingsObjectWrapper::animationSpeed() const
|
||||||
|
{
|
||||||
|
return prefs.animation_speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnimationsSettingsObjectWrapper::setAnimationSpeed(int value)
|
||||||
|
{
|
||||||
|
QSettings s;
|
||||||
|
s.setValue("animation_speed", value);
|
||||||
|
prefs.animation_speed = value;
|
||||||
|
emit animationSpeedChanged(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
LocationServiceSettingsObjectWrapper::LocationServiceSettingsObjectWrapper(QObject* parent):
|
||||||
|
QObject(parent),
|
||||||
|
group("locationService")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int LocationServiceSettingsObjectWrapper::distanceThreshold() const
|
||||||
|
{
|
||||||
|
return prefs.distance_threshold;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LocationServiceSettingsObjectWrapper::timeThreshold() const
|
||||||
|
{
|
||||||
|
return prefs.time_threshold;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LocationServiceSettingsObjectWrapper::setDistanceThreshold(int value)
|
||||||
|
{
|
||||||
|
QSettings s;
|
||||||
|
s.setValue("distance_threshold", value);
|
||||||
|
prefs.distance_threshold = value;
|
||||||
|
emit distanceThresholdChanged(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LocationServiceSettingsObjectWrapper::setTimeThreshold(int value)
|
||||||
|
{
|
||||||
|
QSettings s;
|
||||||
|
s.setValue("time_threshold", value);
|
||||||
|
prefs.time_threshold = value;
|
||||||
|
emit timeThresholdChanged( value);
|
||||||
|
}
|
||||||
|
|
||||||
SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent):
|
SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent):
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
techDetails(new TechnicalDetailsSettings()),
|
techDetails(new TechnicalDetailsSettings(this)),
|
||||||
pp_gas(new PartialPressureGasSettings()),
|
pp_gas(new PartialPressureGasSettings(this)),
|
||||||
facebook(new FacebookSettings()),
|
facebook(new FacebookSettings(this)),
|
||||||
geocoding(new GeocodingPreferences()),
|
geocoding(new GeocodingPreferences(this)),
|
||||||
proxy(new ProxySettings()),
|
proxy(new ProxySettings(this)),
|
||||||
cloud_storage(new CloudStorageSettings()),
|
cloud_storage(new CloudStorageSettings(this)),
|
||||||
planner_settings(new DivePlannerSettings()),
|
planner_settings(new DivePlannerSettings(this)),
|
||||||
unit_settings(new UnitsSettings()),
|
unit_settings(new UnitsSettings(this)),
|
||||||
general_settings(new GeneralSettingsObjectWrapper()),
|
general_settings(new GeneralSettingsObjectWrapper(this)),
|
||||||
display_settings(new DisplaySettingsObjectWrapper()),
|
display_settings(new DisplaySettingsObjectWrapper(this)),
|
||||||
language_settings(new LanguageSettingsObjectWrapper()),
|
language_settings(new LanguageSettingsObjectWrapper(this)),
|
||||||
animation_settings(new AnimationsSettingsObjectWrapper()),
|
animation_settings(new AnimationsSettingsObjectWrapper(this)),
|
||||||
location_settings(new LocationServiceSettingsObjectWrapper())
|
location_settings(new LocationServiceSettingsObjectWrapper(this))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsObjectWrapper::setSaveUserIdLocal(short int value)
|
||||||
|
{
|
||||||
|
//TODO: Find where this is stored on the preferences.
|
||||||
|
}
|
||||||
|
|
||||||
|
short int SettingsObjectWrapper::saveUserIdLocal() const
|
||||||
|
{
|
||||||
|
return prefs.save_userid_local;
|
||||||
|
}
|
||||||
|
|
|
@ -413,43 +413,43 @@ private:
|
||||||
|
|
||||||
class UnitsSettings : public QObject {
|
class UnitsSettings : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(units::length length READ length WRITE setLength NOTIFY lengthChanged)
|
Q_PROPERTY(int length READ length WRITE setLength NOTIFY lengthChanged)
|
||||||
Q_PROPERTY(units::pressure pressure READ pressure WRITE setPressure NOTIFY pressureChanged)
|
Q_PROPERTY(int pressure READ pressure WRITE setPressure NOTIFY pressureChanged)
|
||||||
Q_PROPERTY(units::volume volume READ volume WRITE setVolume NOTIFY volumeChanged)
|
Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged)
|
||||||
Q_PROPERTY(units::temperature temperature READ temperature WRITE setTemperature NOTIFY temperatureChanged)
|
Q_PROPERTY(int temperature READ temperature WRITE setTemperature NOTIFY temperatureChanged)
|
||||||
Q_PROPERTY(units::weight weight READ weight WRITE setWeight NOTIFY weightChanged)
|
Q_PROPERTY(int weight READ weight WRITE setWeight NOTIFY weightChanged)
|
||||||
Q_PROPERTY(QString unit_system READ unitSystem WRITE setUnitSystem NOTIFY unitSystemChanged)
|
Q_PROPERTY(QString unit_system READ unitSystem WRITE setUnitSystem NOTIFY unitSystemChanged)
|
||||||
Q_PROPERTY(bool coordinates_traditional READ coordinatesTraditional WRITE setCoordinatesTraditional NOTIFY coordinatesTraditionalChanged)
|
Q_PROPERTY(bool coordinates_traditional READ coordinatesTraditional WRITE setCoordinatesTraditional NOTIFY coordinatesTraditionalChanged)
|
||||||
Q_PROPERTY(units::vertical_speed_time vertical_speed_time READ verticalSpeedTime WRITE setVerticalSpeedTime NOTIFY verticalSpeedTimeChanged)
|
Q_PROPERTY(int vertical_speed_time READ verticalSpeedTime WRITE setVerticalSpeedTime NOTIFY verticalSpeedTimeChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UnitsSettings(QObject *parent = 0);
|
UnitsSettings(QObject *parent = 0);
|
||||||
units::length length() const;
|
int length() const;
|
||||||
units::pressure pressure() const;
|
int pressure() const;
|
||||||
units::volume volume() const;
|
int volume() const;
|
||||||
units::temperature temperature() const;
|
int temperature() const;
|
||||||
units::weight weight() const;
|
int weight() const;
|
||||||
units::vertical_speed_time verticalSpeedTime() const;
|
int verticalSpeedTime() const;
|
||||||
QString unitSystem() const;
|
QString unitSystem() const;
|
||||||
bool coordinatesTraditional() const;
|
bool coordinatesTraditional() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setLength(units::length value);
|
void setLength(int value);
|
||||||
void setPressure(units::pressure value);
|
void setPressure(int value);
|
||||||
void setVolume(units::volume value);
|
void setVolume(int value);
|
||||||
void setTemperature(units::temperature value);
|
void setTemperature(int value);
|
||||||
void setWeight(units::weight value);
|
void setWeight(int value);
|
||||||
void setVerticalSpeedTime(units::vertical_speed_time value);
|
void setVerticalSpeedTime(int value);
|
||||||
void setUnitSystem(const QString& value);
|
void setUnitSystem(const QString& value);
|
||||||
void setCoordinatesTraditional(bool value);
|
void setCoordinatesTraditional(bool value);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void lengthChanged(units::length value);
|
void lengthChanged(int value);
|
||||||
void pressureChanged(units::pressure value);
|
void pressureChanged(int value);
|
||||||
void volumeChanged(units::volume value);
|
void volumeChanged(int value);
|
||||||
void temperatureChanged(units::temperature value);
|
void temperatureChanged(int value);
|
||||||
void weightChanged(units::weight value);
|
void weightChanged(int value);
|
||||||
void verticalSpeedTimeChanged(units::vertical_speed_time value);
|
void verticalSpeedTimeChanged(int value);
|
||||||
void unitSystemChanged(const QString& value);
|
void unitSystemChanged(const QString& value);
|
||||||
void coordinatesTraditionalChanged(bool value);
|
void coordinatesTraditionalChanged(bool value);
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -228,29 +228,29 @@ static inline int mbar_to_PSI(int mbar)
|
||||||
#undef PASCAL
|
#undef PASCAL
|
||||||
#endif
|
#endif
|
||||||
struct units {
|
struct units {
|
||||||
enum {
|
enum LENGHT {
|
||||||
METERS,
|
METERS,
|
||||||
FEET
|
FEET
|
||||||
} length;
|
} length;
|
||||||
enum {
|
enum VOLUME {
|
||||||
LITER,
|
LITER,
|
||||||
CUFT
|
CUFT
|
||||||
} volume;
|
} volume;
|
||||||
enum {
|
enum PRESSURE {
|
||||||
BAR,
|
BAR,
|
||||||
PSI,
|
PSI,
|
||||||
PASCAL
|
PASCAL
|
||||||
} pressure;
|
} pressure;
|
||||||
enum {
|
enum TEMPERATURE {
|
||||||
CELSIUS,
|
CELSIUS,
|
||||||
FAHRENHEIT,
|
FAHRENHEIT,
|
||||||
KELVIN
|
KELVIN
|
||||||
} temperature;
|
} temperature;
|
||||||
enum {
|
enum WEIGHT {
|
||||||
KG,
|
KG,
|
||||||
LBS
|
LBS
|
||||||
} weight;
|
} weight;
|
||||||
enum {
|
enum TIME {
|
||||||
SECONDS,
|
SECONDS,
|
||||||
MINUTES
|
MINUTES
|
||||||
} vertical_speed_time;
|
} vertical_speed_time;
|
||||||
|
|
Loading…
Add table
Reference in a new issue