Added "Force Revive Page" checkbox to application settings.

This commit is contained in:
2016-12-24 15:56:21 +01:00
parent 3f53235b1b
commit 342f4795df
6 changed files with 59 additions and 7 deletions
@@ -8,6 +8,13 @@ namespace advsettings {
void SettingsTabController::initStage1() {
m_autoStartEnabled = vr::VRApplications()->GetApplicationAutoLaunch(OverlayController::applicationKey);
auto settings = OverlayController::appSettings();
settings->beginGroup("applicationSettings");
auto value = settings->value("forceRevivePage", m_forceRevivePage);
settings->endGroup();
if (value.isValid() && !value.isNull()) {
m_forceRevivePage = value.toBool();
}
}
void SettingsTabController::initStage2(OverlayController * parent, QQuickWindow * widget) {
@@ -41,4 +48,24 @@ void SettingsTabController::setAutoStartEnabled(bool value, bool notify) {
}
}
bool SettingsTabController::forceRevivePage() const {
return m_forceRevivePage;
}
void SettingsTabController::setForceRevivePage(bool value, bool notify) {
if (m_forceRevivePage != value) {
m_forceRevivePage = value;
auto settings = OverlayController::appSettings();
settings->beginGroup("applicationSettings");
settings->setValue("forceRevivePage", m_forceRevivePage);
settings->endGroup();
settings->sync();
if (notify) {
emit forceRevivePageChanged(m_forceRevivePage);
}
}
}
} // namespace advconfig