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_SCENE_COLLECTION_CHANGING,
|
||||||
OBS_FRONTEND_EVENT_PROFILE_CHANGING,
|
OBS_FRONTEND_EVENT_PROFILE_CHANGING,
|
||||||
OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN,
|
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()
|
void OBSBasic::on_actionRenameProfile_triggered()
|
||||||
{
|
{
|
||||||
if (api)
|
|
||||||
api->on_event(OBS_FRONTEND_EVENT_PROFILE_CHANGING);
|
|
||||||
|
|
||||||
std::string curDir =
|
std::string curDir =
|
||||||
config_get_string(App()->GlobalConfig(), "Basic", "ProfileDir");
|
config_get_string(App()->GlobalConfig(), "Basic", "ProfileDir");
|
||||||
std::string curName =
|
std::string curName =
|
||||||
@ -534,10 +531,8 @@ void OBSBasic::on_actionRenameProfile_triggered()
|
|||||||
RefreshProfiles();
|
RefreshProfiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (api) {
|
if (api)
|
||||||
api->on_event(OBS_FRONTEND_EVENT_PROFILE_LIST_CHANGED);
|
api->on_event(OBS_FRONTEND_EVENT_PROFILE_RENAMED);
|
||||||
api->on_event(OBS_FRONTEND_EVENT_PROFILE_CHANGED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasic::on_actionRemoveProfile_triggered(bool skipConfirmation)
|
void OBSBasic::on_actionRemoveProfile_triggered(bool skipConfirmation)
|
||||||
|
@ -276,9 +276,6 @@ void OBSBasic::on_actionRenameSceneCollection_triggered()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (api)
|
|
||||||
api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING);
|
|
||||||
|
|
||||||
oldFile.insert(0, path);
|
oldFile.insert(0, path);
|
||||||
oldFile += ".json";
|
oldFile += ".json";
|
||||||
os_unlink(oldFile.c_str());
|
os_unlink(oldFile.c_str());
|
||||||
@ -293,10 +290,8 @@ void OBSBasic::on_actionRenameSceneCollection_triggered()
|
|||||||
UpdateTitleBar();
|
UpdateTitleBar();
|
||||||
RefreshSceneCollections();
|
RefreshSceneCollections();
|
||||||
|
|
||||||
if (api) {
|
if (api)
|
||||||
api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED);
|
api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_RENAMED);
|
||||||
api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasic::on_actionRemoveSceneCollection_triggered()
|
void OBSBasic::on_actionRemoveSceneCollection_triggered()
|
||||||
|
@ -95,8 +95,11 @@ Structures/Enumerations
|
|||||||
|
|
||||||
- **OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED**
|
- **OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED**
|
||||||
|
|
||||||
Triggered when a scene collection has been
|
Triggered when a scene collection has been added or removed.
|
||||||
added/removed/renamed.
|
|
||||||
|
- **OBS_FRONTEND_EVENT_SCENE_COLLECTION_RENAMED**
|
||||||
|
|
||||||
|
Triggered when a scene collection has been renamed.
|
||||||
|
|
||||||
- **OBS_FRONTEND_EVENT_PROFILE_CHANGING**
|
- **OBS_FRONTEND_EVENT_PROFILE_CHANGING**
|
||||||
|
|
||||||
@ -108,7 +111,11 @@ Structures/Enumerations
|
|||||||
|
|
||||||
- **OBS_FRONTEND_EVENT_PROFILE_LIST_CHANGED**
|
- **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**
|
- **OBS_FRONTEND_EVENT_FINISHED_LOADING**
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user