Merge pull request #1180 from OsirisNL/fix_sources_context_menu

UI: Fix grayed out Copy option in sources context menu
This commit is contained in:
Jim 2018-02-06 05:01:34 -08:00 committed by GitHub
commit b2d9c4f4e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -182,10 +182,7 @@
<addaction name="actionScaleCanvas"/>
<addaction name="actionScaleOutput"/>
</widget>
<action name="actionCopySource">
<property name="enabled">
<bool>false</bool>
</property>
<action name="actionCopySource">
<property name="text">
<string>Copy</string>
</property>

View File

@ -2858,8 +2858,6 @@ void OBSBasic::SceneItemSelected(void *data, calldata_t *params)
QMetaObject::invokeMethod(window, "SelectSceneItem",
Q_ARG(OBSScene, scene), Q_ARG(OBSSceneItem, item),
Q_ARG(bool, true));
window->ui->actionCopySource->setEnabled(true);
}
void OBSBasic::SceneItemDeselected(void *data, calldata_t *params)
@ -2873,7 +2871,6 @@ void OBSBasic::SceneItemDeselected(void *data, calldata_t *params)
Q_ARG(OBSScene, scene), Q_ARG(OBSSceneItem, item),
Q_ARG(bool, false));
window->ui->actionCopySource->setEnabled(false);
}
void OBSBasic::SourceLoaded(void *data, obs_source_t *source)
@ -3891,6 +3888,7 @@ void OBSBasic::CreateSourcePopupMenu(QListWidgetItem *item, bool preview)
popup.addMenu(addSourceMenu);
ui->actionCopyFilters->setEnabled(false);
ui->actionCopySource->setEnabled(false);
popup.addSeparator();
popup.addAction(ui->actionCopySource);
@ -3969,6 +3967,7 @@ void OBSBasic::CreateSourcePopupMenu(QListWidgetItem *item, bool preview)
SLOT(on_actionSourceProperties_triggered()));
ui->actionCopyFilters->setEnabled(true);
ui->actionCopySource->setEnabled(true);
}
popup.exec(QCursor::pos());