| 225 | } |
| 226 | |
| 227 | void InputWindow::slotAssign() |
| 228 | { |
| 229 | /* Get the table of the selected items */ |
| 230 | QTableWidget *selTable = nullptr; |
| 231 | int tab = 0; |
| 232 | |
| 233 | if (hotkeyTable->selectionModel()->hasSelection()) |
| 234 | selTable = hotkeyTable; |
| 235 | else { |
| 236 | for (int i=0; i<KeyMapping::INPUTLIST_SIZE; i++) { |
| 237 | if (inputTable[i]->selectionModel()->hasSelection()) { |
| 238 | selTable = inputTable[i]; |
| 239 | tab = i; |
| 240 | break; |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | if (!selTable) |
| 245 | return; |
| 246 | |
| 247 | int row = selTable->row(selTable->selectedItems().first()); |
| 248 | |
| 249 | keyDialog->withModifiers = (selTable == hotkeyTable); |
| 250 | keysym_t ks = keyDialog->exec(); |
| 251 | |
| 252 | if (ks != 0) { |
| 253 | if (selTable == hotkeyTable) { |
| 254 | context->config.km->reassign_hotkey(row, ks); |
| 255 | } |
| 256 | else { |
| 257 | context->config.km->reassign_input(tab, row, ks); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | update(); |
| 262 | } |
| 263 | |
| 264 | void InputWindow::slotDefault() |
| 265 | { |
nothing calls this directly
no test coverage detected