| 1112 | } |
| 1113 | |
| 1114 | void MainWindow::triggerSchematic(int project, int schematic, |
| 1115 | ui::SchematicAction a) noexcept { |
| 1116 | std::shared_ptr<ProjectEditor> prjEditor = mApp.getProjects().value(project); |
| 1117 | if (!prjEditor) return; |
| 1118 | |
| 1119 | switch (a) { |
| 1120 | case ui::SchematicAction::Open: { |
| 1121 | openSchematicTab(project, schematic); |
| 1122 | break; |
| 1123 | } |
| 1124 | case ui::SchematicAction::Rename: { |
| 1125 | prjEditor->execRenameSheetDialog(schematic); |
| 1126 | break; |
| 1127 | } |
| 1128 | case ui::SchematicAction::Delete: { |
| 1129 | prjEditor->execDeleteSheetDialog(schematic); |
| 1130 | break; |
| 1131 | } |
| 1132 | default: { |
| 1133 | qWarning() << "Unhandled action in MainWindow::triggerSchematic():" |
| 1134 | << static_cast<int>(a); |
| 1135 | break; |
| 1136 | } |
| 1137 | } |
| 1138 | } |
| 1139 | |
| 1140 | void MainWindow::triggerBoard(int project, int board, |
| 1141 | ui::BoardAction a) noexcept { |