MCPcopy Create free account
hub / github.com/LibrePCB/LibrePCB / execDeleteBoardDialog

Method execDeleteBoardDialog

libs/librepcb/editor/project/projecteditor.cpp:681–698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681void ProjectEditor::execDeleteBoardDialog(int index) noexcept {
682 Board* board = mProject->getBoardByIndex(index);
683 if (!board) return;
684
685 QMessageBox::StandardButton btn = QMessageBox::question(
686 qApp->activeWindow(), tr("Remove board"),
687 tr("Are you really sure to remove the board \"%1\"?")
688 .arg(*board->getName()));
689 if (btn != QMessageBox::Yes) return;
690
691 emit abortBlockingToolsInOtherEditors(nullptr); // Release undo stack.
692
693 try {
694 mUndoStack->execCmd(new CmdBoardRemove(*board));
695 } catch (const Exception& e) {
696 QMessageBox::critical(qApp->activeWindow(), tr("Error"), e.getMsg());
697 }
698}
699
700void ProjectEditor::registerActiveSchematicTab(SchematicTab* tab) noexcept {
701 if (!mActiveSchematicTabs.contains(tab)) {

Callers 1

triggerBoardMethod · 0.80

Calls 3

getBoardByIndexMethod · 0.80
getNameMethod · 0.45
execCmdMethod · 0.45

Tested by

no test coverage detected