CustomizeKeyboardDialog.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef CRYINCLUDE_EDITOR_CUSTOMIZE_KEYBOARD_DIALOG_H
  9. #define CRYINCLUDE_EDITOR_CUSTOMIZE_KEYBOARD_DIALOG_H
  10. #pragma once
  11. #if !defined(Q_MOC_RUN)
  12. #include <QDialog>
  13. #include "KeyboardCustomizationSettings.h"
  14. #endif
  15. namespace Ui
  16. {
  17. class CustomizeKeyboardDialog;
  18. }
  19. class QAbstractButton;
  20. class NestedQAction;
  21. class MenuActionsModel;
  22. class ActionShortcutsModel;
  23. class CustomizeKeyboardDialog
  24. : public QDialog
  25. {
  26. Q_OBJECT
  27. public:
  28. CustomizeKeyboardDialog(KeyboardCustomizationSettings& settings, QWidget* parent = nullptr);
  29. virtual ~CustomizeKeyboardDialog();
  30. private slots:
  31. void CommandSelectionChanged(const QModelIndex& current, const QModelIndex& previous);
  32. void CategoryChanged(const QString& category);
  33. void DialogButtonClicked(const QAbstractButton* button);
  34. void KeySequenceEditingFinished();
  35. void AssignButtonClicked();
  36. void ShortcutsViewSelectionChanged(const QModelIndex& current, const QModelIndex& previous);
  37. void ShortcutsViewDataChanged();
  38. void ShortcutRemoved();
  39. private:
  40. QScopedPointer<Ui::CustomizeKeyboardDialog> m_ui;
  41. QHash<QString, QVector<NestedQAction> > m_menuActions;
  42. KeyboardCustomizationSettings& m_settings;
  43. const KeyboardCustomizationSettings::Snapshot m_settingsSnapshot;
  44. MenuActionsModel* m_menuActionsModel;
  45. ActionShortcutsModel* m_actionShortcutsModel;
  46. QStringList BuildModels(QWidget* parent);
  47. };
  48. #endif //CRYINCLUDE_EDITOR_CUSTOMIZE_KEYBOARD_DIALOG_H