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

Method onEditCustomCommand

widgets/QuickRefactorDialog.cpp:499–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497}
498
499void 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
528void QuickRefactorDialog::onDeleteCustomCommand()
529{

Callers

nothing calls this directly

Calls 3

getInstructionMethod · 0.80
saveInstructionMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected