UI: Add option to save projectors

This adds an option to the general settings to save the opened
projectors on exit.

(Note: Fixed conflicts -Jim)

Closes jp9000/obs-studio#743
This commit is contained in:
cg2121
2016-12-29 09:21:53 -06:00
committed by jp9000
parent 7eee8de331
commit 29f22e72a8
9 changed files with 217 additions and 14 deletions

View File

@@ -282,6 +282,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
HookWidget(ui->systemTrayEnabled, CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->systemTrayWhenStarted,CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->systemTrayAlways, CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->saveProjectors, CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->snappingEnabled, CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->screenSnapping, CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->centerSnapping, CHECK_CHANGED, GENERAL_CHANGED);
@@ -896,6 +897,10 @@ void OBSBasicSettings::LoadGeneralSettings()
"BasicWindow", "SysTrayMinimizeToTray");
ui->systemTrayAlways->setChecked(systemTrayAlways);
bool saveProjectors = config_get_bool(GetGlobalConfig(),
"BasicWindow", "SaveProjectors");
ui->saveProjectors->setChecked(saveProjectors);
bool snappingEnabled = config_get_bool(GetGlobalConfig(),
"BasicWindow", "SnappingEnabled");
ui->snappingEnabled->setChecked(snappingEnabled);
@@ -2351,6 +2356,11 @@ void OBSBasicSettings::SaveGeneralSettings()
config_set_bool(GetGlobalConfig(),
"BasicWindow", "SysTrayMinimizeToTray",
ui->systemTrayAlways->isChecked());
if (WidgetChanged(ui->saveProjectors))
config_set_bool(GetGlobalConfig(), "BasicWindow",
"SaveProjectors",
ui->saveProjectors->isChecked());
}
void OBSBasicSettings::SaveStream1Settings()