From 85ee5d591b635b3f952fd6b81f3181773252e989 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 16 Jun 2014 19:41:36 -0700 Subject: [PATCH] UI: Open properties on user source creation Every time I created a source I found myself in need to actually open up the properties. It was getting somewhat on my nerves, so I decided to just make it automatically pop up when the source is created. --- obs/window-basic-main.cpp | 10 ++++++++++ obs/window-basic-main.hpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index cab17394d..9afbb7a9b 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -511,6 +511,8 @@ void OBSBasic::OBSInit() Load(savePath); ResetAudioDevices(); + + loaded = true; } OBSBasic::~OBSBasic() @@ -579,6 +581,14 @@ void OBSBasic::InsertSceneItem(obs_sceneitem_t item) QVariant::fromValue(OBSSceneItem(item))); ui->sources->insertItem(0, listItem); + ui->sources->setCurrentRow(0); + + /* if the source was just created, open properties dialog */ + if (sourceSceneRefs[source] == 0 && loaded) { + delete properties; + properties = new OBSBasicProperties(this, source); + properties->Init(); + } } /* Qt callbacks for invokeMethod */ diff --git a/obs/window-basic-main.hpp b/obs/window-basic-main.hpp index 542673ec2..7e2b3c3d6 100644 --- a/obs/window-basic-main.hpp +++ b/obs/window-basic-main.hpp @@ -53,6 +53,8 @@ private: std::vector volumes; + bool loaded = false; + QPointer properties; QPointer transformWindow;