Make sure Cancel does not reset the hotkey.

This commit is contained in:
ArsenArsen 2017-05-13 18:50:54 +02:00
parent d17864ea22
commit d8f5f9b291

View File

@ -152,8 +152,9 @@ void MainWindow::on_hotkeys_doubleClicked(const QModelIndex &) {
if (ui->hotkeys->selectedItems().length() == 1) {
QListWidgetItem *i = ui->hotkeys->selectedItems().at(0);
QString str = i->data(Qt::UserRole + 1).toString();
bool ok;
QString seq = QInputDialog::getText(ui->centralWidget, "Hotkey Input", "Insert hotkey:", QLineEdit::Normal,
hotkeying::sequence(str));
if (hotkeying::valid(seq)) hotkeying::hotkey(str, QKeySequence(seq), *fncs.value(str));
hotkeying::sequence(str), &ok);
if (ok && hotkeying::valid(seq)) hotkeying::hotkey(str, QKeySequence(seq), *fncs.value(str));
}
}