Configure gems option added to projects button to go directly to gem catalog

Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
nggieber
2021-11-16 13:22:52 -08:00
parent 1aae84537d
commit df36067ef3
8 changed files with 39 additions and 11 deletions
@@ -72,12 +72,7 @@ namespace O3DE::ProjectManager
bool EngineScreenCtrl::ContainsScreen(ProjectManagerScreen screen)
{
if (screen == m_engineSettingsScreen->GetScreenEnum() || screen == m_gemRepoScreen->GetScreenEnum())
{
return true;
}
return false;
return screen == m_engineSettingsScreen->GetScreenEnum() || screen == m_gemRepoScreen->GetScreenEnum();
}
void EngineScreenCtrl::NotifyCurrentScreen()
@@ -203,6 +203,7 @@ namespace O3DE::ProjectManager
QMenu* menu = new QMenu(this);
menu->addAction(tr("Edit Project Settings..."), this, [this]() { emit EditProject(m_projectInfo.m_path); });
menu->addAction(tr("Configure Gems..."), this, [this]() { emit EditProjectGems(m_projectInfo.m_path); });
menu->addAction(tr("Build"), this, [this]() { emit BuildProject(m_projectInfo); });
menu->addAction(tr("Open CMake GUI..."), this, [this]() { emit OpenCMakeGUI(m_projectInfo); });
menu->addSeparator();
@@ -95,6 +95,7 @@ namespace O3DE::ProjectManager
signals:
void OpenProject(const QString& projectName);
void EditProject(const QString& projectName);
void EditProjectGems(const QString& projectName);
void CopyProject(const ProjectInfo& projectInfo);
void RemoveProject(const QString& projectName);
void DeleteProject(const QString& projectName);
@@ -181,6 +181,7 @@ namespace O3DE::ProjectManager
connect(projectButton, &ProjectButton::OpenProject, this, &ProjectsScreen::HandleOpenProject);
connect(projectButton, &ProjectButton::EditProject, this, &ProjectsScreen::HandleEditProject);
connect(projectButton, &ProjectButton::EditProjectGems, this, &ProjectsScreen::HandleEditProjectGems);
connect(projectButton, &ProjectButton::CopyProject, this, &ProjectsScreen::HandleCopyProject);
connect(projectButton, &ProjectButton::RemoveProject, this, &ProjectsScreen::HandleRemoveProject);
connect(projectButton, &ProjectButton::DeleteProject, this, &ProjectsScreen::HandleDeleteProject);
@@ -448,6 +449,14 @@ namespace O3DE::ProjectManager
emit ChangeScreenRequest(ProjectManagerScreen::UpdateProject);
}
}
void ProjectsScreen::HandleEditProjectGems(const QString& projectPath)
{
if (!WarnIfInBuildQueue(projectPath))
{
emit NotifyCurrentProject(projectPath);
emit ChangeScreenRequest(ProjectManagerScreen::GemCatalog);
}
}
void ProjectsScreen::HandleCopyProject(const ProjectInfo& projectInfo)
{
if (!WarnIfInBuildQueue(projectInfo.m_path))
@@ -46,6 +46,7 @@ namespace O3DE::ProjectManager
void HandleAddProjectButton();
void HandleOpenProject(const QString& projectPath);
void HandleEditProject(const QString& projectPath);
void HandleEditProjectGems(const QString& projectPath);
void HandleCopyProject(const ProjectInfo& projectInfo);
void HandleRemoveProject(const QString& projectPath);
void HandleDeleteProject(const QString& projectPath);
@@ -47,9 +47,9 @@ namespace O3DE::ProjectManager
return tr("Missing");
}
virtual bool ContainsScreen([[maybe_unused]] ProjectManagerScreen screen)
virtual bool ContainsScreen(ProjectManagerScreen screen)
{
return false;
return GetScreenEnum() == screen;
}
virtual void GoToScreen([[maybe_unused]] ProjectManagerScreen screen)
{
@@ -58,7 +58,6 @@ namespace O3DE::ProjectManager
//! Notify this screen it is the current screen
virtual void NotifyCurrentScreen()
{
}
signals:
@@ -94,6 +94,16 @@ namespace O3DE::ProjectManager
return ProjectManagerScreen::UpdateProject;
}
bool UpdateProjectCtrl::ContainsScreen(ProjectManagerScreen screen)
{
return screen == GetScreenEnum() || screen == ProjectManagerScreen::GemCatalog;
}
void UpdateProjectCtrl::GoToScreen(ProjectManagerScreen screen)
{
OnChangeScreenRequest(screen);
}
// Called when pressing "Edit Project Settings..."
void UpdateProjectCtrl::NotifyCurrentScreen()
{
@@ -114,6 +124,16 @@ namespace O3DE::ProjectManager
m_stack->setCurrentWidget(m_gemRepoScreen);
Update();
}
else if (screen == ProjectManagerScreen::GemCatalog)
{
m_stack->setCurrentWidget(m_gemCatalogScreen);
Update();
}
else if (screen == ProjectManagerScreen::UpdateProjectSettings)
{
m_stack->setCurrentWidget(m_updateSettingsScreen);
Update();
}
else
{
emit ChangeScreenRequest(screen);
@@ -24,7 +24,8 @@ namespace O3DE::ProjectManager
QT_FORWARD_DECLARE_CLASS(GemCatalogScreen)
QT_FORWARD_DECLARE_CLASS(GemRepoScreen)
class UpdateProjectCtrl : public ScreenWidget
class UpdateProjectCtrl
: public ScreenWidget
{
Q_OBJECT
public:
@@ -32,7 +33,8 @@ namespace O3DE::ProjectManager
~UpdateProjectCtrl() = default;
ProjectManagerScreen GetScreenEnum() override;
protected:
bool ContainsScreen(ProjectManagerScreen screen) override;
void GoToScreen(ProjectManagerScreen screen) override;
void NotifyCurrentScreen() override;
protected slots: