UpdateProjectSettingsScreen.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 <ProjectSettingsScreen.h>
  11. #endif
  12. QT_FORWARD_DECLARE_CLASS(QLabel)
  13. QT_FORWARD_DECLARE_CLASS(QPushButton)
  14. namespace O3DE::ProjectManager
  15. {
  16. QT_FORWARD_DECLARE_CLASS(FormComboBoxWidget)
  17. class UpdateProjectSettingsScreen
  18. : public ProjectSettingsScreen
  19. {
  20. public:
  21. explicit UpdateProjectSettingsScreen(QWidget* parent = nullptr);
  22. ~UpdateProjectSettingsScreen() = default;
  23. ProjectManagerScreen GetScreenEnum() override;
  24. ProjectInfo GetProjectInfo() override;
  25. void SetProjectInfo(const ProjectInfo& projectInfo);
  26. AZ::Outcome<void, QString> Validate() const override;
  27. void ResetProjectPreviewPath();
  28. public slots:
  29. void UpdateProjectPreviewPath();
  30. void PreviewPathChanged();
  31. void OnProjectIdUpdated();
  32. void OnProjectEngineUpdated(int index);
  33. protected:
  34. bool ValidateProjectPath() const override;
  35. virtual bool ValidateProjectPreview() const;
  36. bool ValidateProjectId() const;
  37. inline constexpr static int s_collapseButtonSize = 24;
  38. FormComboBoxWidget* m_projectEngine;
  39. FormBrowseEditWidget* m_projectPreview;
  40. QLabel* m_projectPreviewImage;
  41. FormLineEditWidget* m_projectId;
  42. QPushButton* m_advancedSettingsCollapseButton = nullptr;
  43. QWidget* m_advancedSettingWidget = nullptr;
  44. ProjectInfo m_projectInfo;
  45. bool m_userChangedPreview; //! Did the user change the project preview path
  46. protected slots:
  47. void UpdateAdvancedSettingsCollapseState();
  48. };
  49. } // namespace O3DE::ProjectManager