Merge pull request #4783 from FearlessTobi/port-2517
Port yuzu-emu/yuzu#2517: "configure_hotkeys: Minor cleanup"
This commit is contained in:
commit
56fc61a41f
@ -87,8 +87,8 @@ void ConfigureHotkeys::Configure(QModelIndex index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsUsedKey(key_sequence) && key_sequence != QKeySequence(previous_key.toString())) {
|
if (IsUsedKey(key_sequence) && key_sequence != QKeySequence(previous_key.toString())) {
|
||||||
QMessageBox::critical(this, tr("Error in inputted key"),
|
QMessageBox::warning(this, tr("Conflicting Key Sequence"),
|
||||||
tr("You're using a key that's already bound."));
|
tr("The entered key sequence is already assigned to another hotkey."));
|
||||||
} else {
|
} else {
|
||||||
model->setData(index, key_sequence.toString(QKeySequence::NativeText));
|
model->setData(index, key_sequence.toString(QKeySequence::NativeText));
|
||||||
EmitHotkeysChanged();
|
EmitHotkeysChanged();
|
||||||
@ -118,7 +118,6 @@ void ConfigureHotkeys::applyConfiguration(HotkeyRegistry& registry) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registry.SaveHotkeys();
|
registry.SaveHotkeys();
|
||||||
Settings::Apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureHotkeys::retranslateUi() {
|
void ConfigureHotkeys::retranslateUi() {
|
||||||
|
@ -9,16 +9,19 @@
|
|||||||
|
|
||||||
SequenceDialog::SequenceDialog(QWidget* parent) : QDialog(parent) {
|
SequenceDialog::SequenceDialog(QWidget* parent) : QDialog(parent) {
|
||||||
setWindowTitle(tr("Enter a hotkey"));
|
setWindowTitle(tr("Enter a hotkey"));
|
||||||
auto* layout = new QVBoxLayout(this);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
key_sequence = new QKeySequenceEdit;
|
key_sequence = new QKeySequenceEdit;
|
||||||
layout->addWidget(key_sequence);
|
|
||||||
auto* buttons =
|
auto* const buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
|
|
||||||
buttons->setCenterButtons(true);
|
buttons->setCenterButtons(true);
|
||||||
|
|
||||||
|
auto* const layout = new QVBoxLayout(this);
|
||||||
|
layout->addWidget(key_sequence);
|
||||||
layout->addWidget(buttons);
|
layout->addWidget(buttons);
|
||||||
|
|
||||||
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SequenceDialog::~SequenceDialog() = default;
|
SequenceDialog::~SequenceDialog() = default;
|
||||||
|
Loading…
Reference in New Issue
Block a user