mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: activate qPrefDivePlanner
remove DivePlanner from SettingsObjectWrapper and reference qPrefDivePlanner update files using SettingsObjectWrapper/DivePlanner to use qPrefDivePlanner this activated qPrefDivePlanner and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
357510b9cd
commit
21243ec4f7
7 changed files with 115 additions and 696 deletions
|
@ -715,429 +715,6 @@ void GeocodingPreferences::setThirdTaxonomyCategory(taxonomy_category value)
|
|||
emit thirdTaxonomyCategoryChanged(value);
|
||||
}
|
||||
|
||||
DivePlannerSettings::DivePlannerSettings(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::lastStop() const
|
||||
{
|
||||
return prefs.last_stop;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::verbatimPlan() const
|
||||
{
|
||||
return prefs.verbatim_plan;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::displayRuntime() const
|
||||
{
|
||||
return prefs.display_runtime;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::displayDuration() const
|
||||
{
|
||||
return prefs.display_duration;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::displayTransitions() const
|
||||
{
|
||||
return prefs.display_transitions;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::displayVariations() const
|
||||
{
|
||||
return prefs.display_variations;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::doo2breaks() const
|
||||
{
|
||||
return prefs.doo2breaks;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::dropStoneMode() const
|
||||
{
|
||||
return prefs.drop_stone_mode;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::safetyStop() const
|
||||
{
|
||||
return prefs.safetystop;
|
||||
}
|
||||
|
||||
bool DivePlannerSettings::switchAtRequiredStop() const
|
||||
{
|
||||
return prefs.switch_at_req_stop;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::ascrate75() const
|
||||
{
|
||||
return prefs.ascrate75;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::ascrate50() const
|
||||
{
|
||||
return prefs.ascrate50;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::ascratestops() const
|
||||
{
|
||||
return prefs.ascratestops;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::ascratelast6m() const
|
||||
{
|
||||
return prefs.ascratelast6m;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::descrate() const
|
||||
{
|
||||
return prefs.descrate;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::sacfactor() const
|
||||
{
|
||||
return prefs.sacfactor;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::problemsolvingtime() const
|
||||
{
|
||||
return prefs.problemsolvingtime;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::bottompo2() const
|
||||
{
|
||||
return prefs.bottompo2;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::decopo2() const
|
||||
{
|
||||
return prefs.decopo2;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::bestmixend() const
|
||||
{
|
||||
return prefs.bestmixend.mm;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::reserveGas() const
|
||||
{
|
||||
return prefs.reserve_gas;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::minSwitchDuration() const
|
||||
{
|
||||
return prefs.min_switch_duration;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::bottomSac() const
|
||||
{
|
||||
return prefs.bottomsac;
|
||||
}
|
||||
|
||||
int DivePlannerSettings::decoSac() const
|
||||
{
|
||||
return prefs.decosac;
|
||||
}
|
||||
|
||||
deco_mode DivePlannerSettings::decoMode() const
|
||||
{
|
||||
return prefs.planner_deco_mode;
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setLastStop(bool value)
|
||||
{
|
||||
if (value == prefs.last_stop)
|
||||
return;
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("last_stop", value);
|
||||
prefs.last_stop = value;
|
||||
emit lastStopChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setVerbatimPlan(bool value)
|
||||
{
|
||||
if (value == prefs.verbatim_plan)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("verbatim_plan", value);
|
||||
prefs.verbatim_plan = value;
|
||||
emit verbatimPlanChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDisplayRuntime(bool value)
|
||||
{
|
||||
if (value == prefs.display_runtime)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("display_runtime", value);
|
||||
prefs.display_runtime = value;
|
||||
emit displayRuntimeChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDisplayDuration(bool value)
|
||||
{
|
||||
if (value == prefs.display_duration)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("display_duration", value);
|
||||
prefs.display_duration = value;
|
||||
emit displayDurationChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDisplayTransitions(bool value)
|
||||
{
|
||||
if (value == prefs.display_transitions)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("display_transitions", value);
|
||||
prefs.display_transitions = value;
|
||||
emit displayTransitionsChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDisplayVariations(bool value)
|
||||
{
|
||||
if (value == prefs.display_variations)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("display_variations", value);
|
||||
prefs.display_variations = value;
|
||||
emit displayVariationsChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDoo2breaks(bool value)
|
||||
{
|
||||
if (value == prefs.doo2breaks)
|
||||
return;
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("doo2breaks", value);
|
||||
prefs.doo2breaks = value;
|
||||
emit doo2breaksChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDropStoneMode(bool value)
|
||||
{
|
||||
if (value == prefs.drop_stone_mode)
|
||||
return;
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("drop_stone_mode", value);
|
||||
prefs.drop_stone_mode = value;
|
||||
emit dropStoneModeChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setSafetyStop(bool value)
|
||||
{
|
||||
if (value == prefs.safetystop)
|
||||
return;
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("safetystop", value);
|
||||
prefs.safetystop = value;
|
||||
emit safetyStopChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setSwitchAtRequiredStop(bool value)
|
||||
{
|
||||
if (value == prefs.switch_at_req_stop)
|
||||
return;
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("switch_at_req_stop", value);
|
||||
prefs.switch_at_req_stop = value;
|
||||
emit switchAtRequiredStopChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setAscrate75(int value)
|
||||
{
|
||||
if (value == prefs.ascrate75)
|
||||
return;
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("ascrate75", value);
|
||||
prefs.ascrate75 = value;
|
||||
emit ascrate75Changed(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setAscrate50(int value)
|
||||
{
|
||||
if (value == prefs.ascrate50)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("ascrate50", value);
|
||||
prefs.ascrate50 = value;
|
||||
emit ascrate50Changed(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setAscratestops(int value)
|
||||
{
|
||||
if (value == prefs.ascratestops)
|
||||
return;
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("ascratestops", value);
|
||||
prefs.ascratestops = value;
|
||||
emit ascratestopsChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setAscratelast6m(int value)
|
||||
{
|
||||
if (value == prefs.ascratelast6m)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("ascratelast6m", value);
|
||||
prefs.ascratelast6m = value;
|
||||
emit ascratelast6mChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDescrate(int value)
|
||||
{
|
||||
if (value == prefs.descrate)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("descrate", value);
|
||||
prefs.descrate = value;
|
||||
emit descrateChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setSacFactor(int value)
|
||||
{
|
||||
if (value == prefs.sacfactor)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("sacfactor", value);
|
||||
prefs.sacfactor = value;
|
||||
emit sacFactorChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setProblemSolvingTime(int value)
|
||||
{
|
||||
if (value == prefs.problemsolvingtime)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("problemsolvingtime", value);
|
||||
prefs.problemsolvingtime = value;
|
||||
emit problemSolvingTimeChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setBottompo2(int value)
|
||||
{
|
||||
if (value == prefs.bottompo2)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("bottompo2", value);
|
||||
prefs.bottompo2 = value;
|
||||
emit bottompo2Changed(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDecopo2(int value)
|
||||
{
|
||||
if (value == prefs.decopo2)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("decopo2", value);
|
||||
prefs.decopo2 = value;
|
||||
emit decopo2Changed(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setBestmixend(int value)
|
||||
{
|
||||
if (value == prefs.bestmixend.mm)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("bestmixend", value);
|
||||
prefs.bestmixend.mm = value;
|
||||
emit bestmixendChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setReserveGas(int value)
|
||||
{
|
||||
if (value == prefs.reserve_gas)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("reserve_gas", value);
|
||||
prefs.reserve_gas = value;
|
||||
emit reserveGasChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setMinSwitchDuration(int value)
|
||||
{
|
||||
if (value == prefs.min_switch_duration)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("min_switch_duration", value);
|
||||
prefs.min_switch_duration = value;
|
||||
emit minSwitchDurationChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setBottomSac(int value)
|
||||
{
|
||||
if (value == prefs.bottomsac)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("bottomsac", value);
|
||||
prefs.bottomsac = value;
|
||||
emit bottomSacChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDecoSac(int value)
|
||||
{
|
||||
if (value == prefs.decosac)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("decosac", value);
|
||||
prefs.decosac = value;
|
||||
emit decoSacChanged(value);
|
||||
}
|
||||
|
||||
void DivePlannerSettings::setDecoMode(deco_mode value)
|
||||
{
|
||||
if (value == prefs.planner_deco_mode)
|
||||
return;
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(group);
|
||||
s.setValue("deco_mode", value);
|
||||
prefs.planner_deco_mode = value;
|
||||
emit decoModeChanged(value);
|
||||
}
|
||||
|
||||
GeneralSettingsObjectWrapper::GeneralSettingsObjectWrapper(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
@ -1528,7 +1105,7 @@ QObject(parent),
|
|||
geocoding(new GeocodingPreferences(this)),
|
||||
proxy(new qPrefProxy(this)),
|
||||
cloud_storage(new qPrefCloudStorage(this)),
|
||||
planner_settings(new DivePlannerSettings(this)),
|
||||
planner_settings(new qPrefDivePlanner(this)),
|
||||
unit_settings(new qPrefUnits(this)),
|
||||
general_settings(new GeneralSettingsObjectWrapper(this)),
|
||||
display_settings(new qPrefDisplay(this)),
|
||||
|
@ -1626,36 +1203,7 @@ void SettingsObjectWrapper::load()
|
|||
GET_INT("distance_threshold", distance_threshold);
|
||||
s.endGroup();
|
||||
|
||||
s.beginGroup("Planner");
|
||||
GET_BOOL("last_stop", last_stop);
|
||||
GET_BOOL("verbatim_plan", verbatim_plan);
|
||||
GET_BOOL("display_duration", display_duration);
|
||||
GET_BOOL("display_runtime", display_runtime);
|
||||
GET_BOOL("display_transitions", display_transitions);
|
||||
GET_BOOL("display_variations", display_variations);
|
||||
GET_BOOL("safetystop", safetystop);
|
||||
GET_BOOL("doo2breaks", doo2breaks);
|
||||
GET_BOOL("switch_at_req_stop",switch_at_req_stop);
|
||||
GET_BOOL("drop_stone_mode", drop_stone_mode);
|
||||
|
||||
GET_INT("reserve_gas", reserve_gas);
|
||||
GET_INT("ascrate75", ascrate75);
|
||||
GET_INT("ascrate50", ascrate50);
|
||||
GET_INT("ascratestops", ascratestops);
|
||||
GET_INT("ascratelast6m", ascratelast6m);
|
||||
GET_INT("descrate", descrate);
|
||||
GET_INT("sacfactor", sacfactor);
|
||||
GET_INT("problemsolvingtime", problemsolvingtime);
|
||||
GET_INT("bottompo2", bottompo2);
|
||||
GET_INT("decopo2", decopo2);
|
||||
GET_INT("bestmixend", bestmixend.mm);
|
||||
GET_INT("min_switch_duration", min_switch_duration);
|
||||
GET_INT("bottomsac", bottomsac);
|
||||
GET_INT("decosac", decosac);
|
||||
|
||||
prefs.planner_deco_mode = deco_mode(s.value("deco_mode", default_prefs.planner_deco_mode).toInt());
|
||||
s.endGroup();
|
||||
|
||||
qPrefDivePlanner::instance()->load();
|
||||
qPrefDiveComputer::instance()->load();
|
||||
|
||||
s.beginGroup("UpdateManager");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue