12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #pragma once
- #if !defined(Q_MOC_RUN)
- #include <ProjectInfo.h>
- #include <QThread>
- #endif
- #include "ProjectManagerBuses.h"
- QT_FORWARD_DECLARE_CLASS(QProcess)
- namespace O3DE::ProjectManager
- {
- QT_FORWARD_DECLARE_CLASS(ProjectButton)
- QT_FORWARD_DECLARE_CLASS(ProjectExportWorker)
- class ProjectExportController
- : public QObject
- , public ProjectManagerUtilityRequestsBus::Handler
- {
- Q_OBJECT
- public:
- explicit ProjectExportController(const ProjectInfo& projectInfo, ProjectButton* projectButton, QWidget* parent = nullptr);
- ~ProjectExportController();
- void SetProjectButton(ProjectButton* projectButton);
- const ProjectInfo& GetProjectInfo() const;
- constexpr static int s_maxDisplayedBuiltOutputChars = 25;
- inline static const char* LauncherExportFailedMessage = "Launcher failed to export.";
- public slots:
- void Start();
- void UpdateUIProgress(const QString& lastLine);
- void HandleResults(const QString& result);
- void HandleCancel();
- signals:
- void Done(bool success = true);
- void NotifyExportProject(const ProjectInfo& projectInfo);
- private:
- // ProjectManagerUtilityRequests overrides...
- void CanCloseProjectManager(bool& result) const override;
- private:
- ProjectInfo m_projectInfo;
- ProjectExportWorker* m_worker;
- QThread m_workerThread;
- ProjectButton* m_projectButton;
- QWidget* m_parent;
- QString m_lastLine;
- };
- } // namespace O3DE::ProjectManager
|