Prism Show Gem Requirements and Prompt when Adding Gems with Requirements (#1478)

* Added requirements section to gem inspector

* Added Dialog when configuring for gems with extra requirements
This commit is contained in:
AMZN-nggieber
2021-06-22 19:44:33 -07:00
committed by GitHub
parent 570696ad76
commit bc3aa45ed9
25 changed files with 545 additions and 12 deletions
@@ -14,6 +14,7 @@
#include <PythonBindingsInterface.h>
#include <GemCatalog/GemListHeaderWidget.h>
#include <GemCatalog/GemSortFilterProxyModel.h>
#include <GemCatalog/GemRequirementDialog.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
@@ -144,12 +145,23 @@ namespace O3DE::ProjectManager
}
}
void GemCatalogScreen::EnableDisableGemsForProject(const QString& projectPath)
bool GemCatalogScreen::EnableDisableGemsForProject(const QString& projectPath)
{
IPythonBindings* pythonBindings = PythonBindingsInterface::Get();
QVector<QModelIndex> toBeAdded = m_gemModel->GatherGemsToBeAdded();
QVector<QModelIndex> toBeRemoved = m_gemModel->GatherGemsToBeRemoved();
if (m_gemModel->DoGemsToBeAddedHaveRequirements())
{
GemRequirementDialog* confirmRequirementsDialog = new GemRequirementDialog(m_gemModel, toBeAdded, this);
confirmRequirementsDialog->exec();
if (confirmRequirementsDialog->GetButtonResult() != QDialogButtonBox::ApplyRole)
{
return false;
}
}
for (const QModelIndex& modelIndex : toBeAdded)
{
const QString gemPath = GemModel::GetPath(modelIndex);
@@ -158,6 +170,8 @@ namespace O3DE::ProjectManager
{
QMessageBox::critical(nullptr, "Operation failed",
QString("Cannot add gem %1 to project.\n\nError:\n%2").arg(GemModel::GetName(modelIndex), result.GetError().c_str()));
return false;
}
}
@@ -169,8 +183,12 @@ namespace O3DE::ProjectManager
{
QMessageBox::critical(nullptr, "Operation failed",
QString("Cannot remove gem %1 from project.\n\nError:\n%2").arg(GemModel::GetName(modelIndex), result.GetError().c_str()));
return false;
}
}
return true;
}
ProjectManagerScreen GemCatalogScreen::GetScreenEnum()