UI: Split global config into app and user config

This introduces a split of the current single ConfigFile instance for
all configuration into two separate instances.

The app config instance contains system-wide settings that mainly
concern the working of the app itself, whereas the user config instance
contains settings actually exposed to the user for the configuration.
This commit is contained in:
PatTheMav
2024-09-03 16:28:36 +02:00
committed by Ryan Foster
parent 26d275223a
commit 2635cf3a2a
35 changed files with 1135 additions and 912 deletions

View File

@@ -44,10 +44,10 @@ OBSBasicInteraction::OBSBasicInteraction(QWidget *parent, OBSSource source_)
OBSBasicInteraction::SourceRenamed, this),
eventFilter(BuildEventFilter())
{
int cx = (int)config_get_int(App()->GlobalConfig(), "InteractionWindow",
"cx");
int cy = (int)config_get_int(App()->GlobalConfig(), "InteractionWindow",
"cy");
int cx = (int)config_get_int(App()->GetUserConfig(),
"InteractionWindow", "cx");
int cy = (int)config_get_int(App()->GetUserConfig(),
"InteractionWindow", "cy");
Qt::WindowFlags flags = windowFlags();
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
@@ -166,9 +166,9 @@ void OBSBasicInteraction::closeEvent(QCloseEvent *event)
if (!event->isAccepted())
return;
config_set_int(App()->GlobalConfig(), "InteractionWindow", "cx",
config_set_int(App()->GetAppConfig(), "InteractionWindow", "cx",
width());
config_set_int(App()->GlobalConfig(), "InteractionWindow", "cy",
config_set_int(App()->GetAppConfig(), "InteractionWindow", "cy",
height());
obs_display_remove_draw_callback(ui->preview->GetDisplay(),