LibrePCB Developers Documentation
Loading...
Searching...
No Matches
editorcommandset.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_EDITOR_EDITORCOMMANDSET_H
21#define LIBREPCB_EDITOR_EDITORCOMMANDSET_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "editorcommand.h"
28
29#include <QtCore>
30#include <QtWidgets>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36namespace editor {
37
38/*******************************************************************************
39 * Class EditorCommandSet
40 ******************************************************************************/
41
49class EditorCommandSet final {
50 Q_DECLARE_TR_FUNCTIONS(EditorCommandSet)
51
52private:
53 EditorCommandCategory categoryRoot{"categoryRoot", "", false};
54
55 EditorCommandSet() noexcept {}
56 ~EditorCommandSet() noexcept {}
57
58public:
59 // General Methods
60 static EditorCommandSet& instance() noexcept {
61 static EditorCommandSet obj;
62 return obj;
63 }
64 void updateTranslations() noexcept {
65 // Required to be called when the application's locale has changed.
66 foreach (EditorCommandCategory* cat, getCategories()) {
67 cat->updateTranslations();
68 foreach (EditorCommand* cmd, getCommands(cat)) {
69 cmd->updateTranslations();
70 }
71 }
72 }
73 QList<EditorCommandCategory*> getCategories() noexcept {
74 return categoryRoot.findChildren<EditorCommandCategory*>();
75 }
76 QList<EditorCommand*> getCommands(
77 const EditorCommandCategory* category) noexcept {
78 Q_ASSERT(category);
79 return category->findChildren<EditorCommand*>();
80 }
81
82 EditorCommandCategory categoryEditor{"categoryEditor", QT_TR_NOOP("Editor"),
83 true, &categoryRoot};
85 "item_new", // clang-format break
86 QT_TR_NOOP("New"),
87 QT_TR_NOOP("Add a new item"),
88 ":/img/actions/new.png",
90 {QKeySequence(Qt::CTRL | Qt::Key_N)},
92 };
94 "item_open", // clang-format break
95 QT_TR_NOOP("Open"),
96 QT_TR_NOOP("Open the selected item(s)"),
97 ":/img/actions/open.png",
98 EditorCommand::Flags(),
99 {QKeySequence(Qt::Key_Return)},
101 };
103 "save", // clang-format break
104 QT_TR_NOOP("Save"),
105 QT_TR_NOOP("Save changes to filesystem"),
106 ":/img/actions/save.png",
107 EditorCommand::Flags(),
108 {QKeySequence(Qt::CTRL | Qt::Key_S)},
110 };
112 "save_all", // clang-format break
113 QT_TR_NOOP("Save All"),
114 QT_TR_NOOP("Save all elements to filesystem"),
115 QString(),
116 EditorCommand::Flags(),
117 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_S)},
119 };
121 "select_all", // clang-format break
122 QT_TR_NOOP("Select All"),
123 QT_TR_NOOP("Select all visible objects"),
124 ":/img/actions/select_all.png",
125 EditorCommand::Flags(),
126 {QKeySequence(Qt::CTRL | Qt::Key_A)},
128 };
130 "find", // clang-format break
131 QT_TR_NOOP("Find"),
132 QT_TR_NOOP("Find or filter objects"),
133 ":/img/actions/search.png",
135 {QKeySequence(Qt::CTRL | Qt::Key_F)},
137 };
139 "find_next", // clang-format break
140 QT_TR_NOOP("Find Next"),
141 QT_TR_NOOP("Go to the next found object"),
142 QString(),
143 EditorCommand::Flags(),
144 {QKeySequence(Qt::Key_F3)},
146 };
148 "find_previous", // clang-format break
149 QT_TR_NOOP("Find Previous"),
150 QT_TR_NOOP("Go to the previous found object"),
151 QString(),
152 EditorCommand::Flags(),
153 {QKeySequence(Qt::SHIFT | Qt::Key_F3)},
155 };
157 "file_manager", // clang-format break
158 QT_TR_NOOP("Show in File Manager"),
159 QT_TR_NOOP("Open the directory in the file manager"),
160 ":/img/places/folder.png",
161 EditorCommand::Flags(),
162 {},
164 };
166 "control_panel", // clang-format break
167 QT_TR_NOOP("Control Panel"),
168 QT_TR_NOOP("Bring the control panel window to front"),
169 ":/img/actions/home.png",
170 EditorCommand::Flags(),
171 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_Home)},
173 };
175 "workspace_switch", // clang-format break
176 QT_TR_NOOP("Switch Workspace"),
177 QT_TR_NOOP("Choose another workspace to open"),
178 QString(),
180 {},
182 };
184 "workspace_settings", // clang-format break
185 QT_TR_NOOP("Workspace Settings"),
186 QT_TR_NOOP("Open the workspace settings dialog"),
187 ":/img/actions/settings.png",
189 {QKeySequence(Qt::CTRL | Qt::Key_Comma)},
191 };
193 "workspace_libraries_rescan", // clang-format break
194 QT_TR_NOOP("Rescan Libraries"),
195 QT_TR_NOOP("Scan all workspace libraries to update the cache"),
196 ":/img/actions/refresh.png",
197 EditorCommand::Flags(),
198 {QKeySequence(Qt::Key_F5)},
200 };
202 "library_manager", // clang-format break
203 QT_TR_NOOP("Library Manager"),
204 QT_TR_NOOP("Open the library manager window"),
205 ":/img/library/package.png",
207 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_M)},
209 };
211 "library_element_new", // clang-format break
212 QT_TR_NOOP("New Library Element"),
213 QT_TR_NOOP("Create a new library element"),
214 ":/img/actions/new.png",
216 {QKeySequence(Qt::CTRL | Qt::Key_N)},
218 };
220 "library_element_duplicate", // clang-format break
221 QT_TR_NOOP("Duplicate"),
222 QT_TR_NOOP("Create a new element by duplicating this one"),
223 ":/img/actions/clone.png",
224 EditorCommand::Flags(),
225 {QKeySequence(Qt::CTRL | Qt::Key_D)},
227 };
229 "project_new", // clang-format break
230 QT_TR_NOOP("New Project"),
231 QT_TR_NOOP("Create a new project"),
232 ":/img/actions/new.png",
234 {QKeySequence(Qt::CTRL | Qt::Key_N)},
236 };
238 "project_open", // clang-format break
239 QT_TR_NOOP("Open Project"),
240 QT_TR_NOOP("Open an existing project"),
241 ":/img/actions/open.png",
243 {QKeySequence(Qt::CTRL | Qt::Key_O)},
245 };
247 "project_save", // clang-format break
248 QT_TR_NOOP("Save Project"),
249 QT_TR_NOOP("Save the currently opened project"),
250 ":/img/actions/save.png",
251 EditorCommand::Flags(),
252 {QKeySequence(Qt::CTRL | Qt::Key_S)},
254 };
256 "project_setup", // clang-format break
257 QT_TR_NOOP("Project Setup"),
258 QT_TR_NOOP("View/modify the project setup"),
259 ":/img/actions/settings.png",
261 {QKeySequence(Qt::Key_F6)},
263 };
265 "grid_properties", // clang-format break
266 QT_TR_NOOP("Grid Properties"),
267 QT_TR_NOOP("View/modify the grid properties"),
268 ":/img/actions/grid.png",
270 {QKeySequence(Qt::Key_F4)},
272 };
274 "board_setup", // clang-format break
275 QT_TR_NOOP("Board Setup"),
276 QT_TR_NOOP("View/modify the board setup"),
277 ":/img/actions/settings.png",
279 {QKeySequence(Qt::Key_F7)},
281 };
283 "run_quick_check", // clang-format break
284 QT_TR_NOOP("Run Quick Check"),
285 QT_TR_NOOP("Run only the most important copper checks from the DRC"),
286 ":/img/actions/quick_check.png",
287 EditorCommand::Flags(),
288 {QKeySequence(Qt::SHIFT | Qt::Key_F8)},
290 };
292 "run_design_rule_check", // clang-format break
293 QT_TR_NOOP("Run Design Rule Check"),
294 QT_TR_NOOP("Run the design rule check (DRC)"),
295 ":/img/actions/drc.png",
296 EditorCommand::Flags(),
297 {QKeySequence(Qt::Key_F8)},
299 };
301 "project_library_update", // clang-format break
302 QT_TR_NOOP("Update Project Library"),
303 QT_TR_NOOP(
304 "Update the project's library elements from workspace libraries"),
305 ":/img/actions/refresh.png",
307 {QKeySequence(Qt::CTRL | Qt::Key_F5)},
309 };
311 "schematic_editor", // clang-format break
312 QT_TR_NOOP("Schematic Editor"),
313 QT_TR_NOOP("Bring the schematic editor window to front"),
314 ":/img/actions/schematic.png",
315 EditorCommand::Flags(),
316 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_S)},
318 };
320 "sheet_new", // clang-format break
321 QT_TR_NOOP("New Sheet"),
322 QT_TR_NOOP("Add a new schematic sheet to the project"),
323 ":/img/actions/new.png",
325 {QKeySequence(Qt::CTRL | Qt::Key_N)},
327 };
329 "sheet_rename", // clang-format break
330 QT_TR_NOOP("Rename Sheet"),
331 QT_TR_NOOP("Rename the current schematic sheet"),
332 QString(),
334 {QKeySequence(Qt::CTRL | Qt::Key_F2)},
336 };
338 "sheet_remove", // clang-format break
339 QT_TR_NOOP("Remove Sheet"),
340 QT_TR_NOOP("Remove the current schematic sheet from the project"),
341 ":/img/actions/delete.png",
342 EditorCommand::Flags(),
343 {QKeySequence(Qt::CTRL | Qt::Key_Delete)},
345 };
347 "board_editor", // clang-format break
348 QT_TR_NOOP("Board Editor"),
349 QT_TR_NOOP("Bring the board editor window to front"),
350 ":/img/actions/board_editor.png",
351 EditorCommand::Flags(),
352 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_B)},
354 };
356 "board_new", // clang-format break
357 QT_TR_NOOP("New Board"),
358 QT_TR_NOOP("Add a new board to the project"),
359 ":/img/actions/new.png",
361 {QKeySequence(Qt::CTRL | Qt::Key_N)},
363 };
365 "board_copy", // clang-format break
366 QT_TR_NOOP("Copy Board"),
367 QT_TR_NOOP("Add a copy of the current board to the project"),
368 ":/img/actions/copy.png",
370 {QKeySequence(Qt::CTRL | Qt::Key_D)},
372 };
374 "board_remove", // clang-format break
375 QT_TR_NOOP("Remove Board"),
376 QT_TR_NOOP("Remove the current board from the project"),
377 ":/img/actions/delete.png",
378 EditorCommand::Flags(),
379 {QKeySequence(Qt::CTRL | Qt::Key_Delete)},
381 };
383 "plane_show_all", // clang-format break
384 QT_TR_NOOP("Show All Planes"),
385 QT_TR_NOOP("Make the filled areas of all planes visible"),
386 ":/img/actions/show_planes.png",
387 EditorCommand::Flags(),
388 {},
390 };
392 "plane_hide_all", // clang-format break
393 QT_TR_NOOP("Hide All Planes"),
394 QT_TR_NOOP("Make the filled areas of all planes invisible"),
395 ":/img/actions/hide_planes.png",
396 EditorCommand::Flags(),
397 {},
399 };
401 "plane_rebuild_all", // clang-format break
402 QT_TR_NOOP("Rebuild All Planes"),
403 QT_TR_NOOP("Re-calculate the filled areas of all planes"),
404 ":/img/actions/rebuild_plane.png",
405 EditorCommand::Flags(),
406 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_R)},
408 };
409
411 "categoryTextInput", QT_TR_NOOP("Text Input"), true, &categoryRoot};
413 "input_browse", // clang-format break
414 QT_TR_NOOP("Browse"),
415 QT_TR_NOOP("Open file or directory browser"),
416 ":/img/actions/open.png",
418 {QKeySequence(Qt::CTRL | Qt::Key_B)},
420 };
422 "input_unit_change", // clang-format break
423 QT_TR_NOOP("Change Unit"),
424 QT_TR_NOOP("Change the measurement unit of the text input"),
425 ":/img/actions/ruler.png",
427 {QKeySequence(Qt::CTRL | Qt::Key_M)},
429 };
431 "input_remove", // clang-format break
432 QT_TR_NOOP("Remove"),
433 QT_TR_NOOP("Remove this item"),
434 ":/img/actions/delete.png",
435 EditorCommand::Flags(),
436 {QKeySequence(Qt::CTRL | Qt::Key_Delete)},
438 };
440 "input_accept_add", // clang-format break
441 QT_TR_NOOP("Add"),
442 QT_TR_NOOP("Add this item"),
443 ":/img/actions/plus_2.png",
444 EditorCommand::Flags(),
445 {QKeySequence(Qt::Key_Return)},
447 };
448
450 "categoryImportExport", QT_TR_NOOP("Import/Export"), true, &categoryRoot};
452 "add_example_projects", // clang-format break
453 QT_TR_NOOP("Add Example Projects"),
454 QT_TR_NOOP("Add some example projects to the workspace"),
455 ":/img/logo/32x32.png",
457 {},
458 nullptr, // Exclude from shortcuts overview & configuration
459 };
461 "import_dxf", // clang-format break
462 QT_TR_NOOP("Import DXF"),
463 QT_TR_NOOP("Import a 2D mechanical drawing"),
464 ":/img/actions/export_svg.png",
466 {},
468 };
470 "import_eagle_library", // clang-format break
471 QT_TR_NOOP("Import EAGLE Library"),
472 QT_TR_NOOP("Import library elements from an EAGLE *.lbr file"),
473 QString(),
475 {},
477 };
479 "import_eagle_project", // clang-format break
480 QT_TR_NOOP("Import EAGLE Project"),
481 QT_TR_NOOP("Import schematic/board from EAGLE *.sch/*.brd files"),
482 QString(),
484 {},
486 };
488 "import_kicad_library", // clang-format break
489 QT_TR_NOOP("Import KiCad Library"),
490 QT_TR_NOOP("Import symbols and footprints from KiCad libraries"),
491 QString(),
493 {},
495 };
497 "import_specctra_ses", // clang-format break
498 QT_TR_NOOP("Import Specctra SES"),
499 QT_TR_NOOP("Import a Specctra session, e.g. from external autorouters"),
500 ":/img/places/file.png",
502 {},
504 };
506 "export_lppz", // clang-format break
507 QT_TR_NOOP("Export *.lppz Archive"),
508 QT_TR_NOOP("Export the project as a self-contained *.lppz archive"),
509 ":/img/actions/export_zip.png",
511 {},
513 };
515 "export_image", // clang-format break
516 QT_TR_NOOP("Export Image"),
517 QT_TR_NOOP("Export graphics as a pixmap"),
518 ":/img/actions/export_pixmap.png",
520 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_I)},
522 };
524 "export_pdf", // clang-format break
525 QT_TR_NOOP("Export PDF"),
526 QT_TR_NOOP("Export graphics as a PDF"),
527 ":/img/actions/pdf.png",
529 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_P)},
531 };
533 "export_specctra_dsn", // clang-format break
534 QT_TR_NOOP("Export Specctra DSN"),
535 QT_TR_NOOP("Export PCB to Specctra format for external autorouters etc."),
536 ":/img/places/file.png",
538 {},
540 };
542 "export_step", // clang-format break
543 QT_TR_NOOP("Export STEP Model"),
544 QT_TR_NOOP("Export PCB as a STEP file for loading it into MCAD software"),
545 ":/img/actions/export_step.png",
547 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_T)},
549 };
551 "print", // clang-format break
552 QT_TR_NOOP("Print"),
553 QT_TR_NOOP("Send graphics to a printer"),
554 ":/img/actions/print.png",
556 {QKeySequence(Qt::CTRL | Qt::Key_P)},
558 };
560 "generate_bom", // clang-format break
561 QT_TR_NOOP("Generate Bill Of Materials"),
562 QT_TR_NOOP("Generate bill of materials (BOM) file"),
563 ":/img/actions/generate_bom.png",
565 {QKeySequence(Qt::Key_F9)},
567 };
569 "generate_fabrication_data", // clang-format break
570 QT_TR_NOOP("Generate Fabrication Data"),
571 QT_TR_NOOP("Generate Gerber/Excellon files for PCB fabrication"),
572 ":/img/actions/export_gerber.png",
574 {QKeySequence(Qt::Key_F10)},
576 };
578 "generate_pick_place", // clang-format break
579 QT_TR_NOOP("Generate Pick&&Place Files"),
580 QT_TR_NOOP("Generate pick&place files for automated PCB assembly"),
581 ":/img/actions/export_pick_place_file.png",
583 {}, // Was F11 until v0.1.7
585 };
587 "generate_d356_netlist", // clang-format break
588 QT_TR_NOOP("Generate IPC-D-356A Netlist"),
589 QT_TR_NOOP("Generate netlist file for automated PCB testing"),
590 ":/img/actions/generate_bom.png", // No netlist icon yet.
592 {},
594 };
596 "output_jobs", // clang-format break
597 QT_TR_NOOP("Output Jobs"),
598 QT_TR_NOOP("Modify or run output jobs"),
599 ":/img/actions/output_jobs.png",
601 {QKeySequence(Qt::Key_F11)},
603 };
605 "order_pcb", // clang-format break
606 QT_TR_NOOP("Order PCB"),
607 QT_TR_NOOP("Start ordering the PCB online"),
608 ":/img/actions/order_pcb.png",
610 {QKeySequence(Qt::Key_F12)},
612 };
613
614 EditorCommandCategory categoryModify{"categoryModify", QT_TR_NOOP("Modify"),
615 true, &categoryRoot};
617 "undo", // clang-format break
618 QT_TR_NOOP("Undo"),
619 QT_TR_NOOP("Revert the last modification"),
620 ":/img/actions/undo.png",
621 EditorCommand::Flags(),
622 {QKeySequence(Qt::CTRL | Qt::Key_Z)},
624 };
626 "redo", // clang-format break
627 QT_TR_NOOP("Redo"),
628 QT_TR_NOOP("Re-apply the last reverted modification"),
629 ":/img/actions/redo.png",
630 EditorCommand::Flags(),
631 {QKeySequence(Qt::CTRL | Qt::Key_Y),
632 QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Z)},
634 };
636 "clipboard_cut", // clang-format break
637 QT_TR_NOOP("Cut"),
638 QT_TR_NOOP("Cut the selected object(s) to clipboard"),
639 ":/img/actions/cut.png",
640 EditorCommand::Flags(),
641 {QKeySequence(Qt::CTRL | Qt::Key_X)},
643 };
645 "clipboard_copy", // clang-format break
646 QT_TR_NOOP("Copy"),
647 QT_TR_NOOP("Copy the selected object(s) to clipboard"),
648 ":/img/actions/copy.png",
649 EditorCommand::Flags(),
650 {QKeySequence(Qt::CTRL | Qt::Key_C)},
652 };
654 "clipboard_paste", // clang-format break
655 QT_TR_NOOP("Paste"),
656 QT_TR_NOOP("Paste object(s) from the clipboard"),
657 ":/img/actions/paste.png",
658 EditorCommand::Flags(),
659 {QKeySequence(Qt::CTRL | Qt::Key_V)},
661 };
663 "move_left", // clang-format break
664 QT_TR_NOOP("Move Left"),
665 QT_TR_NOOP("Move the selected object(s) to the left"),
666 QString(),
667 EditorCommand::Flags(),
668 {QKeySequence(Qt::Key_Left)},
670 };
672 "move_right", // clang-format break
673 QT_TR_NOOP("Move Right"),
674 QT_TR_NOOP("Move the selected object(s) to the right"),
675 QString(),
676 EditorCommand::Flags(),
677 {QKeySequence(Qt::Key_Right)},
679 };
681 "move_up", // clang-format break
682 QT_TR_NOOP("Move Up"),
683 QT_TR_NOOP("Move the selected object(s) up"),
684 QString(),
685 EditorCommand::Flags(),
686 {QKeySequence(Qt::Key_Up)},
688 };
690 "move_down", // clang-format break
691 QT_TR_NOOP("Move Down"),
692 QT_TR_NOOP("Move the selected object(s) down"),
693 QString(),
694 EditorCommand::Flags(),
695 {QKeySequence(Qt::Key_Down)},
697 };
699 "rotate_ccw", // clang-format break
700 QT_TR_NOOP("Rotate Counterclockwise"),
701 QT_TR_NOOP("Rotate the selected object(s) counterclockwise"),
702 ":/img/actions/rotate_left.png",
703 EditorCommand::Flags(),
704 {QKeySequence(Qt::Key_R)},
706 };
708 "rotate_cw", // clang-format break
709 QT_TR_NOOP("Rotate Clockwise"),
710 QT_TR_NOOP("Rotate the selected object(s) clockwise"),
711 ":/img/actions/rotate_right.png",
712 EditorCommand::Flags(),
713 {QKeySequence(Qt::SHIFT | Qt::Key_R)},
715 };
717 "mirror_horizontal", // clang-format break
718 QT_TR_NOOP("Mirror Horizontally"),
719 QT_TR_NOOP("Mirror the selected object(s) horizontally"),
720 ":/img/actions/mirror_horizontal.png",
721 EditorCommand::Flags(),
722 {QKeySequence(Qt::Key_M)},
724 };
726 "mirror_vertical", // clang-format break
727 QT_TR_NOOP("Mirror Vertically"),
728 QT_TR_NOOP("Mirror the selected object(s) vertically"),
729 ":/img/actions/mirror_vertical.png",
730 EditorCommand::Flags(),
731 {QKeySequence(Qt::SHIFT | Qt::Key_M)},
733 };
735 "flip_horizontal", // clang-format break
736 QT_TR_NOOP("Flip Horizontally"),
737 QT_TR_NOOP(
738 "Flip the selected object(s) horizontally to the other board side"),
739 ":/img/actions/flip_horizontal.png",
740 EditorCommand::Flags(),
741 {QKeySequence(Qt::Key_F)},
743 };
745 "flip_vertical", // clang-format break
746 QT_TR_NOOP("Flip Vertically"),
747 QT_TR_NOOP(
748 "Flip the selected object(s) vertically to the other board side"),
749 ":/img/actions/flip_vertical.png",
750 EditorCommand::Flags(),
751 {QKeySequence(Qt::SHIFT | Qt::Key_F)},
753 };
755 "move_align", // clang-format break
756 QT_TR_NOOP("Move/Align Objects"),
757 QT_TR_NOOP("Move and/or align the selected object(s) vertically or "
758 "horizontally"),
759 ":/img/actions/move.png",
760 EditorCommand::Flags(),
761 {QKeySequence(Qt::Key_A)},
763 };
765 "snap_to_grid", // clang-format break
766 QT_TR_NOOP("Snap to Grid"),
767 QT_TR_NOOP("Move the selected object(s) to snap the grid"),
768 ":/img/actions/grid.png",
769 EditorCommand::Flags(),
770 {QKeySequence(Qt::Key_S)},
772 };
774 "lock", // clang-format break
775 QT_TR_NOOP("Lock Placement"),
776 QT_TR_NOOP("Lock the placement of the selected object(s)"),
777 ":/img/status/locked.png",
778 EditorCommand::Flags(),
779 {QKeySequence(Qt::CTRL | Qt::Key_L)},
781 };
783 "unlock", // clang-format break
784 QT_TR_NOOP("Unlock Placement"),
785 QT_TR_NOOP("Unlock the placement of the selected object(s)"),
786 ":/img/status/unlocked.png",
787 EditorCommand::Flags(),
788 {QKeySequence(Qt::CTRL | Qt::Key_U)},
790 };
792 "line_width_set", // clang-format break
793 QT_TR_NOOP("Set Line Width"),
794 QT_TR_NOOP(
795 "Change the line/trace/stroke width of the selected object(s)"),
796 QString(),
798 {},
800 };
802 "device_reset_text_all", // clang-format break
803 QT_TR_NOOP("Reset All Texts"),
804 QT_TR_NOOP("Reset all texts of the footprint to their initial state"),
805 ":/img/actions/undo.png",
806 EditorCommand::Flags(),
807 {},
809 };
811 "properties", // clang-format break
812 QT_TR_NOOP("Properties"),
813 QT_TR_NOOP("View/modify the object properties"),
814 ":/img/actions/settings.png",
816 {QKeySequence(Qt::Key_E)},
818 };
820 "rename", // clang-format break
821 QT_TR_NOOP("Rename"),
822 QT_TR_NOOP("Rename the selected object"),
823 ":/img/actions/edit.png",
824 EditorCommand::Flags(),
825 {QKeySequence(Qt::Key_F2)},
827 };
829 "remove", // clang-format break
830 QT_TR_NOOP("Remove"),
831 QT_TR_NOOP("Delete the selected object(s)"),
832 ":/img/actions/delete.png",
833 EditorCommand::Flags(),
834 {QKeySequence(Qt::Key_Delete)},
836 };
837
838 EditorCommandCategory categoryView{"categoryView", QT_TR_NOOP("View"), true,
839 &categoryRoot};
841 "zoom_fit_content", // clang-format break
842 QT_TR_NOOP("Zoom to Fit Contents"),
843 QT_TR_NOOP("Set the zoom level to fit the whole content"),
844 ":/img/actions/zoom_all.png",
845 EditorCommand::Flags(),
846 {QKeySequence(Qt::CTRL | Qt::Key_Home)},
848 };
850 "zoom_in", // clang-format break
851 QT_TR_NOOP("Zoom In"),
852 QT_TR_NOOP("Increase the zoom level"),
853 ":/img/actions/zoom_in.png",
854 EditorCommand::Flags(),
855 {QKeySequence(Qt::CTRL | Qt::Key_Plus)},
857 };
859 "zoom_out", // clang-format break
860 QT_TR_NOOP("Zoom Out"),
861 QT_TR_NOOP("Decrease the zoom level"),
862 ":/img/actions/zoom_out.png",
863 EditorCommand::Flags(),
864 {QKeySequence(Qt::CTRL | Qt::Key_Minus)},
866 };
868 "grid_increase", // clang-format break
869 QT_TR_NOOP("Increase Grid Interval"),
870 QT_TR_NOOP("Increase the grid interval"),
871 QString(),
872 EditorCommand::Flags(),
873 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Plus)},
875 };
877 "grid_decrease", // clang-format break
878 QT_TR_NOOP("Decrease Grid Interval"),
879 QT_TR_NOOP("Decrease the grid interval"),
880 QString(),
881 EditorCommand::Flags(),
882 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Minus)},
884 };
886 "show_pin_numbers", // clang-format break
887 QT_TR_NOOP("Show Pin Numbers"),
888 QT_TR_NOOP("Show or hide symbol pin numbers"),
889 ":/img/actions/show_pin_numbers.png",
890 EditorCommand::Flags(),
891 {QKeySequence()},
893 };
895 "ignore_locks", // clang-format break
896 QT_TR_NOOP("Ignore Placement Locks"),
897 QT_TR_NOOP("Allow dragging locked items"),
898 ":/img/status/unlocked.png",
899 EditorCommand::Flags(),
900 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_L)},
902 };
904 "toggle_background_image", // clang-format break
905 QT_TR_NOOP("Set/Unset Background Image"),
906 QT_TR_NOOP("Use a datasheet drawing as the background for verification"),
907 ":/img/actions/export_pixmap.png",
909 {},
911 };
913 "toggle_3d", // clang-format break
914 QT_TR_NOOP("Toggle 2D/3D Mode"),
915 QT_TR_NOOP("Switch between 2D and 3D viewer mode"),
916 ":/img/actions/view_3d.png",
917 EditorCommand::Flags(),
918 {QKeySequence(Qt::CTRL | Qt::Key_3)},
920 };
921
922 EditorCommandCategory categoryTools{"categoryTools", QT_TR_NOOP("Tools"),
923 true, &categoryRoot};
925 "tool_select", // clang-format break
926 QT_TR_NOOP("Select"),
927 QT_TR_NOOP("Select & modify existing objects"),
928 ":/img/actions/select.png",
929 EditorCommand::Flags(),
930 {},
932 };
934 "tool_line", // clang-format break
935 QT_TR_NOOP("Draw Line"),
936 QT_TR_NOOP("Draw graphical lines"),
937 ":/img/actions/draw_line.png",
938 EditorCommand::Flags(),
939 {QKeySequence(Qt::Key_L)},
941 };
943 "tool_rect", // clang-format break
944 QT_TR_NOOP("Draw Rectangle"),
945 QT_TR_NOOP("Draw graphical rectangles"),
946 ":/img/actions/draw_rectangle.png",
947 EditorCommand::Flags(),
948 {QKeySequence(Qt::Key_G)},
950 };
952 "tool_polygon", // clang-format break
953 QT_TR_NOOP("Draw Polygon"),
954 QT_TR_NOOP("Draw graphical polygons"),
955 ":/img/actions/draw_polygon.png",
956 EditorCommand::Flags(),
957 {QKeySequence(Qt::Key_P)},
959 };
961 "tool_circle", // clang-format break
962 QT_TR_NOOP("Draw Circle"),
963 QT_TR_NOOP("Draw graphical circles"),
964 ":/img/actions/draw_circle.png",
965 EditorCommand::Flags(),
966 {QKeySequence(Qt::Key_C)},
968 };
970 "tool_arc", // clang-format break
971 QT_TR_NOOP("Draw Arc"),
972 QT_TR_NOOP("Draw graphical arcs"),
973 ":/img/actions/draw_arc.png",
974 EditorCommand::Flags(),
975 {QKeySequence(Qt::SHIFT | Qt::Key_C)},
977 };
979 "tool_text", // clang-format break
980 QT_TR_NOOP("Add Text"),
981 QT_TR_NOOP("Add graphical text objects"),
982 ":/img/actions/add_text.png",
983 EditorCommand::Flags(),
984 {QKeySequence(Qt::Key_T)},
986 };
988 "tool_name", // clang-format break
989 QT_TR_NOOP("Add Name"),
990 QT_TR_NOOP("Add graphical text objects for '{{NAME}}'"),
991 ":/img/actions/add_name.png",
992 EditorCommand::Flags(),
993 {QKeySequence(Qt::Key_N)},
995 };
997 "tool_value", // clang-format break
998 QT_TR_NOOP("Add Value"),
999 QT_TR_NOOP("Add graphical text objects for '{{VALUE}}'"),
1000 ":/img/actions/add_value.png",
1001 EditorCommand::Flags(),
1002 {QKeySequence(Qt::Key_V)},
1004 };
1006 "tool_pin", // clang-format break
1007 QT_TR_NOOP("Add Pin"),
1008 QT_TR_NOOP("Add symbol pins (electrical connections for schematics)"),
1009 ":/img/actions/add_symbol_pin.png",
1010 EditorCommand::Flags(),
1011 {QKeySequence(Qt::Key_I)},
1013 };
1015 "tool_pad_tht", // clang-format break
1016 QT_TR_NOOP("Add THT Pad"),
1017 QT_TR_NOOP("Add plated through-hole copper pads"),
1018 ":/img/actions/add_tht_pad.png",
1019 EditorCommand::Flags(),
1020 {QKeySequence(Qt::Key_H)},
1022 };
1024 "tool_pad_smt", // clang-format break
1025 QT_TR_NOOP("Add SMT Pad"),
1026 QT_TR_NOOP("Add surface mounted (single layer) copper pads"),
1027 ":/img/actions/add_smt_pad.png",
1028 EditorCommand::Flags(),
1029 {QKeySequence(Qt::Key_D)},
1031 };
1033 "tool_pad_thermal", // clang-format break
1034 QT_TR_NOOP("Add Thermal Pad"),
1035 QT_TR_NOOP("Add special SMT pads used as heat sink"),
1036 QString(),
1037 EditorCommand::Flags(),
1038 {},
1040 };
1042 "tool_pad_bga", // clang-format break
1043 QT_TR_NOOP("Add BGA Pad"),
1044 QT_TR_NOOP("Add special SMT pads used for ball grid arrays"),
1045 QString(),
1046 EditorCommand::Flags(),
1047 {},
1049 };
1051 "tool_pad_edge_connector", // clang-format break
1052 QT_TR_NOOP("Add Edge Connector Pad"),
1053 QT_TR_NOOP("Add special SMT pads used as edge connector"),
1054 QString(),
1055 EditorCommand::Flags(),
1056 {},
1058 };
1060 "tool_pad_test_point", // clang-format break
1061 QT_TR_NOOP("Add Test Pad"),
1062 QT_TR_NOOP("Add special SMT pads used as test points"),
1063 QString(),
1064 EditorCommand::Flags(),
1065 {},
1067 };
1069 "tool_pad_local_fiducial", // clang-format break
1070 QT_TR_NOOP("Add Local Fiducial Pad"),
1071 QT_TR_NOOP("Add special SMT pads used as local fiducials"),
1072 QString(),
1073 EditorCommand::Flags(),
1074 {},
1076 };
1078 "tool_pad_global_fiducial", // clang-format break
1079 QT_TR_NOOP("Add Global Fiducial Pad"),
1080 QT_TR_NOOP("Add special SMT pads used as global fiducials"),
1081 QString(),
1082 EditorCommand::Flags(),
1083 {},
1085 };
1087 "tool_zone", // clang-format break
1088 QT_TR_NOOP("Draw Keepout Zone"),
1089 QT_TR_NOOP("Draw keep-out zones"),
1090 ":/img/actions/draw_zone.png",
1091 EditorCommand::Flags(),
1092 {QKeySequence(Qt::Key_Z)},
1094 };
1096 "tool_hole", // clang-format break
1097 QT_TR_NOOP("Add Hole"),
1098 QT_TR_NOOP("Add non-plated holes (NPTH drills)"),
1099 ":/img/actions/add_hole.png",
1100 EditorCommand::Flags(),
1101 {QKeySequence(Qt::Key_O)},
1103 };
1105 "tool_wire", // clang-format break
1106 QT_TR_NOOP("Draw Wire"),
1107 QT_TR_NOOP(
1108 "Draw wires to create electrical connections between symbol pins"),
1109 ":/img/actions/draw_wire.png",
1110 EditorCommand::Flags(),
1111 {QKeySequence(Qt::Key_W)},
1113 };
1115 "tool_netlabel", // clang-format break
1116 QT_TR_NOOP("Add Net Label"),
1117 QT_TR_NOOP("Add net labels to explicitly specify the net of wires"),
1118 ":/img/actions/draw_netlabel.png",
1119 EditorCommand::Flags(),
1120 {QKeySequence(Qt::Key_N)},
1122 };
1124 "tool_component", // clang-format break
1125 QT_TR_NOOP("Add Component"),
1126 QT_TR_NOOP("Insert components from the workspace libraries"),
1127 ":/img/actions/add_component.png",
1129 {QKeySequence(Qt::Key_A)},
1131 };
1133 "tool_trace", // clang-format break
1134 QT_TR_NOOP("Draw Trace"),
1135 QT_TR_NOOP("Draw copper traces to interconnect devices"),
1136 ":/img/actions/draw_wire.png",
1137 EditorCommand::Flags(),
1138 {QKeySequence(Qt::Key_W)},
1140 };
1142 "tool_via", // clang-format break
1143 QT_TR_NOOP("Add Via"),
1144 QT_TR_NOOP("Add plated through-hole vias"),
1145 ":/img/actions/add_via.png",
1146 EditorCommand::Flags(),
1147 {QKeySequence(Qt::Key_V)},
1149 };
1151 "tool_plane", // clang-format break
1152 QT_TR_NOOP("Draw Plane"),
1153 QT_TR_NOOP("Draw auto-filled copper areas to interconnect pads and vias"),
1154 ":/img/actions/add_plane.png",
1155 EditorCommand::Flags(),
1156 {QKeySequence(Qt::Key_N)},
1158 };
1160 "tool_generate_outline", // clang-format break
1161 QT_TR_NOOP("Generate Outline"),
1162 QT_TR_NOOP("Automatically generate the outline polygon"),
1163 ":/img/actions/wizard.png",
1164 EditorCommand::Flags(),
1165 {},
1167 };
1169 "tool_generate_courtyard", // clang-format break
1170 QT_TR_NOOP("Generate Courtyard"),
1171 QT_TR_NOOP("Automatically generate the courtyard polygon"),
1172 ":/img/actions/wizard.png",
1174 {},
1176 };
1178 "tool_renumber_pads", // clang-format break
1179 QT_TR_NOOP("Re-Number Pads"),
1180 QT_TR_NOOP("Helper tool to interactively change pad numbers"),
1181 ":/img/actions/wizard.png",
1183 {},
1185 };
1187 "tool_measure", // clang-format break
1188 QT_TR_NOOP("Measure Distance"),
1189 QT_TR_NOOP("Measure the distance between two points"),
1190 ":/img/actions/ruler.png",
1191 EditorCommand::Flags(),
1192 {QKeySequence(Qt::CTRL | Qt::Key_M)},
1194 };
1195
1197 "categoryCommands", QT_TR_NOOP("Commands"), true, &categoryRoot};
1199 "command_toolbar_focus", // clang-format break
1200 QT_TR_NOOP("Go To Command Toolbar"),
1201 QT_TR_NOOP("Move the focus into the command toolbar"),
1202 QString(),
1203 EditorCommand::Flags(),
1204 {QKeySequence(Qt::Key_Tab)},
1206 };
1208 "abort", // clang-format break
1209 QT_TR_NOOP("Abort Command"),
1210 QT_TR_NOOP("Abort the currently active command"),
1211 ":/img/actions/stop.png",
1212 EditorCommand::Flags(),
1213 {QKeySequence(Qt::Key_Escape)},
1215 };
1217 "layer_up", // clang-format break
1218 QT_TR_NOOP("Layer Up"),
1219 QT_TR_NOOP("Switch to the next higher layer (bottom->top)"),
1220 QString(),
1221 EditorCommand::Flags(),
1222 {QKeySequence(Qt::Key_PageUp)},
1224 };
1226 "layer_down", // clang-format break
1227 QT_TR_NOOP("Layer Down"),
1228 QT_TR_NOOP("Switch to the next lower layer (top->bottom)"),
1229 QString(),
1230 EditorCommand::Flags(),
1231 {QKeySequence(Qt::Key_PageDown)},
1233 };
1235 "line_width_increase", // clang-format break
1236 QT_TR_NOOP("Increase Line Width"),
1237 QT_TR_NOOP("Increase the line/trace/stroke/pad width"),
1238 QString(),
1239 EditorCommand::Flags(),
1240 {QKeySequence(Qt::Key_Plus)},
1242 };
1244 "line_width_decrease", // clang-format break
1245 QT_TR_NOOP("Decrease Line Width"),
1246 QT_TR_NOOP("Decrease the line/trace/stroke/pad width"),
1247 QString(),
1248 EditorCommand::Flags(),
1249 {QKeySequence(Qt::Key_Minus)},
1251 };
1253 "size_increase", // clang-format break
1254 QT_TR_NOOP("Increase Size"),
1255 QT_TR_NOOP("Increase the via/pad/pin/text size"),
1256 QString(),
1257 EditorCommand::Flags(),
1258 {QKeySequence(Qt::Key_Asterisk)},
1260 };
1262 "size_decrease", // clang-format break
1263 QT_TR_NOOP("Decrease Size"),
1264 QT_TR_NOOP("Decrease the via/pad/pin/text size"),
1265 QString(),
1266 EditorCommand::Flags(),
1267 {QKeySequence(Qt::Key_Slash)},
1269 };
1271 "drill_increase", // clang-format break
1272 QT_TR_NOOP("Increase Drill"),
1273 QT_TR_NOOP("Increase the via/pad/hole drill diameter"),
1274 QString(),
1275 EditorCommand::Flags(),
1276 {QKeySequence(Qt::Key_Home)},
1278 };
1280 "drill_decrease", // clang-format break
1281 QT_TR_NOOP("Decrease Drill"),
1282 QT_TR_NOOP("Decrease the via/pad/hole drill diameter"),
1283 QString(),
1284 EditorCommand::Flags(),
1285 {QKeySequence(Qt::Key_End)},
1287 };
1289 "width_auto_toggle", // clang-format break
1290 QT_TR_NOOP("Toggle Auto-Width"),
1291 QT_TR_NOOP("Toggle the auto-width property state"),
1292 QString(),
1293 EditorCommand::Flags(),
1294 {QKeySequence(Qt::Key_Period)},
1296 };
1298 "fill_toggle", // clang-format break
1299 QT_TR_NOOP("Toggle Fill"),
1300 QT_TR_NOOP("Toggle the fill property state"),
1301 QString(),
1302 EditorCommand::Flags(),
1303 {QKeySequence(Qt::Key_F)},
1305 };
1307 "grab_area_toggle", // clang-format break
1308 QT_TR_NOOP("Toggle Grab Area"),
1309 QT_TR_NOOP("Toggle the grab area property state"),
1310 QString(),
1311 EditorCommand::Flags(),
1312 {QKeySequence(Qt::Key_Comma)},
1314 };
1316 "align_horizontal_left", // clang-format break
1317 QT_TR_NOOP("Align Left"),
1318 QT_TR_NOOP("Horizontal alignment: Left"),
1319 ":/img/command_toolbars/align_horizontal_left.png",
1320 EditorCommand::Flags(),
1321 {QKeySequence(Qt::Key_1)},
1323 };
1325 "align_horizontal_center", // clang-format break
1326 QT_TR_NOOP("Align Center"),
1327 QT_TR_NOOP("Horizontal alignment: Center"),
1328 ":/img/command_toolbars/align_horizontal_center.png",
1329 EditorCommand::Flags(),
1330 {QKeySequence(Qt::Key_2)},
1332 };
1334 "align_horizontal_right", // clang-format break
1335 QT_TR_NOOP("Align Right"),
1336 QT_TR_NOOP("Horizontal alignment: Right"),
1337 ":/img/command_toolbars/align_horizontal_right.png",
1338 EditorCommand::Flags(),
1339 {QKeySequence(Qt::Key_3)},
1341 };
1343 "align_vertical_bottom", // clang-format break
1344 QT_TR_NOOP("Align Bottom"),
1345 QT_TR_NOOP("Vertical alignment: Bottom"),
1346 ":/img/command_toolbars/align_vertical_bottom.png",
1347 EditorCommand::Flags(),
1348 {QKeySequence(Qt::Key_4)},
1350 };
1352 "align_vertical_center", // clang-format break
1353 QT_TR_NOOP("Align Center"),
1354 QT_TR_NOOP("Vertical alignment: Center"),
1355 ":/img/command_toolbars/align_vertical_center.png",
1356 EditorCommand::Flags(),
1357 {QKeySequence(Qt::Key_5)},
1359 };
1361 "align_vertical_top", // clang-format break
1362 QT_TR_NOOP("Align Top"),
1363 QT_TR_NOOP("Vertical alignment: Top"),
1364 ":/img/command_toolbars/align_vertical_top.png",
1365 EditorCommand::Flags(),
1366 {QKeySequence(Qt::Key_6)},
1368 };
1370 "wire_mode_h_v", // clang-format break
1371 QT_TR_NOOP("Horizontal - Vertical"),
1372 QT_TR_NOOP(
1373 "Wire mode: First segment horizontal, second segment vertical"),
1374 ":/img/command_toolbars/wire_h_v.png",
1375 EditorCommand::Flags(),
1376 {QKeySequence(Qt::Key_1)},
1378 };
1380 "wire_mode_v_h", // clang-format break
1381 QT_TR_NOOP("Vertical - Horizontal"),
1382 QT_TR_NOOP(
1383 "Wire mode: First segment vertical, second segment horizontal"),
1384 ":/img/command_toolbars/wire_v_h.png",
1385 EditorCommand::Flags(),
1386 {QKeySequence(Qt::Key_2)},
1388 };
1390 "wire_mode_90_45", // clang-format break
1391 QT_TR_NOOP("90° - 45°"),
1392 QT_TR_NOOP("Wire mode: First segment 90°, second segment 45°"),
1393 ":/img/command_toolbars/wire_90_45.png",
1394 EditorCommand::Flags(),
1395 {QKeySequence(Qt::Key_3)},
1397 };
1399 "wire_mode_45_90", // clang-format break
1400 QT_TR_NOOP("45° - 90°"),
1401 QT_TR_NOOP("Wire mode: First segment 45°, second segment 90°"),
1402 ":/img/command_toolbars/wire_45_90.png",
1403 EditorCommand::Flags(),
1404 {QKeySequence(Qt::Key_4)},
1406 };
1408 "wire_mode_straight", // clang-format break
1409 QT_TR_NOOP("Straight"),
1410 QT_TR_NOOP("Wire mode: Straight line"),
1411 ":/img/command_toolbars/wire_straight.png",
1412 EditorCommand::Flags(),
1413 {QKeySequence(Qt::Key_5)},
1415 };
1417 "shape_round", // clang-format break
1418 QT_TR_NOOP("Round"),
1419 QT_TR_NOOP("Shape: Round"),
1420 ":/img/command_toolbars/shape_round.png",
1421 EditorCommand::Flags(),
1422 {QKeySequence(Qt::Key_1)},
1424 };
1426 "shape_rounded_rect", // clang-format break
1427 QT_TR_NOOP("Rounded Rectangle"),
1428 QT_TR_NOOP("Shape: Rounded Rectangle"),
1429 ":/img/command_toolbars/shape_rounded_rect.png",
1430 EditorCommand::Flags(),
1431 {QKeySequence(Qt::Key_2)},
1433 };
1435 "shape_rect", // clang-format break
1436 QT_TR_NOOP("Rectangle"),
1437 QT_TR_NOOP("Shape: Rectangle"),
1438 ":/img/command_toolbars/shape_rect.png",
1439 EditorCommand::Flags(),
1440 {QKeySequence(Qt::Key_3)},
1442 };
1444 "shape_octagon", // clang-format break
1445 QT_TR_NOOP("Octagon"),
1446 QT_TR_NOOP("Shape: Octagon"),
1447 ":/img/command_toolbars/shape_octagon.png",
1448 EditorCommand::Flags(),
1449 {QKeySequence(Qt::Key_4)},
1451 };
1452
1454 "categoryComponents", QT_TR_NOOP("Components"), true, &categoryRoot};
1456 "component_resistor", // clang-format break
1457 QT_TR_NOOP("Resistor"),
1458 QT_TR_NOOP("Add standard component: Resistor"),
1459 ":/img/library/resistor_eu.png",
1460 EditorCommand::Flags(),
1461 {},
1463 };
1465 "component_inductor", // clang-format break
1466 QT_TR_NOOP("Inductor"),
1467 QT_TR_NOOP("Add standard component: Inductor"),
1468 ":/img/library/inductor_eu.png",
1469 EditorCommand::Flags(),
1470 {},
1472 };
1474 "component_capacitor_bipolar", // clang-format break
1475 QT_TR_NOOP("Bipolar Capacitor"),
1476 QT_TR_NOOP("Add standard component: Bipolar capacitor"),
1477 ":/img/library/bipolar_capacitor_eu.png",
1478 EditorCommand::Flags(),
1479 {},
1481 };
1483 "component_capacitor_unipolar", // clang-format break
1484 QT_TR_NOOP("Unipolar Capacitor"),
1485 QT_TR_NOOP("Add standard component: Unipolar capacitor"),
1486 ":/img/library/unipolar_capacitor_eu.png",
1487 EditorCommand::Flags(),
1488 {},
1490 };
1492 "component_gnd", // clang-format break
1493 QT_TR_NOOP("GND Supply"),
1494 QT_TR_NOOP("Add standard component: GND supply"),
1495 ":/img/library/gnd.png",
1496 EditorCommand::Flags(),
1497 {},
1499 };
1501 "component_vcc", // clang-format break
1502 QT_TR_NOOP("VCC Supply"),
1503 QT_TR_NOOP("Add standard component: VCC supply"),
1504 ":/img/library/vcc.png",
1505 EditorCommand::Flags(),
1506 {},
1508 };
1509
1510 EditorCommandCategory categoryDocks{"categoryDocks", QT_TR_NOOP("Docks"),
1511 true, &categoryRoot};
1513 "dock_pages", // clang-format break
1514 QT_TR_NOOP("Pages"),
1515 QT_TR_NOOP("Go to the pages dock"),
1516 QString(),
1517 EditorCommand::Flags(),
1518 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_G)},
1520 };
1522 "dock_erc", // clang-format break
1523 QT_TR_NOOP("Electrical Rule Check (ERC)"),
1524 QT_TR_NOOP("Go to the ERC messages dock"),
1525 QString(),
1526 EditorCommand::Flags(),
1527 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_E)},
1529 };
1531 "dock_drc", // clang-format break
1532 QT_TR_NOOP("Design Rule Check (DRC)"),
1533 QT_TR_NOOP("Go to the DRC messages dock"),
1534 QString(),
1535 EditorCommand::Flags(),
1536 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_D)},
1538 };
1540 "dock_layers", // clang-format break
1541 QT_TR_NOOP("Layers"),
1542 QT_TR_NOOP("Go to the layers dock"),
1543 QString(),
1544 EditorCommand::Flags(),
1545 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_L)},
1547 };
1549 "dock_place_devices", // clang-format break
1550 QT_TR_NOOP("Place Devices"),
1551 QT_TR_NOOP("Go to the dock for placing devices"),
1552 QString(),
1553 EditorCommand::Flags(),
1554 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_P)},
1556 };
1557
1559 "categoryWindowManagement", QT_TR_NOOP("Window Management"), true,
1560 &categoryRoot};
1562 "page_next", // clang-format break
1563 QT_TR_NOOP("Next Tab/Page"),
1564 QT_TR_NOOP("Navigate to the next tab or page"),
1565 QString(),
1566 EditorCommand::Flags(),
1567 {QKeySequence(Qt::CTRL | Qt::Key_Tab)},
1569 };
1571 "page_previous", // clang-format break
1572 QT_TR_NOOP("Previous Tab/Page"),
1573 QT_TR_NOOP("Navigate to the previous tab or page"),
1574 QString(),
1575 EditorCommand::Flags(),
1576 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Tab)},
1578 };
1580 "tab_close", // clang-format break
1581 QT_TR_NOOP("Close Tab"),
1582 QT_TR_NOOP("Close the currently opened tab"),
1583 QString(),
1584 EditorCommand::Flags(),
1585 {QKeySequence(Qt::CTRL | Qt::Key_W)},
1587 };
1589 "tab_close_all", // clang-format break
1590 QT_TR_NOOP("Close All Tabs"),
1591 QT_TR_NOOP("Close all currently opened tabs"),
1592 QString(),
1593 EditorCommand::Flags(),
1594 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_W)},
1596 };
1598 "window_close", // clang-format break
1599 QT_TR_NOOP("Close Window"),
1600 QT_TR_NOOP("Close this window"),
1601 QString(),
1602 EditorCommand::Flags(),
1603 {QKeySequence(Qt::ALT | Qt::Key_F4)},
1605 };
1607 "project_close", // clang-format break
1608 QT_TR_NOOP("Close Project"),
1609 QT_TR_NOOP("Close the currently opened project"),
1610 ":/img/actions/close.png",
1611 EditorCommand::Flags(),
1612 {QKeySequence(Qt::CTRL | Qt::Key_F4)},
1614 };
1616 "project_close_all", // clang-format break
1617 QT_TR_NOOP("Close All Projects"),
1618 QT_TR_NOOP("Close all currently opened projects"),
1619 ":/img/actions/close.png",
1620 EditorCommand::Flags(),
1621 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_F4)},
1623 };
1625 "application_quit", // clang-format break
1626 QT_TR_NOOP("Quit"),
1627 QT_TR_NOOP("Close the whole application"),
1628 ":/img/actions/quit.png",
1630 {QKeySequence(Qt::CTRL | Qt::Key_Q)},
1632 };
1633
1634 EditorCommandCategory categoryHelp{"categoryHelp", QT_TR_NOOP("Help"), true,
1635 &categoryRoot};
1637 "about_librepcb", // clang-format break
1638 QT_TR_NOOP("About LibrePCB"),
1639 QT_TR_NOOP("Show information about the application"),
1640 ":/img/logo/48x48.png",
1642 {},
1643 &categoryHelp,
1644 };
1646 "about_qt", // clang-format break
1647 QT_TR_NOOP("About Qt"),
1648 QT_TR_NOOP("Show information about Qt"),
1649 QString(),
1651 {},
1652 &categoryHelp,
1653 };
1655 "website", // clang-format break
1656 QT_TR_NOOP("LibrePCB Website"),
1657 QT_TR_NOOP("Open the LibrePCB website in the web browser"),
1658 ":/img/actions/open_browser.png",
1659 EditorCommand::Flags(),
1660 {},
1661 &categoryHelp,
1662 };
1664 "documentation_online", // clang-format break
1665 QT_TR_NOOP("Online Documentation"),
1666 QT_TR_NOOP("Open the documentation in the web browser"),
1667 ":/img/actions/help.png",
1668 EditorCommand::Flags(),
1669 {QKeySequence(Qt::Key_F1)},
1670 &categoryHelp,
1671 };
1673 "keyboard_shortcuts_reference", // clang-format break
1674 QT_TR_NOOP("Keyboard Shortcuts Reference"),
1675 QT_TR_NOOP("Open a quick reference about the keyboard shortcuts"),
1676 QString(),
1677 EditorCommand::Flags(),
1678 {QKeySequence(Qt::CTRL | Qt::Key_F1)},
1679 &categoryHelp,
1680 };
1681
1683 "categoryContextMenu", QT_TR_NOOP("Context Menu"), false, &categoryRoot};
1685 "folder_new", // clang-format break
1686 QT_TR_NOOP("New Folder"),
1687 QT_TR_NOOP("Create a new folder"),
1688 ":/img/actions/new_folder.png",
1689 EditorCommand::Flags(),
1690 {},
1692 };
1694 "favorite_add", // clang-format break
1695 QT_TR_NOOP("Add To Favorites"),
1696 QT_TR_NOOP("Add project to favorites"),
1697 ":/img/actions/bookmark_gray.png",
1698 EditorCommand::Flags(),
1699 {},
1701 };
1703 "favorite_remove", // clang-format break
1704 QT_TR_NOOP("Remove From Favorites"),
1705 QT_TR_NOOP("Remove project from favorites"),
1706 ":/img/actions/bookmark.png",
1707 EditorCommand::Flags(),
1708 {},
1710 };
1712 "vertex_add", // clang-format break
1713 QT_TR_NOOP("Add Vertex"),
1714 QT_TR_NOOP("Insert a new vertex into the selected polygon edge"),
1715 ":/img/actions/add.png",
1716 EditorCommand::Flags(),
1717 {},
1719 };
1721 "vertex_remove", // clang-format break
1722 QT_TR_NOOP("Remove Vertex"),
1723 QT_TR_NOOP("Remove the selected vertex from the polygon"),
1724 ":/img/actions/delete.png",
1725 EditorCommand::Flags(),
1726 {},
1728 };
1730 "trace_select_whole", // clang-format break
1731 QT_TR_NOOP("Select Whole Trace"),
1732 QT_TR_NOOP("Select the whole trace"),
1733 ":/img/actions/bookmark.png",
1734 EditorCommand::Flags(),
1735 {},
1737 };
1739 "trace_measure_length", // clang-format break
1740 QT_TR_NOOP("Measure Selected Segments Length"),
1741 QT_TR_NOOP("Measure the total length of all selected trace segments"),
1742 ":/img/actions/ruler.png",
1743 EditorCommand::Flags(),
1744 {},
1746 };
1748 "trace_remove_whole", // clang-format break
1749 QT_TR_NOOP("Remove Whole Trace"),
1750 QT_TR_NOOP("Remove the whole trace"),
1751 ":/img/actions/minus.png",
1752 EditorCommand::Flags(),
1753 {},
1755 };
1757 "locked", // clang-format break
1758 QT_TR_NOOP("Lock Placement"),
1759 QT_TR_NOOP("Toggle placement lock"),
1760 ":/img/status/locked.png", // For consistent context menu look.
1761 EditorCommand::Flags(),
1762 {},
1764 };
1766 "visible", // clang-format break
1767 QT_TR_NOOP("Visible"),
1768 QT_TR_NOOP("Toggle visibility"),
1769 QString(),
1770 EditorCommand::Flags(),
1771 {},
1773 };
1775 "copy_mpn_to_clipboard", // clang-format break
1776 QT_TR_NOOP("Copy MPN to Clipboard"),
1777 QT_TR_NOOP("Copy this MPN into the clipboard"),
1778 ":/img/actions/copy.png",
1779 EditorCommand::Flags(),
1780 {QKeySequence(Qt::CTRL | Qt::Key_C)},
1782 };
1784 "open_product_website", // clang-format break
1785 QT_TR_NOOP("Open Product Website"),
1786 QT_TR_NOOP("Open product details about this part in the web browser"),
1787 ":/img/actions/open_browser.png",
1789 {},
1791 };
1793 "open_pricing_website", // clang-format break
1794 QT_TR_NOOP("Open Pricing Website"),
1795 QT_TR_NOOP("Open pricing details about this part in the web browser"),
1796 ":/img/library/part.png",
1798 {},
1800 };
1802 // Actually not really for the context menu :-/
1803 "helper_tools", // clang-format break
1804 QT_TR_NOOP("Generate Content"),
1805 QT_TR_NOOP("Various helper tools to generate or modify objects"),
1806 ":/img/actions/wizard.png",
1808 {},
1810 };
1811};
1812
1813/*******************************************************************************
1814 * End of File
1815 ******************************************************************************/
1816
1817} // namespace editor
1818} // namespace librepcb
1819
1820#endif
Category for librepcb::editor::EditorCommand.
Definition editorcommandcategory.h:42
void updateTranslations() noexcept
Definition editorcommandcategory.h:66
Command for editors, e.g. to be added to a QMenu.
Definition editorcommand.h:42
void updateTranslations() noexcept
Definition editorcommand.cpp:102
Collection of all commands across all editors.
Definition editorcommandset.h:49
EditorCommand applicationQuit
Definition editorcommandset.h:1624
EditorCommand dockPages
Definition editorcommandset.h:1512
EditorCommand controlPanel
Definition editorcommandset.h:165
EditorCommand toolPadBga
Definition editorcommandset.h:1041
EditorCommand save
Definition editorcommandset.h:102
EditorCommand toolPin
Definition editorcommandset.h:1005
EditorCommand sizeIncrease
Definition editorcommandset.h:1252
EditorCommand toolGenerateOutline
Definition editorcommandset.h:1159
EditorCommand zoomFitContent
Definition editorcommandset.h:840
EditorCommand shapeRoundedRect
Definition editorcommandset.h:1425
EditorCommand projectCloseAll
Definition editorcommandset.h:1615
EditorCommand layerDown
Definition editorcommandset.h:1225
EditorCommand tabClose
Definition editorcommandset.h:1579
EditorCommand print
Definition editorcommandset.h:550
EditorCommandCategory categoryTextInput
Definition editorcommandset.h:410
EditorCommandCategory categoryHelp
Definition editorcommandset.h:1634
EditorCommand alignVerticalTop
Definition editorcommandset.h:1360
EditorCommand toolPadEdgeConnector
Definition editorcommandset.h:1050
EditorCommand flipVertical
Definition editorcommandset.h:744
EditorCommand generateBom
Definition editorcommandset.h:559
EditorCommand sheetNew
Definition editorcommandset.h:319
EditorCommand gridProperties
Definition editorcommandset.h:264
EditorCommand inputAcceptAdd
Definition editorcommandset.h:439
EditorCommand componentGnd
Definition editorcommandset.h:1491
EditorCommand toolLine
Definition editorcommandset.h:933
EditorCommand componentResistor
Definition editorcommandset.h:1455
EditorCommand moveLeft
Definition editorcommandset.h:662
EditorCommand itemOpen
Definition editorcommandset.h:93
EditorCommand abort
Definition editorcommandset.h:1207
EditorCommand clipboardPaste
Definition editorcommandset.h:653
EditorCommandCategory categoryComponents
Definition editorcommandset.h:1453
EditorCommand openProductWebsite
Definition editorcommandset.h:1783
EditorCommand toolText
Definition editorcommandset.h:978
EditorCommandCategory categoryTools
Definition editorcommandset.h:922
EditorCommand toolPadLocalFiducial
Definition editorcommandset.h:1068
EditorCommand unlock
Definition editorcommandset.h:782
EditorCommand toolWire
Definition editorcommandset.h:1104
EditorCommand copyMpnToClipboard
Definition editorcommandset.h:1774
EditorCommand mirrorHorizontal
Definition editorcommandset.h:716
EditorCommand componentInductor
Definition editorcommandset.h:1464
EditorCommandCategory categoryDocks
Definition editorcommandset.h:1510
EditorCommand projectNew
Definition editorcommandset.h:228
EditorCommand toolMeasure
Definition editorcommandset.h:1186
EditorCommand sheetRename
Definition editorcommandset.h:328
EditorCommand rotateCw
Definition editorcommandset.h:707
EditorCommand schematicEditor
Definition editorcommandset.h:310
EditorCommand runDesignRuleCheck
Definition editorcommandset.h:291
EditorCommandCategory categoryWindowManagement
Definition editorcommandset.h:1558
EditorCommand pageNext
Definition editorcommandset.h:1561
EditorCommand libraryElementDuplicate
Definition editorcommandset.h:219
EditorCommand toolPadTest
Definition editorcommandset.h:1059
EditorCommand website
Definition editorcommandset.h:1654
EditorCommand redo
Definition editorcommandset.h:625
EditorCommand drillDecrease
Definition editorcommandset.h:1279
EditorCommand exportImage
Definition editorcommandset.h:514
EditorCommand mirrorVertical
Definition editorcommandset.h:725
EditorCommand zoomIn
Definition editorcommandset.h:849
EditorCommand favoriteAdd
Definition editorcommandset.h:1693
EditorCommand boardRemove
Definition editorcommandset.h:373
EditorCommand toolPadThermal
Definition editorcommandset.h:1032
EditorCommand locked
Definition editorcommandset.h:1756
EditorCommand projectOpen
Definition editorcommandset.h:237
EditorCommand toggle3d
Definition editorcommandset.h:912
EditorCommand commandToolBarFocus
Definition editorcommandset.h:1198
EditorCommand pagePrevious
Definition editorcommandset.h:1570
EditorCommand toolSelect
Definition editorcommandset.h:924
void updateTranslations() noexcept
Definition editorcommandset.h:64
EditorCommand wireMode9045
Definition editorcommandset.h:1389
EditorCommand runQuickCheck
Definition editorcommandset.h:282
EditorCommand workspaceSettings
Definition editorcommandset.h:183
EditorCommand rename
Definition editorcommandset.h:819
EditorCommand vertexAdd
Definition editorcommandset.h:1711
EditorCommand helperTools
Definition editorcommandset.h:1801
EditorCommand toolCircle
Definition editorcommandset.h:960
EditorCommand importEagleLibrary
Definition editorcommandset.h:469
EditorCommand grabAreaToggle
Definition editorcommandset.h:1306
EditorCommand exportStep
Definition editorcommandset.h:541
EditorCommand drillIncrease
Definition editorcommandset.h:1270
EditorCommand layerUp
Definition editorcommandset.h:1216
EditorCommand inputRemove
Definition editorcommandset.h:430
EditorCommand saveAll
Definition editorcommandset.h:111
EditorCommand planeHideAll
Definition editorcommandset.h:391
EditorCommand toolComponent
Definition editorcommandset.h:1123
EditorCommand workspaceSwitch
Definition editorcommandset.h:174
EditorCommand wireMode4590
Definition editorcommandset.h:1398
EditorCommand properties
Definition editorcommandset.h:810
EditorCommand toolPolygon
Definition editorcommandset.h:951
EditorCommand generateD356Netlist
Definition editorcommandset.h:586
EditorCommand boardNew
Definition editorcommandset.h:355
EditorCommandCategory categoryView
Definition editorcommandset.h:838
EditorCommand flipHorizontal
Definition editorcommandset.h:734
EditorCommand toolPadGlobalFiducial
Definition editorcommandset.h:1077
EditorCommand libraryElementNew
Definition editorcommandset.h:210
EditorCommand showPinNumbers
Definition editorcommandset.h:885
EditorCommandCategory categoryEditor
Definition editorcommandset.h:82
EditorCommand inputBrowse
Definition editorcommandset.h:412
EditorCommand exportPdf
Definition editorcommandset.h:523
EditorCommand dockDrc
Definition editorcommandset.h:1530
EditorCommand setLineWidth
Definition editorcommandset.h:791
EditorCommand favoriteRemove
Definition editorcommandset.h:1702
EditorCommand lineWidthDecrease
Definition editorcommandset.h:1243
EditorCommand aboutQt
Definition editorcommandset.h:1645
EditorCommand alignVerticalBottom
Definition editorcommandset.h:1342
EditorCommand componentCapacitorUnipolar
Definition editorcommandset.h:1482
EditorCommandCategory categoryContextMenu
Definition editorcommandset.h:1682
EditorCommandCategory categoryCommands
Definition editorcommandset.h:1196
~EditorCommandSet() noexcept
Definition editorcommandset.h:56
EditorCommand generateFabricationData
Definition editorcommandset.h:568
EditorCommandSet() noexcept
Definition editorcommandset.h:55
EditorCommand toolName
Definition editorcommandset.h:987
EditorCommand componentVcc
Definition editorcommandset.h:1500
EditorCommand moveUp
Definition editorcommandset.h:680
EditorCommand openPricingWebsite
Definition editorcommandset.h:1792
EditorCommand workspaceLibrariesRescan
Definition editorcommandset.h:192
EditorCommand traceRemoveWhole
Definition editorcommandset.h:1747
EditorCommand boardEditor
Definition editorcommandset.h:346
EditorCommand lineWidthIncrease
Definition editorcommandset.h:1234
EditorCommand deviceResetTextAll
Definition editorcommandset.h:801
EditorCommand toolValue
Definition editorcommandset.h:996
EditorCommand toolPadTht
Definition editorcommandset.h:1014
EditorCommand projectSetup
Definition editorcommandset.h:255
EditorCommand toolHole
Definition editorcommandset.h:1095
EditorCommand snapToGrid
Definition editorcommandset.h:764
QList< EditorCommandCategory * > getCategories() noexcept
Definition editorcommandset.h:73
EditorCommand sheetRemove
Definition editorcommandset.h:337
EditorCommand tabCloseAll
Definition editorcommandset.h:1588
EditorCommand boardCopy
Definition editorcommandset.h:364
EditorCommand moveRight
Definition editorcommandset.h:671
EditorCommand dockLayers
Definition editorcommandset.h:1539
EditorCommand sizeDecrease
Definition editorcommandset.h:1261
EditorCommand find
Definition editorcommandset.h:129
EditorCommand keyboardShortcutsReference
Definition editorcommandset.h:1672
EditorCommand remove
Definition editorcommandset.h:828
EditorCommand vertexRemove
Definition editorcommandset.h:1720
EditorCommand itemNew
Definition editorcommandset.h:84
EditorCommand toolPadSmt
Definition editorcommandset.h:1023
EditorCommand toggleBackgroundImage
Definition editorcommandset.h:903
EditorCommand importEagleProject
Definition editorcommandset.h:478
EditorCommand visible
Definition editorcommandset.h:1765
EditorCommand toolZone
Definition editorcommandset.h:1086
EditorCommand toolTrace
Definition editorcommandset.h:1132
EditorCommandCategory categoryRoot
Definition editorcommandset.h:53
EditorCommand widthAutoToggle
Definition editorcommandset.h:1288
EditorCommand moveAlign
Definition editorcommandset.h:754
EditorCommand fillToggle
Definition editorcommandset.h:1297
EditorCommand aboutLibrePcb
Definition editorcommandset.h:1636
EditorCommand findPrevious
Definition editorcommandset.h:147
EditorCommand alignVerticalCenter
Definition editorcommandset.h:1351
EditorCommand alignHorizontalLeft
Definition editorcommandset.h:1315
EditorCommand toolGenerateCourtyard
Definition editorcommandset.h:1168
EditorCommand toolReNumberPads
Definition editorcommandset.h:1177
EditorCommand selectAll
Definition editorcommandset.h:120
EditorCommand gridDecrease
Definition editorcommandset.h:876
EditorCommand alignHorizontalRight
Definition editorcommandset.h:1333
EditorCommand planeRebuildAll
Definition editorcommandset.h:400
EditorCommand projectSave
Definition editorcommandset.h:246
EditorCommand boardSetup
Definition editorcommandset.h:273
static EditorCommandSet & instance() noexcept
Definition editorcommandset.h:60
EditorCommand zoomOut
Definition editorcommandset.h:858
EditorCommand inputUnitChange
Definition editorcommandset.h:421
EditorCommand findNext
Definition editorcommandset.h:138
EditorCommand libraryManager
Definition editorcommandset.h:201
EditorCommand addExampleProjects
Definition editorcommandset.h:451
EditorCommand exportLppz
Definition editorcommandset.h:505
EditorCommand gridIncrease
Definition editorcommandset.h:867
EditorCommand exportSpecctraDsn
Definition editorcommandset.h:532
EditorCommand clipboardCut
Definition editorcommandset.h:635
EditorCommand wireModeVH
Definition editorcommandset.h:1379
EditorCommand projectLibraryUpdate
Definition editorcommandset.h:300
EditorCommand toolVia
Definition editorcommandset.h:1141
EditorCommand outputJobs
Definition editorcommandset.h:595
EditorCommandCategory categoryImportExport
Definition editorcommandset.h:449
EditorCommand componentCapacitorBipolar
Definition editorcommandset.h:1473
EditorCommand planeShowAll
Definition editorcommandset.h:382
EditorCommand toolRect
Definition editorcommandset.h:942
EditorCommand toolArc
Definition editorcommandset.h:969
EditorCommand undo
Definition editorcommandset.h:616
QList< EditorCommand * > getCommands(const EditorCommandCategory *category) noexcept
Definition editorcommandset.h:76
EditorCommand traceSelectWhole
Definition editorcommandset.h:1729
EditorCommandCategory categoryModify
Definition editorcommandset.h:614
EditorCommand wireModeStraight
Definition editorcommandset.h:1407
EditorCommand generatePickPlace
Definition editorcommandset.h:577
EditorCommand documentationOnline
Definition editorcommandset.h:1663
EditorCommand fileManager
Definition editorcommandset.h:156
EditorCommand traceMeasureLength
Definition editorcommandset.h:1738
EditorCommand toolNetLabel
Definition editorcommandset.h:1114
EditorCommand toolPlane
Definition editorcommandset.h:1150
EditorCommand alignHorizontalCenter
Definition editorcommandset.h:1324
EditorCommand dockPlaceDevices
Definition editorcommandset.h:1548
EditorCommand rotateCcw
Definition editorcommandset.h:698
EditorCommand moveDown
Definition editorcommandset.h:689
EditorCommand clipboardCopy
Definition editorcommandset.h:644
EditorCommand shapeOctagon
Definition editorcommandset.h:1443
EditorCommand orderPcb
Definition editorcommandset.h:604
EditorCommand shapeRound
Definition editorcommandset.h:1416
EditorCommand shapeRect
Definition editorcommandset.h:1434
EditorCommand importKiCadLibrary
Definition editorcommandset.h:487
EditorCommand projectClose
Definition editorcommandset.h:1606
EditorCommand dockErc
Definition editorcommandset.h:1521
EditorCommand importSpecctraSes
Definition editorcommandset.h:496
EditorCommand windowClose
Definition editorcommandset.h:1597
EditorCommand ignoreLocks
Definition editorcommandset.h:894
EditorCommand folderNew
Definition editorcommandset.h:1684
EditorCommand importDxf
Definition editorcommandset.h:460
EditorCommand lock
Definition editorcommandset.h:773
EditorCommand wireModeHV
Definition editorcommandset.h:1369
Definition occmodel.cpp:77