Added Menu to Gem Catalog with Action to Navigate to Gem Repo Screen (#4829)

* Added menu to Gem Catalog that with option to navigate to Gem Repo screen

Signed-off-by: nggieber <nggieber@amazon.com>

* Changed Goto to GoTo and added a tr

Signed-off-by: nggieber <nggieber@amazon.com>

* Gem repo button works from new project creation workflow as well and users are warned if they have pending changes in the gem catalog before changing screens.

Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
AMZN-nggieber
2021-10-22 04:11:32 -07:00
committed by GitHub
parent 63140dc247
commit 54b9ed2737
12 changed files with 151 additions and 16 deletions
@@ -38,6 +38,8 @@ namespace O3DE::ProjectManager
m_headerWidget = new GemCatalogHeaderWidget(m_gemModel, m_proxModel, m_downloadController);
vLayout->addWidget(m_headerWidget);
connect(m_headerWidget, &GemCatalogHeaderWidget::OpenGemsRepo, this, &GemCatalogScreen::HandleOpenGemRepo);
QHBoxLayout* hLayout = new QHBoxLayout();
hLayout->setMargin(0);
vLayout->addLayout(hLayout);
@@ -194,6 +196,27 @@ namespace O3DE::ProjectManager
return EnableDisableGemsResult::Success;
}
void GemCatalogScreen::HandleOpenGemRepo()
{
QVector<QModelIndex> gemsToBeAdded = m_gemModel->GatherGemsToBeAdded(true);
QVector<QModelIndex> gemsToBeRemoved = m_gemModel->GatherGemsToBeRemoved(true);
if (!gemsToBeAdded.empty() || !gemsToBeRemoved.empty())
{
QMessageBox::StandardButton warningResult = QMessageBox::warning(
nullptr, "Pending Changes",
"There are some unsaved changes to the gem selection,<br> they will be lost if you change screens.<br> Are you sure?",
QMessageBox::No | QMessageBox::Yes);
if (warningResult != QMessageBox::Yes)
{
return;
}
}
emit ChangeScreenRequest(ProjectManagerScreen::GemRepos);
}
ProjectManagerScreen GemCatalogScreen::GetScreenEnum()
{
return ProjectManagerScreen::GemCatalog;