MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / assignAction

Method assignAction

src/gui/ShortcutDialog.cpp:219–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void 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
247void ShortcutDialog::clearSelected()
248{

Callers

nothing calls this directly

Calls 8

selectedKeyMethod · 0.80
actionForKeyMethod · 0.80
clearBindingMethod · 0.80
conflictCheckMethod · 0.80
setBindingMethod · 0.80
isEmptyMethod · 0.45
toStringMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected