Ver código fonte

Now we skip the dialog box for remote projects if they are set to auto-build, but currently other build routes should be unaffected

Signed-off-by: T.J. Kotha <[email protected]>
T.J. Kotha 2 anos atrás
pai
commit
11ef91d480

+ 1 - 1
Code/Tools/ProjectManager/Source/ProjectButtonWidget.h

@@ -140,7 +140,7 @@ namespace O3DE::ProjectManager
         void CopyProject(const ProjectInfo& projectInfo);
         void RemoveProject(const QString& projectName);
         void DeleteProject(const QString& projectName);
-        void BuildProject(const ProjectInfo& projectInfo);
+        void BuildProject(const ProjectInfo& projectInfo, bool skipDialogBox = false);
         void OpenCMakeGUI(const ProjectInfo& projectInfo);
 
     private:

+ 16 - 10
Code/Tools/ProjectManager/Source/ProjectsScreen.cpp

@@ -645,7 +645,7 @@ namespace O3DE::ProjectManager
         SuggestBuildProjectMsg(projectInfo, true);
     }
 
-    void ProjectsScreen::QueueBuildProject(const ProjectInfo& projectInfo)
+    void ProjectsScreen::QueueBuildProject(const ProjectInfo& projectInfo, bool skipDialogBox)
     {
         auto requiredIter = RequiresBuildProjectIterator(projectInfo.m_path);
         if (requiredIter != m_requiresBuild.end())
@@ -657,7 +657,7 @@ namespace O3DE::ProjectManager
         {
             if (m_buildQueue.empty() && !m_currentBuilder)
             {
-                StartProjectBuild(projectInfo);
+                StartProjectBuild(projectInfo, skipDialogBox);
                 // Projects Content is already reset in function
             }
             else
@@ -717,7 +717,7 @@ namespace O3DE::ProjectManager
 
                             if ((*foundButton).second->GetState() == ProjectButtonState::DownloadingBuildQueued)
                             {
-                                QueueBuildProject(projectInfo);
+                                QueueBuildProject(projectInfo, true);
                             }
                             else
                             {
@@ -865,17 +865,23 @@ namespace O3DE::ProjectManager
         return displayFirstTimeContent;
     }
 
-    bool ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo)
+    bool ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo, bool skipDialogBox)
     {
         if (ProjectUtils::FindSupportedCompiler(this))
         {
-            QMessageBox::StandardButton buildProject = QMessageBox::information(
-                this,
-                tr("Building \"%1\"").arg(projectInfo.GetProjectDisplayName()),
-                tr("Ready to build \"%1\"?").arg(projectInfo.GetProjectDisplayName()),
-                QMessageBox::No | QMessageBox::Yes);
+            bool proceedToBuild = skipDialogBox;
+            if (!proceedToBuild)
+            {
+                QMessageBox::StandardButton buildProject = QMessageBox::information(
+                    this,
+                    tr("Building \"%1\"").arg(projectInfo.GetProjectDisplayName()),
+                    tr("Ready to build \"%1\"?").arg(projectInfo.GetProjectDisplayName()),
+                    QMessageBox::No | QMessageBox::Yes);
 
-            if (buildProject == QMessageBox::Yes)
+                proceedToBuild = buildProject == QMessageBox::Yes;
+            }
+            
+            if (proceedToBuild)
             {
                 m_currentBuilder = new ProjectBuilderController(projectInfo, nullptr, this);
                 UpdateWithProjects(GetAllProjects());

+ 2 - 2
Code/Tools/ProjectManager/Source/ProjectsScreen.h

@@ -61,7 +61,7 @@ namespace O3DE::ProjectManager
         void HandleDeleteProject(const QString& projectPath);
 
         void SuggestBuildProject(const ProjectInfo& projectInfo);
-        void QueueBuildProject(const ProjectInfo& projectInfo);
+        void QueueBuildProject(const ProjectInfo& projectInfo, bool skipDialogBox = false);
         void UnqueueBuildProject(const ProjectInfo& projectInfo);
 
         void StartProjectDownload(const QString& projectName, const QString& destinationPath, bool queueBuild);
@@ -84,7 +84,7 @@ namespace O3DE::ProjectManager
         bool ShouldDisplayFirstTimeContent(bool projectsFound);
         void RemoveProjectButtonsFromFlowLayout(const QVector<ProjectInfo>& projectsToKeep);
 
-        bool StartProjectBuild(const ProjectInfo& projectInfo);
+        bool StartProjectBuild(const ProjectInfo& projectInfo, bool skipDialogBox = false);
         QList<ProjectInfo>::iterator RequiresBuildProjectIterator(const QString& projectPath);
         bool BuildQueueContainsProject(const QString& projectPath);
         bool WarnIfInBuildQueue(const QString& projectPath);