mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add Support for more OSTC 3 Settings
Adds support for more OSTC 3 Settings to the reading, writing, backup and restore functions. These settings are: last deco, units, sampling rate, salinity, dive mode colour and compass gain. Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
parent
aad60ef6da
commit
09ec8a44e5
6 changed files with 867 additions and 60 deletions
|
@ -61,9 +61,15 @@ bool ConfigureDiveComputer::saveXMLBackup(QString fileName, DeviceDetails *detai
|
|||
xml += "\n</DiveComputer>";
|
||||
xml += "\n<Settings>";
|
||||
xml += addSettingToXML("CustomText", details->customText());
|
||||
xml += addSettingToXML("LastDeco", details->lastDeco());
|
||||
xml += addSettingToXML("Brightness", details->brightness());
|
||||
xml += addSettingToXML("Units", details->units());
|
||||
xml += addSettingToXML("SamplingRate", details->samplingRate());
|
||||
xml += addSettingToXML("Salinity", details->salinity());
|
||||
xml += addSettingToXML("DiveModeColor", details->diveModeColor());
|
||||
xml += addSettingToXML("Language", details->language());
|
||||
xml += addSettingToXML("DateFormat", details->dateFormat());
|
||||
xml += addSettingToXML("CompassGain", details->compassGain());
|
||||
xml += "\n</Settings>";
|
||||
xml += "\n</DiveComputerSettingsBackup>";
|
||||
QFile file(fileName);
|
||||
|
@ -120,14 +126,32 @@ bool ConfigureDiveComputer::restoreXMLBackup(QString fileName, DeviceDetails *de
|
|||
if (settingName == "CustomText")
|
||||
details->setCustomText(keyString);
|
||||
|
||||
if (settingName == "LastDeco")
|
||||
details->setLastDeco(keyString.toInt());
|
||||
|
||||
if (settingName == "Brightness")
|
||||
details->setBrightness(keyString.toInt());
|
||||
|
||||
if (settingName == "Units")
|
||||
details->setUnits(keyString.toInt());
|
||||
|
||||
if (settingName == "SamplingRate")
|
||||
details->setSamplingRate(keyString.toInt());
|
||||
|
||||
if (settingName == "Salinity")
|
||||
details->setSalinity(keyString.toInt());
|
||||
|
||||
if (settingName == "DiveModeColour")
|
||||
details->setDiveModeColor(keyString.toInt());
|
||||
|
||||
if (settingName == "Language")
|
||||
details->setLanguage(keyString.toInt());
|
||||
|
||||
if (settingName == "DateFormat")
|
||||
details->setDateFormat(keyString.toInt());
|
||||
|
||||
if (settingName == "CompassGain")
|
||||
details->setCompassGain(keyString.toInt());
|
||||
}
|
||||
|
||||
settingNode = settingNode->next;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue