| 283 | } |
| 284 | |
| 285 | void ServerConfigDialog::editAction() |
| 286 | { |
| 287 | int hotkeyRow = ui->listHotkeys->currentRow(); |
| 288 | if (hotkeyRow < 0 || hotkeyRow >= serverConfig().hotkeys().size()) { |
| 289 | qDebug() << "Attempt to edit action from out of bounds hotkey row: " << hotkeyRow; |
| 290 | return; |
| 291 | } |
| 292 | Hotkey &hotkey = serverConfig().hotkeys()[hotkeyRow]; |
| 293 | |
| 294 | int actionRow = ui->listActions->currentRow(); |
| 295 | if (actionRow < 0 || actionRow >= hotkey.actions().size()) { |
| 296 | qDebug() << "Attempt to remove out of bounds action row: " << actionRow; |
| 297 | return; |
| 298 | } |
| 299 | Action &action = hotkey.actions()[actionRow]; |
| 300 | |
| 301 | ActionDialog dlg(this, serverConfig(), hotkey, action); |
| 302 | if (dlg.exec() == QDialog::Accepted) { |
| 303 | ui->listActions->currentItem()->setText(action.text()); |
| 304 | onChange(); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | void ServerConfigDialog::removeAction() |
| 309 | { |