| 679 | } |
| 680 | |
| 681 | void 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 | |
| 700 | void ProjectEditor::registerActiveSchematicTab(SchematicTab* tab) noexcept { |
| 701 | if (!mActiveSchematicTabs.contains(tab)) { |
no test coverage detected