Merge branch 'stabilization/2106' into LYN-4507
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include <ProjectButtonWidget.h>
|
||||
#include <PythonBindingsInterface.h>
|
||||
#include <ProjectUtils.h>
|
||||
#include <ProjectBuilder.h>
|
||||
#include <ProjectBuilderController.h>
|
||||
#include <ScreensCtrl.h>
|
||||
|
||||
#include <AzQtComponents/Components/FlowLayout.h>
|
||||
@@ -43,8 +43,6 @@
|
||||
#include <QDir>
|
||||
#include <QGuiApplication>
|
||||
|
||||
//#define DISPLAY_PROJECT_DEV_DATA true
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
ProjectsScreen::ProjectsScreen(QWidget* parent)
|
||||
@@ -86,7 +84,7 @@ namespace O3DE::ProjectManager
|
||||
layout->setAlignment(Qt::AlignTop);
|
||||
frame->setLayout(layout);
|
||||
|
||||
QLabel* titleLabel = new QLabel(tr("Ready. Set. Create."), this);
|
||||
QLabel* titleLabel = new QLabel(tr("Ready? Set. Create!"), this);
|
||||
titleLabel->setObjectName("titleLabel");
|
||||
layout->addWidget(titleLabel);
|
||||
|
||||
@@ -166,43 +164,38 @@ namespace O3DE::ProjectManager
|
||||
projectsScrollArea->setWidget(scrollWidget);
|
||||
projectsScrollArea->setWidgetResizable(true);
|
||||
|
||||
#ifndef DISPLAY_PROJECT_DEV_DATA
|
||||
// Iterate once to insert building project first
|
||||
if (!buildProjectPath.isEmpty())
|
||||
QVector<ProjectInfo> nonProcessingProjects;
|
||||
buildProjectPath = QDir::fromNativeSeparators(buildProjectPath);
|
||||
for (auto& project : projectsResult.GetValue())
|
||||
{
|
||||
buildProjectPath = QDir::fromNativeSeparators(buildProjectPath);
|
||||
for (auto project : projectsResult.GetValue())
|
||||
if (projectButton && !*projectButton)
|
||||
{
|
||||
if (QDir::fromNativeSeparators(project.m_path) == buildProjectPath)
|
||||
{
|
||||
ProjectButton* buildingProjectButton = CreateProjectButton(project, flowLayout, true);
|
||||
|
||||
if (projectButton)
|
||||
{
|
||||
*projectButton = buildingProjectButton;
|
||||
}
|
||||
|
||||
break;
|
||||
*projectButton = CreateProjectButton(project, flowLayout, true);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
nonProcessingProjects.append(project);
|
||||
}
|
||||
|
||||
for (auto project : projectsResult.GetValue())
|
||||
#else
|
||||
ProjectInfo project = projectsResult.GetValue().at(0);
|
||||
for (int i = 0; i < 15; i++)
|
||||
#endif
|
||||
for (auto& project : nonProcessingProjects)
|
||||
{
|
||||
// Add all other projects skipping building project
|
||||
// Safe if no building project because it is just an empty string
|
||||
if (project.m_path != buildProjectPath)
|
||||
{
|
||||
ProjectButton* projectButtonWidget = CreateProjectButton(project, flowLayout);
|
||||
ProjectButton* projectButtonWidget = CreateProjectButton(project, flowLayout);
|
||||
|
||||
if (RequiresBuildProjectIterator(project.m_path) != m_requiresBuild.end())
|
||||
{
|
||||
projectButtonWidget->ShowBuildButton(true);
|
||||
}
|
||||
if (BuildQueueContainsProject(project.m_path))
|
||||
{
|
||||
projectButtonWidget->SetProjectButtonAction(tr("Cancel Queued Build"),
|
||||
[this, project]
|
||||
{
|
||||
UnqueueBuildProject(project);
|
||||
SuggestBuildProjectMsg(project, false);
|
||||
});
|
||||
}
|
||||
else if (RequiresBuildProjectIterator(project.m_path) != m_requiresBuild.end())
|
||||
{
|
||||
projectButtonWidget->SetProjectBuildButtonAction();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,9 +237,9 @@ namespace O3DE::ProjectManager
|
||||
// Make sure to update builder with latest Project Button
|
||||
if (m_currentBuilder)
|
||||
{
|
||||
ProjectButton* projectButtonPtr;
|
||||
ProjectButton* projectButtonPtr = nullptr;
|
||||
|
||||
m_projectsContent = CreateProjectsContent(m_currentBuilder->GetProjectPath(), &projectButtonPtr);
|
||||
m_projectsContent = CreateProjectsContent(m_currentBuilder->GetProjectInfo().m_path, &projectButtonPtr);
|
||||
m_currentBuilder->SetProjectButton(projectButtonPtr);
|
||||
}
|
||||
else
|
||||
@@ -414,17 +407,15 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectsScreen::SuggestBuildProject(const ProjectInfo& projectInfo)
|
||||
void ProjectsScreen::SuggestBuildProjectMsg(const ProjectInfo& projectInfo, bool showMessage)
|
||||
{
|
||||
if (projectInfo.m_needsBuild)
|
||||
if (RequiresBuildProjectIterator(projectInfo.m_path) == m_requiresBuild.end())
|
||||
{
|
||||
if (RequiresBuildProjectIterator(projectInfo.m_path) == m_requiresBuild.end())
|
||||
{
|
||||
m_requiresBuild.append(projectInfo);
|
||||
}
|
||||
ResetProjectsContent();
|
||||
m_requiresBuild.append(projectInfo);
|
||||
}
|
||||
else
|
||||
ResetProjectsContent();
|
||||
|
||||
if (showMessage)
|
||||
{
|
||||
QMessageBox::information(this,
|
||||
tr("Project Should be rebuilt."),
|
||||
@@ -432,6 +423,11 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectsScreen::SuggestBuildProject(const ProjectInfo& projectInfo)
|
||||
{
|
||||
SuggestBuildProjectMsg(projectInfo, true);
|
||||
}
|
||||
|
||||
void ProjectsScreen::QueueBuildProject(const ProjectInfo& projectInfo)
|
||||
{
|
||||
auto requiredIter = RequiresBuildProjectIterator(projectInfo.m_path);
|
||||
@@ -445,14 +441,22 @@ namespace O3DE::ProjectManager
|
||||
if (m_buildQueue.empty() && !m_currentBuilder)
|
||||
{
|
||||
StartProjectBuild(projectInfo);
|
||||
// Projects Content is already reset in fuction
|
||||
}
|
||||
else
|
||||
{
|
||||
m_buildQueue.append(projectInfo);
|
||||
ResetProjectsContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectsScreen::UnqueueBuildProject(const ProjectInfo& projectInfo)
|
||||
{
|
||||
m_buildQueue.removeAll(projectInfo);
|
||||
ResetProjectsContent();
|
||||
}
|
||||
|
||||
void ProjectsScreen::NotifyCurrentScreen()
|
||||
{
|
||||
if (ShouldDisplayFirstTimeContent())
|
||||
@@ -488,7 +492,7 @@ namespace O3DE::ProjectManager
|
||||
return PythonBindingsInterface::Get()->RemoveInvalidProjects();
|
||||
}
|
||||
|
||||
void ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo)
|
||||
bool ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo)
|
||||
{
|
||||
if (ProjectUtils::IsVS2019Installed())
|
||||
{
|
||||
@@ -508,25 +512,42 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
else
|
||||
{
|
||||
ProjectBuildDone();
|
||||
SuggestBuildProjectMsg(projectInfo, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ProjectsScreen::ProjectBuildDone()
|
||||
void ProjectsScreen::ProjectBuildDone(bool success)
|
||||
{
|
||||
ProjectInfo currentBuilderProject;
|
||||
if (!success)
|
||||
{
|
||||
currentBuilderProject = m_currentBuilder->GetProjectInfo();
|
||||
}
|
||||
|
||||
delete m_currentBuilder;
|
||||
m_currentBuilder = nullptr;
|
||||
|
||||
if (!success)
|
||||
{
|
||||
SuggestBuildProjectMsg(currentBuilderProject, false);
|
||||
}
|
||||
|
||||
if (!m_buildQueue.empty())
|
||||
{
|
||||
StartProjectBuild(m_buildQueue.front());
|
||||
while (!StartProjectBuild(m_buildQueue.front()) && m_buildQueue.size() > 1)
|
||||
{
|
||||
m_buildQueue.pop_front();
|
||||
}
|
||||
m_buildQueue.pop_front();
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetProjectsContent();
|
||||
}
|
||||
|
||||
ResetProjectsContent();
|
||||
}
|
||||
|
||||
QList<ProjectInfo>::iterator ProjectsScreen::RequiresBuildProjectIterator(const QString& projectPath)
|
||||
|
||||
Reference in New Issue
Block a user