| 526 | } |
| 527 | |
| 528 | void QuickRefactorDialog::onDeleteCustomCommand() |
| 529 | { |
| 530 | CustomInstruction instruction = findCurrentInstruction(); |
| 531 | |
| 532 | if (instruction.id.isEmpty()) { |
| 533 | QMessageBox::information( |
| 534 | this, |
| 535 | Tr::tr("No Instruction Selected"), |
| 536 | Tr::tr("Please select an instruction to delete.")); |
| 537 | return; |
| 538 | } |
| 539 | |
| 540 | QMessageBox::StandardButton reply = QMessageBox::question( |
| 541 | this, |
| 542 | Tr::tr("Confirm Deletion"), |
| 543 | Tr::tr("Are you sure you want to delete the instruction '%1'?").arg(instruction.name), |
| 544 | QMessageBox::Yes | QMessageBox::No); |
| 545 | |
| 546 | if (reply == QMessageBox::Yes) { |
| 547 | auto &manager = CustomInstructionsManager::instance(); |
| 548 | if (manager.deleteInstruction(instruction.id)) { |
| 549 | loadCustomCommands(); |
| 550 | m_commandsComboBox->setCurrentIndex(0); |
| 551 | m_commandsComboBox->clearEditText(); |
| 552 | } else { |
| 553 | QMessageBox::warning( |
| 554 | this, |
| 555 | Tr::tr("Error"), |
| 556 | Tr::tr("Failed to delete custom instruction. Check logs for details.")); |
| 557 | } |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | void QuickRefactorDialog::onOpenInstructionsFolder() |
| 562 | { |
nothing calls this directly
no test coverage detected