UI: Disallow pasting duplicates of sources with DO_NOT_DUPLICATE

This commit prevents users from being able to use the "Paste
(Duplicate)" context menu option after copying a source that has the
OBS_SOURCE_DO_NOT_DUPLICATE flag set. Though OBS would correctly paste
the source as a reference, it seems that this behavior was confusing
some users. This fixes Mantis Bug 1034.
This commit is contained in:
Ryan Foster 2017-10-14 01:49:37 -04:00
parent a76b919c6e
commit 0fe4688a34

View file

@ -5757,7 +5757,12 @@ void OBSBasic::on_actionCopySource_triggered()
copyVisible = obs_sceneitem_visible(item);
ui->actionPasteRef->setEnabled(true);
ui->actionPasteDup->setEnabled(true);
uint32_t output_flags = obs_source_get_output_flags(source);
if ((output_flags & OBS_SOURCE_DO_NOT_DUPLICATE) == 0)
ui->actionPasteDup->setEnabled(true);
else
ui->actionPasteDup->setEnabled(false);
}
void OBSBasic::on_actionPasteRef_triggered()