Make sure Cancel
does not reset the hotkey.
This commit is contained in:
parent
d17864ea22
commit
d8f5f9b291
@ -152,8 +152,9 @@ void MainWindow::on_hotkeys_doubleClicked(const QModelIndex &) {
|
|||||||
if (ui->hotkeys->selectedItems().length() == 1) {
|
if (ui->hotkeys->selectedItems().length() == 1) {
|
||||||
QListWidgetItem *i = ui->hotkeys->selectedItems().at(0);
|
QListWidgetItem *i = ui->hotkeys->selectedItems().at(0);
|
||||||
QString str = i->data(Qt::UserRole + 1).toString();
|
QString str = i->data(Qt::UserRole + 1).toString();
|
||||||
|
bool ok;
|
||||||
QString seq = QInputDialog::getText(ui->centralWidget, "Hotkey Input", "Insert hotkey:", QLineEdit::Normal,
|
QString seq = QInputDialog::getText(ui->centralWidget, "Hotkey Input", "Insert hotkey:", QLineEdit::Normal,
|
||||||
hotkeying::sequence(str));
|
hotkeying::sequence(str), &ok);
|
||||||
if (hotkeying::valid(seq)) hotkeying::hotkey(str, QKeySequence(seq), *fncs.value(str));
|
if (ok && hotkeying::valid(seq)) hotkeying::hotkey(str, QKeySequence(seq), *fncs.value(str));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user