mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Add paste source undo/redo actions
This commit is contained in:
parent
1afe092c6e
commit
8bcb2c3d42
|
@ -309,6 +309,8 @@ Undo.MoveUp="Move '%1' up in '%2'"
|
|||
Undo.MoveDown="Move '%1' down in '%2'"
|
||||
Undo.MoveToTop="Move '%1' to top in '%2'"
|
||||
Undo.MoveToBottom="Move '%1' to bottom in '%2'"
|
||||
Undo.PasteSource="Paste Source(s) in '%1'"
|
||||
Undo.PasteSourceRef="Paste Source Reference(s) in '%1'"
|
||||
|
||||
# transition name dialog
|
||||
TransitionNameDlg.Text="Please enter the name of the transition"
|
||||
|
|
|
@ -8385,6 +8385,11 @@ void OBSBasic::on_actionCopySource_triggered()
|
|||
|
||||
void OBSBasic::on_actionPasteRef_triggered()
|
||||
{
|
||||
OBSSource scene_source = GetCurrentSceneSource();
|
||||
OBSData undo_data = BackupScene(scene_source);
|
||||
|
||||
undo_s.push_disabled();
|
||||
|
||||
for (auto ©String : copyStrings) {
|
||||
/* do not allow duplicate refs of the same group in the same scene */
|
||||
OBSScene scene = GetCurrentScene();
|
||||
|
@ -8395,15 +8400,38 @@ void OBSBasic::on_actionPasteRef_triggered()
|
|||
false);
|
||||
on_actionPasteTransform_triggered();
|
||||
}
|
||||
|
||||
undo_s.pop_disabled();
|
||||
|
||||
QString action_name = QTStr("Undo.PasteSourceRef");
|
||||
const char *scene_name = obs_source_get_name(scene_source);
|
||||
|
||||
OBSData redo_data = BackupScene(scene_source);
|
||||
CreateSceneUndoRedoAction(action_name.arg(scene_name), undo_data,
|
||||
redo_data);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionPasteDup_triggered()
|
||||
{
|
||||
OBSSource scene_source = GetCurrentSceneSource();
|
||||
OBSData undo_data = BackupScene(scene_source);
|
||||
|
||||
undo_s.push_disabled();
|
||||
|
||||
for (auto ©String : copyStrings) {
|
||||
OBSBasicSourceSelect::SourcePaste(copyString, copyVisible,
|
||||
true);
|
||||
on_actionPasteTransform_triggered();
|
||||
}
|
||||
|
||||
undo_s.pop_disabled();
|
||||
|
||||
QString action_name = QTStr("Undo.PasteSource");
|
||||
const char *scene_name = obs_source_get_name(scene_source);
|
||||
|
||||
OBSData redo_data = BackupScene(scene_source);
|
||||
CreateSceneUndoRedoAction(action_name.arg(scene_name), undo_data,
|
||||
redo_data);
|
||||
}
|
||||
|
||||
void OBSBasic::AudioMixerCopyFilters()
|
||||
|
|
Loading…
Reference in a new issue