Prism/fix create project bugs (#7539)

* Don't show ${Name} gems and fix template names

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>

* Fix overlay size so it doesn't overlap parent border

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>

* Hide warning when building

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>

* Fix gem download fail due to param type change

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>

* Restore missing functionionality for gem repos

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>

* Use the parent's width for the gem inspector

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>

* Restore regressed code for gem repos and folders

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>

* Revert home folder override

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
This commit is contained in:
Alex Peterson
2022-02-11 12:23:10 -08:00
committed by GitHub
parent 235613710f
commit 2a3c2b67cc
10 changed files with 109 additions and 122 deletions
@@ -81,7 +81,7 @@ namespace O3DE::ProjectManager
m_rightPanelStack = new QStackedWidget(this);
m_rightPanelStack->setFixedWidth(sidePanelWidth);
m_gemInspector = new GemInspector(m_gemModel, this);
m_gemInspector = new GemInspector(m_gemModel, m_rightPanelStack);
connect(m_gemInspector, &GemInspector::TagClicked, [=](const Tag& tag) { SelectGem(tag.id); });
connect(m_gemInspector, &GemInspector::UpdateGem, this, &GemCatalogScreen::UpdateGem);
@@ -233,7 +233,12 @@ namespace O3DE::ProjectManager
const QVector<GemInfo>& gemInfos = allGemInfosResult.GetValue();
for (const GemInfo& gemInfo : gemInfos)
{
gemInfoHash.insert(gemInfo.m_name, gemInfo);
// ${Name} is a special name used for templates and should be ignored
// eventually we should handle this in Python instead of here
if (gemInfo.m_name != "${Name}")
{
gemInfoHash.insert(gemInfo.m_name, gemInfo);
}
}
}
@@ -503,7 +508,10 @@ namespace O3DE::ProjectManager
const QVector<GemInfo>& allGemInfos = allGemInfosResult.GetValue();
for (const GemInfo& gemInfo : allGemInfos)
{
m_gemModel->AddGem(gemInfo);
if (gemInfo.m_name != "${Name}")
{
m_gemModel->AddGem(gemInfo);
}
}
const AZ::Outcome<QVector<GemInfo>, AZStd::string>& allRepoGemInfosResult = PythonBindingsInterface::Get()->GetGemInfosForAllRepos();
@@ -30,6 +30,10 @@ namespace O3DE::ProjectManager
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
m_mainWidget = new QWidget();
if (parent)
{
m_mainWidget->setFixedWidth(parent->width());
}
setWidget(m_mainWidget);
m_mainLayout = new QVBoxLayout();
@@ -207,6 +207,7 @@ namespace O3DE::ProjectManager
{
m_templateDisplayName = new QLabel(this);
m_templateDisplayName->setObjectName("displayName");
m_templateDisplayName->setWordWrap(true);
templateDetailsLayout->addWidget(m_templateDisplayName);
m_templateSummary = new QLabel(this);
@@ -330,6 +330,11 @@ namespace O3DE::ProjectManager
void ProjectButton::ShowWarning(bool show, const QString& warning)
{
if (show)
{
// hide any overlay text, we cannot show the warning and an overlay at the same time
m_projectImageLabel->GetOverlayLabel()->setVisible(false);
}
m_projectImageLabel->GetWarningLabel()->setTextInteractionFlags(Qt::LinksAccessibleByMouse);
m_projectImageLabel->GetWarningLabel()->setText(warning);
m_projectImageLabel->GetWarningLabel()->setVisible(show);
@@ -362,6 +367,9 @@ namespace O3DE::ProjectManager
m_projectImageLabel->SetOverlayText(tr("Building...\n\n"));
m_projectMenuButton->setVisible(false);
// hide the warning label about this project needing to be built while building
ShowWarning(false, "");
QProgressBar* progressBar = m_projectImageLabel->GetProgressBar();
progressBar->setVisible(true);
progressBar->setValue(0);
@@ -38,6 +38,7 @@ namespace O3DE::ProjectManager
QLabel* label = new QLabel(labelText, this);
label->setObjectName("templateLabel");
label->setWordWrap(true);
vLayout->addWidget(label);
connect(this, &QAbstractButton::toggled, this, &TemplateButton::onToggled);