EditorPreferencesPageAWS.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "Include/IPreferencesPage.h"
  10. #include <AzCore/RTTI/RTTIMacros.h>
  11. #include <QIcon>
  12. namespace AZ
  13. {
  14. class SerializeContext;
  15. class SettingsRegistryImpl;
  16. }
  17. class CEditorPreferencesPage_AWS
  18. : public IPreferencesPage
  19. {
  20. public:
  21. AZ_RTTI(CEditorPreferencesPage_AWS, "{51FB9557-ABA3-4FD7-803A-1784F5B06F5F}", IPreferencesPage)
  22. static void Reflect(AZ::SerializeContext& serialize);
  23. CEditorPreferencesPage_AWS();
  24. virtual ~CEditorPreferencesPage_AWS();
  25. // IPreferencesPage interface methods.
  26. virtual const char* GetCategory() override { return "AWS"; }
  27. virtual const char* GetTitle() override;
  28. virtual QIcon& GetIcon() override;
  29. virtual void OnApply() override;
  30. virtual void OnCancel() override {}
  31. virtual bool OnQueryCancel() override { return true; }
  32. protected:
  33. struct UsageOptions
  34. {
  35. AZ_TYPE_INFO(UsageOptions, "{2B7D9B19-D13B-4E54-B724-B2FD8D0828B3}")
  36. bool m_awsAttributionEnabled;
  37. };
  38. const UsageOptions& GetUsageOptions();
  39. private:
  40. void InitializeSettings();
  41. void SaveSettingsRegistryFile();
  42. UsageOptions m_usageOptions;
  43. QIcon m_icon;
  44. AZStd::unique_ptr<AZ::SettingsRegistryImpl> m_settingsRegistry;
  45. static constexpr char AWSAttributionEnabledKey[] = "/Amazon/AWS/Preferences/AWSAttributionEnabled";
  46. static constexpr char EditorPreferencesFileName[] = "editorpreferences.setreg";
  47. static constexpr char EditorAWSPreferencesFileName[] = "editor_aws_preferences.setreg";
  48. static constexpr char AWSAttributionSettingsPrefixKey[] = "/Amazon/AWS/Preferences";
  49. };