UI: Add events for renaming profiles/collections
The events make it more clear when profiles or scene collections are renamed.
This commit is contained in:
parent
4afafaac6d
commit
748cf32a43
@ -58,6 +58,8 @@ enum obs_frontend_event {
|
||||
OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING,
|
||||
OBS_FRONTEND_EVENT_PROFILE_CHANGING,
|
||||
OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN,
|
||||
OBS_FRONTEND_EVENT_PROFILE_RENAMED,
|
||||
OBS_FRONTEND_EVENT_SCENE_COLLECTION_RENAMED,
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -517,9 +517,6 @@ void OBSBasic::on_actionDupProfile_triggered()
|
||||
|
||||
void OBSBasic::on_actionRenameProfile_triggered()
|
||||
{
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_PROFILE_CHANGING);
|
||||
|
||||
std::string curDir =
|
||||
config_get_string(App()->GlobalConfig(), "Basic", "ProfileDir");
|
||||
std::string curName =
|
||||
@ -534,10 +531,8 @@ void OBSBasic::on_actionRenameProfile_triggered()
|
||||
RefreshProfiles();
|
||||
}
|
||||
|
||||
if (api) {
|
||||
api->on_event(OBS_FRONTEND_EVENT_PROFILE_LIST_CHANGED);
|
||||
api->on_event(OBS_FRONTEND_EVENT_PROFILE_CHANGED);
|
||||
}
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_PROFILE_RENAMED);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionRemoveProfile_triggered(bool skipConfirmation)
|
||||
|
@ -276,9 +276,6 @@ void OBSBasic::on_actionRenameSceneCollection_triggered()
|
||||
return;
|
||||
}
|
||||
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING);
|
||||
|
||||
oldFile.insert(0, path);
|
||||
oldFile += ".json";
|
||||
os_unlink(oldFile.c_str());
|
||||
@ -293,10 +290,8 @@ void OBSBasic::on_actionRenameSceneCollection_triggered()
|
||||
UpdateTitleBar();
|
||||
RefreshSceneCollections();
|
||||
|
||||
if (api) {
|
||||
api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED);
|
||||
api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGED);
|
||||
}
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_RENAMED);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionRemoveSceneCollection_triggered()
|
||||
|
@ -95,8 +95,11 @@ Structures/Enumerations
|
||||
|
||||
- **OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED**
|
||||
|
||||
Triggered when a scene collection has been
|
||||
added/removed/renamed.
|
||||
Triggered when a scene collection has been added or removed.
|
||||
|
||||
- **OBS_FRONTEND_EVENT_SCENE_COLLECTION_RENAMED**
|
||||
|
||||
Triggered when a scene collection has been renamed.
|
||||
|
||||
- **OBS_FRONTEND_EVENT_PROFILE_CHANGING**
|
||||
|
||||
@ -108,7 +111,11 @@ Structures/Enumerations
|
||||
|
||||
- **OBS_FRONTEND_EVENT_PROFILE_LIST_CHANGED**
|
||||
|
||||
Triggered when a profile has been added/removed/renamed.
|
||||
Triggered when a profile has been added or removed.
|
||||
|
||||
- **OBS_FRONTEND_EVENT_PROFILE_RENAMED**
|
||||
|
||||
Triggered when a profile has been renamed.
|
||||
|
||||
- **OBS_FRONTEND_EVENT_FINISHED_LOADING**
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user