| 217 | } |
| 218 | |
| 219 | void ShortcutDialog::assignAction(const QString& actionId) |
| 220 | { |
| 221 | Qt::Key key = m_keyboardMap->selectedKey(); |
| 222 | if (key == Qt::Key_unknown) return; |
| 223 | |
| 224 | QKeySequence seq(key); |
| 225 | |
| 226 | if (actionId.isEmpty()) { |
| 227 | // Clearing: find what action is on this key and clear it |
| 228 | const auto* act = m_mgr->actionForKey(seq); |
| 229 | if (act) |
| 230 | m_mgr->clearBinding(act->id); |
| 231 | } else { |
| 232 | // Check for conflict |
| 233 | QString conflict = m_mgr->conflictCheck(seq, actionId); |
| 234 | if (!conflict.isEmpty()) { |
| 235 | auto r = QMessageBox::question(this, "Key Conflict", |
| 236 | QString("Key [%1] is currently bound to '%2'.\nReassign it?") |
| 237 | .arg(seq.toString(), conflict)); |
| 238 | if (r != QMessageBox::Yes) return; |
| 239 | } |
| 240 | m_mgr->setBinding(actionId, seq); |
| 241 | } |
| 242 | |
| 243 | populateTable(m_filterEdit->text(), m_categoryFilter->currentText()); |
| 244 | updateSelectedKeyInfo(); |
| 245 | } |
| 246 | |
| 247 | void ShortcutDialog::clearSelected() |
| 248 | { |
nothing calls this directly
no test coverage detected