1
0
Fork 0
forked from suyu/suyu
suyu/src/yuzu/configuration/configure_hotkeys.h
Lioncash ef3c0f54d0 configure_hotkeys: Move conflict detection logic to IsUsedKey()
We don't need to extract the entire set of hotkeys into a list and then
iterate through it. We can traverse the list and early-exit if we're
able to.
2019-05-25 04:08:13 -04:00

41 lines
981 B
C++

// 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;
void applyConfiguration(HotkeyRegistry& registry);
void retranslateUi();
/**
* 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:
void Configure(QModelIndex index);
bool IsUsedKey(QKeySequence key_sequence) const;
std::unique_ptr<Ui::ConfigureHotkeys> ui;
QStandardItemModel* model;
};