Преглед на файлове

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.
jp9000 преди 10 години
родител
ревизия
a903ae3103
променени са 3 файла, в които са добавени 14 реда и са изтрити 9 реда
  1. 7 6
      obs/window-basic-main-profiles.cpp
  2. 4 3
      obs/window-basic-main-scene-collections.cpp
  3. 3 0
      obs/window-basic-main.cpp

+ 7 - 6
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, "------------------------------------------------");
 }

+ 4 - 3
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();
 }

+ 3 - 0
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)