| 497 | } |
| 498 | |
| 499 | void QuickRefactorDialog::onEditCustomCommand() |
| 500 | { |
| 501 | CustomInstruction instruction = findCurrentInstruction(); |
| 502 | |
| 503 | if (instruction.id.isEmpty()) { |
| 504 | QMessageBox::information( |
| 505 | this, |
| 506 | Tr::tr("No Instruction Selected"), |
| 507 | Tr::tr("Please select an instruction to edit.")); |
| 508 | return; |
| 509 | } |
| 510 | |
| 511 | AddCustomInstructionDialog dialog(instruction, this); |
| 512 | if (dialog.exec() == QDialog::Accepted) { |
| 513 | CustomInstruction updatedInstruction = dialog.getInstruction(); |
| 514 | auto &manager = CustomInstructionsManager::instance(); |
| 515 | |
| 516 | if (manager.saveInstruction(updatedInstruction)) { |
| 517 | loadCustomCommands(); |
| 518 | m_commandsComboBox->setCurrentText(updatedInstruction.name); |
| 519 | } else { |
| 520 | QMessageBox::warning( |
| 521 | this, |
| 522 | Tr::tr("Error"), |
| 523 | Tr::tr("Failed to update custom instruction. Check logs for details.")); |
| 524 | } |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | void QuickRefactorDialog::onDeleteCustomCommand() |
| 529 | { |
nothing calls this directly
no test coverage detected