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

Method triggerProject

libs/librepcb/editor/mainwindow.cpp:1080–1112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078}
1079
1080void MainWindow::triggerProject(int index, ui::ProjectAction a) noexcept {
1081 std::shared_ptr<ProjectEditor> editor = mApp.getProjects().value(index);
1082 if (!editor) return;
1083
1084 switch (a) {
1085 case ui::ProjectAction::Close: {
1086 if (editor->requestClose()) {
1087 mApp.closeProject(index);
1088 }
1089 break;
1090 }
1091 case ui::ProjectAction::OpenLibraryManager: {
1092 openProjectLibraryTab(index);
1093 break;
1094 }
1095 case ui::ProjectAction::NewSheet: {
1096 if (auto schEditor = editor->execNewSheetDialog()) {
1097 openSchematicTab(index, schEditor->getUiIndex());
1098 }
1099 break;
1100 }
1101 case ui::ProjectAction::NewBoard: {
1102 if (auto brdEditor = editor->execNewBoardDialog(std::nullopt)) {
1103 openBoard2dTab(index, brdEditor->getUiIndex());
1104 }
1105 break;
1106 }
1107 default: {
1108 editor->trigger(a);
1109 break;
1110 }
1111 }
1112}
1113
1114void MainWindow::triggerSchematic(int project, int schematic,
1115 ui::SchematicAction a) noexcept {

Callers

nothing calls this directly

Calls 7

closeProjectMethod · 0.80
execNewSheetDialogMethod · 0.80
execNewBoardDialogMethod · 0.80
valueMethod · 0.45
requestCloseMethod · 0.45
getUiIndexMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected