configure_hotkeys.h 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2017 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include <QWidget>
  7. namespace Ui {
  8. class ConfigureHotkeys;
  9. }
  10. class HotkeyRegistry;
  11. class QStandardItemModel;
  12. class ConfigureHotkeys : public QWidget {
  13. Q_OBJECT
  14. public:
  15. explicit ConfigureHotkeys(QWidget* parent = nullptr);
  16. ~ConfigureHotkeys() override;
  17. void ApplyConfiguration(HotkeyRegistry& registry);
  18. void RetranslateUI();
  19. /**
  20. * Populates the hotkey list widget using data from the provided registry.
  21. * Called everytime the Configure dialog is opened.
  22. * @param registry The HotkeyRegistry whose data is used to populate the list.
  23. */
  24. void Populate(const HotkeyRegistry& registry);
  25. private:
  26. void Configure(QModelIndex index);
  27. bool IsUsedKey(QKeySequence key_sequence) const;
  28. std::unique_ptr<Ui::ConfigureHotkeys> ui;
  29. QStandardItemModel* model;
  30. };