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

Method trigger

libs/librepcb/editor/mainwindow.cpp:801–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799}
800
801void MainWindow::trigger(ui::Action a) noexcept {
802 switch (a) {
803 // General
804 case ui::Action::KeyboardShortcutsReference: {
805 StandardEditorCommandHandler handler(mApp.getWorkspace().getSettings(),
806 mWidget);
807 handler.shortcutsReference();
808 break;
809 }
810 case ui::Action::Quit: {
811 mApp.quit(mWidget);
812 break;
813 }
814
815 // Window
816 case ui::Action::WindowNew: {
817 mApp.createNewWindow();
818 break;
819 }
820 case ui::Action::WindowClose: {
821 closeRequested();
822 break;
823 }
824
825 // Workspace
826 case ui::Action::WorkspaceOpenFolder: {
827 StandardEditorCommandHandler handler(mApp.getWorkspace().getSettings(),
828 mWidget);
829 handler.fileManager(mApp.getWorkspace().getPath());
830 break;
831 }
832 case ui::Action::WorkspaceSwitch: {
833 mApp.switchWorkspace(mWidget);
834 break;
835 }
836 case ui::Action::WorkspaceSettings: {
837 mApp.execWorkspaceSettingsDialog(mWidget);
838 break;
839 }
840 case ui::Action::WorkspaceLibrariesRescan: {
841 mApp.getWorkspace().getLibraryDb().startLibraryRescan();
842 break;
843 }
844 case ui::Action::ProjectImportExamples: {
845 mApp.addExampleProjects(mWidget);
846 break;
847 }
848
849 // Library
850 case ui::Action::LibraryCreate: {
851 if (!switchToTab<CreateLibraryTab>()) {
852 auto tab = std::make_shared<CreateLibraryTab>(mApp);
853 connect(
854 tab.get(), &CreateLibraryTab::libraryCreated, this,
855 [this](const FilePath& fp) { openLibraryTab(fp, true); },
856 Qt::QueuedConnection);
857 addTab(tab);
858 }

Callers 1

triggerProjectMethod · 0.45

Calls 15

getSettingsMethod · 0.80
shortcutsReferenceMethod · 0.80
quitMethod · 0.80
createNewWindowMethod · 0.80
fileManagerMethod · 0.80
getPathMethod · 0.80
switchWorkspaceMethod · 0.80
startLibraryRescanMethod · 0.80
addExampleProjectsMethod · 0.80
ensurePopulatedMethod · 0.80
checkForUpdatesMethod · 0.80

Tested by

no test coverage detected