Browse Source

Advise user he needs a scene before adding a source.

Socapex 11 years ago
parent
commit
978de126b3
2 changed files with 11 additions and 1 deletions
  1. 4 0
      build/data/obs-studio/locale/en.txt
  2. 7 1
      obs/window-basic-main.cpp

+ 4 - 0
build/data/obs-studio/locale/en.txt

@@ -46,6 +46,10 @@ Basic.Main.AddSceneDlg.Text="Please enter the name of the scene"
 Basic.SourceSelect.CreateNew="Create new"
 Basic.SourceSelect.AddExisting="Add Existing"
 
+# no scene warning
+Basic.Main.AddSourceHelp.Title="Cannot Add Source"
+Basic.Main.AddSourceHelp.Text="You need to have at least 1 scene to add a source."
+
 # basic mode main window
 Basic.Main.Scenes="Scenes"
 Basic.Main.Sources="Sources"

+ 7 - 1
obs/window-basic-main.cpp

@@ -1045,8 +1045,14 @@ void OBSBasic::AddSourcePopupMenu(const QPoint &pos)
 	bool foundValues = false;
 	size_t idx = 0;
 
-	if (!GetCurrentScene())
+	if (!GetCurrentScene()) {
+		// Tell the user he needs a scene first (help beginners).
+		QMessageBox::information(this,
+				QTStr("Basic.Main.AddSourceHelp.Title"),
+				QTStr("Basic.Main.AddSourceHelp.Text"));
 		return;
+	}
+
 
 	QMenu popup;
 	while (obs_enum_input_types(idx++, &type)) {