MainStatusBarItems.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #include <MainStatusBar.h>
  10. #include <IRenderer.h>
  11. #include <QMutex>
  12. #include <QString>
  13. #include <QSet>
  14. #include <AzToolsFramework/SourceControl/SourceControlAPI.h>
  15. class GeneralStatusItem
  16. : public StatusBarItem
  17. {
  18. Q_OBJECT
  19. public:
  20. GeneralStatusItem(QString name, MainStatusBar* parent);
  21. protected:
  22. QString CurrentText() const override;
  23. };
  24. class SourceControlItem
  25. : public StatusBarItem
  26. , private AzToolsFramework::SourceControlNotificationBus::Handler
  27. {
  28. Q_OBJECT
  29. public:
  30. SourceControlItem(QString name, MainStatusBar* parent);
  31. ~SourceControlItem();
  32. void ConnectivityStateChanged(const AzToolsFramework::SourceControlState state) override;
  33. private:
  34. void InitMenu();
  35. void UpdateMenuItems();
  36. void SetSourceControlEnabledState(bool state);
  37. void UpdateAndShowMenu();
  38. private Q_SLOTS:
  39. void OnOpenSettings();
  40. private:
  41. std::unique_ptr<QMenu> m_menu;
  42. QAction* m_settingsAction;
  43. QWidgetAction* m_enableAction;
  44. QCheckBox* m_checkBox;
  45. QIcon m_scIconOk;
  46. QIcon m_scIconError;
  47. QIcon m_scIconWarning;
  48. QIcon m_scIconDisabled;
  49. bool m_sourceControlAvailable;
  50. AzToolsFramework::SourceControlState m_SourceControlState;
  51. };
  52. class MemoryStatusItem
  53. : public StatusBarItem
  54. {
  55. Q_OBJECT
  56. public:
  57. MemoryStatusItem(QString name, MainStatusBar* parent);
  58. ~MemoryStatusItem();
  59. private:
  60. void updateStatus();
  61. };
  62. class GameInfoItem
  63. : public StatusBarItem
  64. {
  65. Q_OBJECT
  66. public:
  67. GameInfoItem(QString name, MainStatusBar* parent);
  68. private Q_SLOTS:
  69. void OnShowContextMenu(const QPoint& pos);
  70. private:
  71. QString m_projectPath;
  72. };