UpdateProjectCtrl.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <ProjectInfo.h>
  11. #include <ScreenWidget.h>
  12. #include <GemCatalog/GemInfo.h>
  13. #endif
  14. QT_FORWARD_DECLARE_CLASS(QStackedWidget)
  15. QT_FORWARD_DECLARE_CLASS(QTabWidget)
  16. QT_FORWARD_DECLARE_CLASS(QPushButton)
  17. QT_FORWARD_DECLARE_CLASS(QFrame)
  18. namespace O3DE::ProjectManager
  19. {
  20. QT_FORWARD_DECLARE_CLASS(ScreenHeader)
  21. QT_FORWARD_DECLARE_CLASS(UpdateProjectSettingsScreen)
  22. QT_FORWARD_DECLARE_CLASS(ProjectGemCatalogScreen)
  23. QT_FORWARD_DECLARE_CLASS(GemRepoScreen)
  24. QT_FORWARD_DECLARE_CLASS(DownloadController)
  25. QT_FORWARD_DECLARE_CLASS(CreateGem)
  26. class UpdateProjectCtrl
  27. : public ScreenWidget
  28. {
  29. Q_OBJECT
  30. public:
  31. explicit UpdateProjectCtrl(DownloadController* downloadController, QWidget* parent = nullptr);
  32. ~UpdateProjectCtrl() = default;
  33. ProjectManagerScreen GetScreenEnum() override;
  34. bool ContainsScreen(ProjectManagerScreen screen) override;
  35. void GoToScreen(ProjectManagerScreen screen) override;
  36. void NotifyCurrentScreen() override;
  37. protected slots:
  38. void HandleBackButton();
  39. void HandleNextButton();
  40. void HandleGemsButton();
  41. void OnChangeScreenRequest(ProjectManagerScreen screen);
  42. void UpdateCurrentProject(const QString& projectPath);
  43. private:
  44. void Update();
  45. void UpdateSettingsScreen();
  46. bool UpdateProjectSettings(bool shouldConfirm = false);
  47. enum ScreenOrder
  48. {
  49. Settings,
  50. Gems,
  51. GemRepos
  52. };
  53. ScreenHeader* m_header = nullptr;
  54. QStackedWidget* m_stack = nullptr;
  55. UpdateProjectSettingsScreen* m_updateSettingsScreen = nullptr;
  56. ProjectGemCatalogScreen* m_projectGemCatalogScreen = nullptr;
  57. GemRepoScreen* m_gemRepoScreen = nullptr;
  58. QPushButton* m_backButton = nullptr;
  59. QPushButton* m_nextButton = nullptr;
  60. QVector<ProjectManagerScreen> m_screensOrder;
  61. ProjectInfo m_projectInfo;
  62. };
  63. } // namespace O3DE::ProjectManager