From a903ae310391ee1f013e87851e9e79363487ee14 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 5 Jul 2015 23:39:05 -0700 Subject: [PATCH] UI: Fix logging for profiles/scene collections This makes it so that the log message for altering scene collections and/or profiles is now below, and then the separator below that. This makes it a bit more apparent that any loading/clearing/etc that happens before the log message are associated with the log message. --- obs/window-basic-main-profiles.cpp | 13 +++++++------ obs/window-basic-main-scene-collections.cpp | 7 ++++--- obs/window-basic-main.cpp | 3 +++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/obs/window-basic-main-profiles.cpp b/obs/window-basic-main-profiles.cpp index 2f159609e..25561a70d 100644 --- a/obs/window-basic-main-profiles.cpp +++ b/obs/window-basic-main-profiles.cpp @@ -233,9 +233,9 @@ bool OBSBasic::AddProfile(bool create_new, const char *title, const char *text, if (create_new) ResetProfileData(); - blog(LOG_INFO, "------------------------------------------------"); blog(LOG_INFO, "Created profile '%s' (%s, %s)", newName.c_str(), create_new ? "clean" : "duplicate", newDir.c_str()); + blog(LOG_INFO, "------------------------------------------------"); config_save(App()->GlobalConfig()); UpdateTitleBar(); @@ -290,6 +290,7 @@ void OBSBasic::DeleteProfile(const char *profileName, const char *profileDir) blog(LOG_INFO, "------------------------------------------------"); blog(LOG_INFO, "Removed profile '%s' (%s)", profileName, profileDir); + blog(LOG_INFO, "------------------------------------------------"); } void OBSBasic::RefreshProfiles() @@ -425,9 +426,9 @@ void OBSBasic::on_actionRemoveProfile_triggered() RefreshProfiles(); config_save(App()->GlobalConfig()); - blog(LOG_INFO, "------------------------------------------------"); blog(LOG_INFO, "Switched to profile '%s' (%s)", newName.c_str(), newDir); + blog(LOG_INFO, "------------------------------------------------"); UpdateTitleBar(); } @@ -470,14 +471,14 @@ void OBSBasic::ChangeProfile() config_set_string(App()->GlobalConfig(), "Basic", "ProfileDir", newDir); - blog(LOG_INFO, "------------------------------------------------"); - blog(LOG_INFO, "Switched to profile '%s' (%s)", - newName, newDir); - config.Swap(basicConfig); InitBasicConfigDefaults(); ResetProfileData(); RefreshProfiles(); config_save(App()->GlobalConfig()); UpdateTitleBar(); + + blog(LOG_INFO, "Switched to profile '%s' (%s)", + newName, newDir); + blog(LOG_INFO, "------------------------------------------------"); } diff --git a/obs/window-basic-main-scene-collections.cpp b/obs/window-basic-main-scene-collections.cpp index f69168a13..86f7730bc 100644 --- a/obs/window-basic-main-scene-collections.cpp +++ b/obs/window-basic-main-scene-collections.cpp @@ -173,10 +173,10 @@ void OBSBasic::AddSceneCollection(bool create_new) SaveProject(); RefreshSceneCollections(); - blog(LOG_INFO, "------------------------------------------------"); blog(LOG_INFO, "Added scene collection '%s' (%s, %s.json)", name.c_str(), create_new ? "clean" : "duplicate", file.c_str()); + blog(LOG_INFO, "------------------------------------------------"); UpdateTitleBar(); } @@ -262,6 +262,7 @@ void OBSBasic::on_actionRenameSceneCollection_triggered() blog(LOG_INFO, "------------------------------------------------"); blog(LOG_INFO, "Renamed scene collection to '%s' (%s.json)", name.c_str(), file.c_str()); + blog(LOG_INFO, "------------------------------------------------"); UpdateTitleBar(); RefreshSceneCollections(); @@ -319,11 +320,11 @@ void OBSBasic::on_actionRemoveSceneCollection_triggered() const char *newFile = config_get_string(App()->GlobalConfig(), "Basic", "SceneCollectionFile"); - blog(LOG_INFO, "------------------------------------------------"); blog(LOG_INFO, "Removed scene collection '%s' (%s.json), " "switched to '%s' (%s.json)", oldName.c_str(), oldFile.c_str(), newName.c_str(), newFile); + blog(LOG_INFO, "------------------------------------------------"); UpdateTitleBar(); } @@ -357,9 +358,9 @@ void OBSBasic::ChangeSceneCollection() const char *newFile = config_get_string(App()->GlobalConfig(), "Basic", "SceneCollectionFile"); - blog(LOG_INFO, "------------------------------------------------"); blog(LOG_INFO, "Switched to scene collection '%s' (%s.json)", newName, newFile); + blog(LOG_INFO, "------------------------------------------------"); UpdateTitleBar(); } diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 2967e7fad..47d20a418 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -2114,6 +2114,9 @@ void OBSBasic::ClearSceneData() sourceSceneRefs.clear(); disableSaving--; + + blog(LOG_INFO, "All scene data cleared"); + blog(LOG_INFO, "------------------------------------------------"); } void OBSBasic::closeEvent(QCloseEvent *event)