2019-02-16 15:19:29 +00:00
|
|
|
// Copyright 2017 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ConfigureHotkeys;
|
|
|
|
}
|
|
|
|
|
|
|
|
class HotkeyRegistry;
|
|
|
|
class QStandardItemModel;
|
|
|
|
|
|
|
|
class ConfigureHotkeys : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ConfigureHotkeys(QWidget* parent = nullptr);
|
|
|
|
~ConfigureHotkeys() override;
|
|
|
|
|
2019-05-26 04:39:23 +00:00
|
|
|
void ApplyConfiguration(HotkeyRegistry& registry);
|
2019-02-16 15:19:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Populates the hotkey list widget using data from the provided registry.
|
|
|
|
* Called everytime the Configure dialog is opened.
|
|
|
|
* @param registry The HotkeyRegistry whose data is used to populate the list.
|
|
|
|
*/
|
|
|
|
void Populate(const HotkeyRegistry& registry);
|
|
|
|
|
|
|
|
private:
|
2019-06-05 22:39:46 +00:00
|
|
|
void changeEvent(QEvent* event) override;
|
|
|
|
void RetranslateUI();
|
|
|
|
|
2019-02-16 15:19:29 +00:00
|
|
|
void Configure(QModelIndex index);
|
2019-04-09 23:35:52 +00:00
|
|
|
bool IsUsedKey(QKeySequence key_sequence) const;
|
2019-02-16 15:19:29 +00:00
|
|
|
|
|
|
|
std::unique_ptr<Ui::ConfigureHotkeys> ui;
|
|
|
|
|
|
|
|
QStandardItemModel* model;
|
|
|
|
};
|