From 12236d73f43c433a47e85e449441b39a6c258e4c Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 17 May 2017 23:29:02 -0700 Subject: [PATCH] UI: Fix enumeration of scene collections on first run When running the program for the first time, no scene collections will show up in the scene collection menu. This changes it to forcibly save the first scene collection on the first run of the program, and then re-enumerates the list to ensure it's listed. --- UI/window-basic-main-scene-collections.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/UI/window-basic-main-scene-collections.cpp b/UI/window-basic-main-scene-collections.cpp index 5335c959d..088fb7013 100644 --- a/UI/window-basic-main-scene-collections.cpp +++ b/UI/window-basic-main-scene-collections.cpp @@ -221,9 +221,22 @@ void OBSBasic::RefreshSceneCollections() EnumSceneCollections(addCollection); + /* force saving of first scene collection on first run, otherwise + * no scene collections will show up */ + if (!count) { + long prevDisableVal = disableSaving; + + disableSaving = 0; + SaveProjectNow(); + disableSaving = prevDisableVal; + + EnumSceneCollections(addCollection); + } + ui->actionRemoveSceneCollection->setEnabled(count > 1); OBSBasic *main = reinterpret_cast(App()->GetMainWindow()); + main->OpenSavedProjectors(); main->ui->actionPasteFilters->setEnabled(false); main->ui->actionPasteRef->setEnabled(false);