Add adjustChaperone setting to BoolSetting

Meant to act as an example of how to add new settings.
This commit is contained in:
Vasily
2019-12-03 08:26:10 +01:00
committed by username223
parent d73fcf3443
commit c2796273e7
3 changed files with 8 additions and 6 deletions
+1
View File
@@ -19,6 +19,7 @@ enum class BoolSetting
PLAYSPACE_oldStyleMotion, PLAYSPACE_oldStyleMotion,
PLAYSPACE_universeCenteredRotation, PLAYSPACE_universeCenteredRotation,
PLAYSPACE_enableSeatedMotion, PLAYSPACE_enableSeatedMotion,
PLAYSPACE_adjustChaperone,
APPLICATION_disableVersionCheck, APPLICATION_disableVersionCheck,
APPLICATION_previousShutdownSafe, APPLICATION_previousShutdownSafe,
+4
View File
@@ -206,6 +206,10 @@ private:
SettingCategory::Playspace, SettingCategory::Playspace,
QtInfo{ "enableSeatedMotion" }, QtInfo{ "enableSeatedMotion" },
false }, false },
BoolSettingValue{ BoolSetting::PLAYSPACE_adjustChaperone,
SettingCategory::Playspace,
QtInfo{ "adjustChaperone" },
true },
BoolSettingValue{ BoolSetting::APPLICATION_disableVersionCheck, BoolSettingValue{ BoolSetting::APPLICATION_disableVersionCheck,
SettingCategory::Application, SettingCategory::Application,
@@ -42,11 +42,8 @@ void MoveCenterTabController::initStage1()
auto settings = OverlayController::appSettings(); auto settings = OverlayController::appSettings();
settings->beginGroup( "playspaceSettings" ); settings->beginGroup( "playspaceSettings" );
auto value = settings->value( "adjustChaperone", m_adjustChaperone ); m_adjustChaperone = settings::getSetting(
if ( value.isValid() && !value.isNull() ) settings::BoolSetting::PLAYSPACE_adjustChaperone );
{
m_adjustChaperone = value.toBool();
}
m_settingsRightHandDragEnabled = settings::getSetting( m_settingsRightHandDragEnabled = settings::getSetting(
settings::BoolSetting::PLAYSPACE_moveShortcutRight ); settings::BoolSetting::PLAYSPACE_moveShortcutRight );
@@ -61,7 +58,7 @@ void MoveCenterTabController::initStage1()
m_turnBounds m_turnBounds
= settings::getSetting( settings::BoolSetting::PLAYSPACE_turnBounds ); = settings::getSetting( settings::BoolSetting::PLAYSPACE_turnBounds );
value = settings->value( "dragComfortFactor", m_dragComfortFactor ); auto value = settings->value( "dragComfortFactor", m_dragComfortFactor );
if ( value.isValid() && !value.isNull() ) if ( value.isValid() && !value.isNull() )
{ {
m_dragComfortFactor = value.toUInt(); m_dragComfortFactor = value.toUInt();