MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / onDeleteCustomCommand

Method onDeleteCustomCommand

widgets/QuickRefactorDialog.cpp:528–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528void 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
561void QuickRefactorDialog::onOpenInstructionsFolder()
562{

Callers

nothing calls this directly

Calls 3

deleteInstructionMethod · 0.80
setCurrentIndexMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected