UI: Disable screenshot action if item has no video

This disables the source screenshot action in the context menu
if the source has no video.
This commit is contained in:
cg2121 2023-01-21 15:45:55 -06:00 • committed by Georges Basile Stavracas Neto
commit d08ede33cd

View file

@ -5689,8 +5689,12 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview)
popup.addMenu(sourceProjector);
popup.addAction(QTStr("SourceWindow"), this,
SLOT(OpenSourceWindow()));
popup.addAction(QTStr("Screenshot.Source"), this,
SLOT(ScreenshotSelectedSource()));
QAction *screenshotAction =
popup.addAction(QTStr("Screenshot.Source"), this,
SLOT(ScreenshotSelectedSource()));
screenshotAction->setEnabled(flags & OBS_SOURCE_VIDEO);
popup.addSeparator();
if (flags & OBS_SOURCE_INTERACTION)