EditorPreferencesDialog.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 <QDialog>
  10. #include <QScopedPointer>
  11. #include <QPixmap>
  12. #include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
  13. namespace Ui
  14. {
  15. class EditorPreferencesDialog;
  16. }
  17. class EditorPreferencesTreeWidgetItem;
  18. bool WidgetConsumesKeyPressEvent(QKeyEvent* event);
  19. class EditorPreferencesDialog
  20. : public QDialog
  21. , public AzToolsFramework::IPropertyEditorNotify
  22. {
  23. public:
  24. EditorPreferencesDialog(QWidget* pParent = nullptr);
  25. ~EditorPreferencesDialog();
  26. // IPropertyEditorNotify
  27. void BeforePropertyModified([[maybe_unused]] AzToolsFramework::InstanceDataNode* node) override {}
  28. void AfterPropertyModified(AzToolsFramework::InstanceDataNode* node) override;
  29. void SetPropertyEditingActive([[maybe_unused]] AzToolsFramework::InstanceDataNode* node) override {}
  30. void SetPropertyEditingComplete([[maybe_unused]] AzToolsFramework::InstanceDataNode* node) override {}
  31. void SealUndoStack() override {}
  32. void SetFilterText(const QString& filter);
  33. protected:
  34. void showEvent(QShowEvent* event) override;
  35. void keyPressEvent(QKeyEvent* event) override;
  36. private:
  37. void CreateImages();
  38. void CreatePages();
  39. void SetActivePage(EditorPreferencesTreeWidgetItem* pageItem);
  40. void SetFilter(const QString& filter);
  41. void OnTreeCurrentItemChanged();
  42. void OnReject();
  43. void OnAccept();
  44. void OnManage();
  45. struct SAutoBackup
  46. {
  47. AZ_TYPE_INFO(SAutoBackup, "{547A0B74-B513-4A74-A27B-28256BE730E7}")
  48. SAutoBackup()
  49. : bEnabled(false)
  50. , nTime(0)
  51. , nRemindTime(0) { }
  52. bool bEnabled;
  53. int nTime;
  54. int nRemindTime;
  55. };
  56. SAutoBackup origAutoBackup;
  57. QScopedPointer<Ui::EditorPreferencesDialog> ui;
  58. QPixmap m_selectedPixmap;
  59. QPixmap m_unSelectedPixmap;
  60. EditorPreferencesTreeWidgetItem* m_currentPageItem;
  61. QString m_filter;
  62. };