Remove deleted projects from project manager

Signed-off-by: pconroy <pconroy@amazon.com>
This commit is contained in:
pconroy
2021-06-25 17:39:27 -07:00
parent 6a0b8ae6b6
commit e0c3d15d5a
6 changed files with 51 additions and 23 deletions
@@ -119,6 +119,8 @@ namespace O3DE::ProjectManager
QFrame* ProjectsScreen::CreateProjectsContent(QString buildProjectPath, ProjectButton** projectButton)
{
RemoveInvalidProjects();
QFrame* frame = new QFrame(this);
frame->setObjectName("projectsContent");
{
@@ -481,6 +483,11 @@ namespace O3DE::ProjectManager
return displayFirstTimeContent;
}
void ProjectsScreen::RemoveInvalidProjects()
{
PythonBindingsInterface::Get()->RemoveInvalidProjects();
}
void ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo)
{
if (ProjectUtils::IsVS2019Installed())
@@ -59,6 +59,7 @@ namespace O3DE::ProjectManager
ProjectButton* CreateProjectButton(ProjectInfo& project, QLayout* flowLayout, bool processing = false);
void ResetProjectsContent();
bool ShouldDisplayFirstTimeContent();
void RemoveInvalidProjects();
void StartProjectBuild(const ProjectInfo& projectInfo);
QList<ProjectInfo>::iterator RequiresBuildProjectIterator(const QString& projectPath);
@@ -755,6 +755,15 @@ namespace O3DE::ProjectManager
});
}
void PythonBindings::RemoveInvalidProjects()
{
ExecuteWithLockErrorHandling(
[&]
{
m_register.attr("remove_invalid_o3de_projects")();
});
}
AZ::Outcome<void, AZStd::string> PythonBindings::UpdateProject(const ProjectInfo& projectInfo)
{
bool updateProjectSucceeded = false;
@@ -50,6 +50,7 @@ namespace O3DE::ProjectManager
AZ::Outcome<void, AZStd::string> UpdateProject(const ProjectInfo& projectInfo) override;
AZ::Outcome<void, AZStd::string> AddGemToProject(const QString& gemPath, const QString& projectPath) override;
AZ::Outcome<void, AZStd::string> RemoveGemFromProject(const QString& gemPath, const QString& projectPath) override;
void RemoveInvalidProjects() override;
// ProjectTemplate
AZ::Outcome<QVector<ProjectTemplateInfo>> GetProjectTemplates(const QString& projectPath = {}) override;
@@ -141,6 +141,11 @@ namespace O3DE::ProjectManager
*/
virtual AZ::Outcome<void, AZStd::string> RemoveGemFromProject(const QString& gemPath, const QString& projectPath) = 0;
/**
* Removes invalid projects from the manifest
*/
virtual void RemoveInvalidProjects() = 0;
// Project Templates