GemRepoScreen.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 <ScreenWidget.h>
  11. #include <AzToolsFramework/UI/Notifications/ToastNotificationsView.h>
  12. #endif
  13. QT_FORWARD_DECLARE_CLASS(QLabel)
  14. QT_FORWARD_DECLARE_CLASS(QPushButton)
  15. QT_FORWARD_DECLARE_CLASS(QHeaderView)
  16. QT_FORWARD_DECLARE_CLASS(QTableWidget)
  17. QT_FORWARD_DECLARE_CLASS(QFrame)
  18. QT_FORWARD_DECLARE_CLASS(QStackedWidget)
  19. QT_FORWARD_DECLARE_CLASS(QSortFilterProxyModel)
  20. QT_FORWARD_DECLARE_CLASS(QItemSelectionModel)
  21. namespace O3DE::ProjectManager
  22. {
  23. QT_FORWARD_DECLARE_CLASS(GemRepoInspector)
  24. QT_FORWARD_DECLARE_CLASS(GemRepoListView)
  25. QT_FORWARD_DECLARE_CLASS(GemRepoModel)
  26. QT_FORWARD_DECLARE_CLASS(GemRepoProxyModel)
  27. QT_FORWARD_DECLARE_CLASS(AdjustableHeaderWidget)
  28. class GemRepoScreen
  29. : public ScreenWidget
  30. {
  31. Q_OBJECT
  32. public:
  33. explicit GemRepoScreen(QWidget* parent = nullptr);
  34. ~GemRepoScreen() = default;
  35. ProjectManagerScreen GetScreenEnum() override;
  36. void Reinit();
  37. GemRepoModel* GetGemRepoModel() const { return m_gemRepoModel; }
  38. void NotifyCurrentScreen() override;
  39. public slots:
  40. void ShowStandardToastNotification(const QString& notification);
  41. void HandleAddRepoButton();
  42. void HandleRemoveRepoButton(const QModelIndex& modelIndex);
  43. void HandleRefreshAllButton();
  44. void HandleRefreshRepoButton(const QModelIndex& modelIndex);
  45. void OnModelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles);
  46. private:
  47. void FillModel();
  48. AZStd::unique_ptr<AzToolsFramework::ToastNotificationsView> m_notificationsView;
  49. QFrame* CreateNoReposContent();
  50. QFrame* CreateReposContent();
  51. QStackedWidget* m_contentStack = nullptr;
  52. QFrame* m_noRepoContent;
  53. QFrame* m_repoContent;
  54. AdjustableHeaderWidget* m_gemRepoHeaderTable = nullptr;
  55. QHeaderView* m_gemRepoListHeader = nullptr;
  56. GemRepoListView* m_gemRepoListView = nullptr;
  57. GemRepoInspector* m_gemRepoInspector = nullptr;
  58. GemRepoModel* m_gemRepoModel = nullptr;
  59. GemRepoProxyModel* m_sortProxyModel = nullptr;
  60. QItemSelectionModel* m_selectionModel = nullptr;
  61. QLabel* m_lastAllUpdateLabel;
  62. };
  63. } // namespace O3DE::ProjectManager