Access gem repos from catalog non-destructively

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
This commit is contained in:
Alex Peterson
2021-10-29 12:05:42 -07:00
parent 4ccbb964f3
commit 781eaabd94
5 changed files with 54 additions and 23 deletions
@@ -13,6 +13,7 @@
#include <ScreenHeaderWidget.h>
#include <GemCatalog/GemModel.h>
#include <GemCatalog/GemCatalogScreen.h>
#include <GemRepo/GemRepoScreen.h>
#include <ProjectUtils.h>
#include <QDialogButtonBox>
@@ -47,8 +48,12 @@ namespace O3DE::ProjectManager
m_gemCatalogScreen = new GemCatalogScreen(this);
m_stack->addWidget(m_gemCatalogScreen);
m_gemRepoScreen = new GemRepoScreen(this);
m_stack->addWidget(m_gemRepoScreen);
vLayout->addWidget(m_stack);
connect(m_gemCatalogScreen, &ScreenWidget::ChangeScreenRequest, this, &CreateProjectCtrl::OnChangeScreenRequest);
// When there are multiple project templates present, we re-gather the gems when changing the selected the project template.
@@ -89,6 +94,9 @@ namespace O3DE::ProjectManager
buttons->setObjectName("footer");
vLayout->addWidget(buttons);
m_primaryButton = buttons->addButton(tr("Create Project"), QDialogButtonBox::ApplyRole);
connect(m_primaryButton, &QPushButton::clicked, this, &CreateProjectCtrl::HandlePrimaryButton);
#ifdef TEMPLATE_GEM_CONFIGURATION_ENABLED
connect(m_newProjectSettingsScreen, &ScreenWidget::ChangeScreenRequest, this, &CreateProjectCtrl::OnChangeScreenRequest);
@@ -100,8 +108,6 @@ namespace O3DE::ProjectManager
Update();
#endif // TEMPLATE_GEM_CONFIGURATION_ENABLED
m_primaryButton = buttons->addButton(tr("Create Project"), QDialogButtonBox::ApplyRole);
connect(m_primaryButton, &QPushButton::clicked, this, &CreateProjectCtrl::HandlePrimaryButton);
setLayout(vLayout);
}
@@ -160,12 +166,21 @@ namespace O3DE::ProjectManager
{
m_header->setSubTitle(tr("Configure project with Gems"));
m_secondaryButton->setVisible(false);
m_primaryButton->setVisible(true);
}
else if (m_stack->currentWidget() == m_gemRepoScreen)
{
m_header->setSubTitle(tr("Gem Repositories"));
m_secondaryButton->setVisible(true);
m_secondaryButton->setText(tr("Back"));
m_primaryButton->setVisible(false);
}
else
{
m_header->setSubTitle(tr("Enter Project Details"));
m_secondaryButton->setVisible(true);
m_secondaryButton->setText(tr("Configure Gems"));
m_primaryButton->setVisible(true);
}
}
@@ -175,6 +190,10 @@ namespace O3DE::ProjectManager
{
HandleSecondaryButton();
}
else if (screen == ProjectManagerScreen::GemRepos)
{
NextScreen();
}
else
{
emit ChangeScreenRequest(screen);