From 3f3abf20c06cba51b0057bf0ef3e9c555860de23 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 29 Dec 2013 20:01:19 -0700 Subject: [PATCH] implement 'remove scene' button --- obs/window-basic-main.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index ab506e897..57a587023 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -38,13 +38,14 @@ void OBSBasic::SceneRemoved(obs_source_t source) const char *name = obs_source_getname(source); int item = scenes->FindString(name); - if (item == wxNOT_FOUND) { - blog(LOG_WARNING, "Tried to remove the scene '%s', but " - "apparently it wasn't found", name); + if (item != wxNOT_FOUND) { + scenes->Delete(item); return; } - scenes->Delete(item); + item = sources->FindString(name); + if (item != wxNOT_FOUND) + sources->Delete(item); } void OBSBasic::SourceAdded(void *data, calldata_t params) @@ -212,6 +213,13 @@ void OBSBasic::sceneAddClicked(wxCommandEvent &event) void OBSBasic::sceneRemoveClicked(wxCommandEvent &event) { + int sel = scenes->GetSelection(); + if (sel == wxNOT_FOUND) + return; + + obs_scene_t scene = (obs_scene_t)scenes->GetClientData(sel); + obs_source_t source = obs_scene_getsource(scene); + obs_source_remove(source); } void OBSBasic::scenePropertiesClicked(wxCommandEvent &event)