LibrePCB Developers Documentation
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 "export_lppz", // clang-format break
489 QT_TR_NOOP("Export *.lppz Archive"),
490 QT_TR_NOOP("Export the project as a self-contained *.lppz archive"),
491 ":/img/actions/export_zip.png",
493 {},
495 };
497 "export_image", // clang-format break
498 QT_TR_NOOP("Export Image"),
499 QT_TR_NOOP("Export graphics as a pixmap"),
500 ":/img/actions/export_pixmap.png",
502 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_I)},
504 };
506 "export_pdf", // clang-format break
507 QT_TR_NOOP("Export PDF"),
508 QT_TR_NOOP("Export graphics as a PDF"),
509 ":/img/actions/pdf.png",
511 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_P)},
513 };
515 "export_step", // clang-format break
516 QT_TR_NOOP("Export STEP Model"),
517 QT_TR_NOOP("Export PCB as a STEP file for loading it into MCAD software"),
518 ":/img/actions/export_step.png",
520 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_T)},
522 };
524 "print", // clang-format break
525 QT_TR_NOOP("Print"),
526 QT_TR_NOOP("Send graphics to a printer"),
527 ":/img/actions/print.png",
529 {QKeySequence(Qt::CTRL | Qt::Key_P)},
531 };
533 "generate_bom", // clang-format break
534 QT_TR_NOOP("Generate Bill Of Materials"),
535 QT_TR_NOOP("Generate bill of materials (BOM) file"),
536 ":/img/actions/generate_bom.png",
538 {QKeySequence(Qt::Key_F9)},
540 };
542 "generate_fabrication_data", // clang-format break
543 QT_TR_NOOP("Generate Fabrication Data"),
544 QT_TR_NOOP("Generate Gerber/Excellon files for PCB fabrication"),
545 ":/img/actions/export_gerber.png",
547 {QKeySequence(Qt::Key_F10)},
549 };
551 "generate_pick_place", // clang-format break
552 QT_TR_NOOP("Generate Pick&&Place Files"),
553 QT_TR_NOOP("Generate pick&place files for automated PCB assembly"),
554 ":/img/actions/export_pick_place_file.png",
556 {}, // Was F11 until v0.1.7
558 };
560 "generate_d356_netlist", // clang-format break
561 QT_TR_NOOP("Generate IPC-D-356A Netlist"),
562 QT_TR_NOOP("Generate netlist file for automated PCB testing"),
563 ":/img/actions/generate_bom.png", // No netlist icon yet.
565 {},
567 };
569 "output_jobs", // clang-format break
570 QT_TR_NOOP("Output Jobs"),
571 QT_TR_NOOP("Modify or run output jobs"),
572 ":/img/actions/output_jobs.png",
574 {QKeySequence(Qt::Key_F11)},
576 };
578 "order_pcb", // clang-format break
579 QT_TR_NOOP("Order PCB"),
580 QT_TR_NOOP("Start ordering the PCB online"),
581 ":/img/actions/order_pcb.png",
583 {QKeySequence(Qt::Key_F12)},
585 };
586
587 EditorCommandCategory categoryModify{"categoryModify", QT_TR_NOOP("Modify"),
588 true, &categoryRoot};
590 "undo", // clang-format break
591 QT_TR_NOOP("Undo"),
592 QT_TR_NOOP("Revert the last modification"),
593 ":/img/actions/undo.png",
594 EditorCommand::Flags(),
595 {QKeySequence(Qt::CTRL | Qt::Key_Z)},
597 };
599 "redo", // clang-format break
600 QT_TR_NOOP("Redo"),
601 QT_TR_NOOP("Re-apply the last reverted modification"),
602 ":/img/actions/redo.png",
603 EditorCommand::Flags(),
604 {QKeySequence(Qt::CTRL | Qt::Key_Y),
605 QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Z)},
607 };
609 "clipboard_cut", // clang-format break
610 QT_TR_NOOP("Cut"),
611 QT_TR_NOOP("Cut the selected object(s) to clipboard"),
612 ":/img/actions/cut.png",
613 EditorCommand::Flags(),
614 {QKeySequence(Qt::CTRL | Qt::Key_X)},
616 };
618 "clipboard_copy", // clang-format break
619 QT_TR_NOOP("Copy"),
620 QT_TR_NOOP("Copy the selected object(s) to clipboard"),
621 ":/img/actions/copy.png",
622 EditorCommand::Flags(),
623 {QKeySequence(Qt::CTRL | Qt::Key_C)},
625 };
627 "clipboard_paste", // clang-format break
628 QT_TR_NOOP("Paste"),
629 QT_TR_NOOP("Paste object(s) from the clipboard"),
630 ":/img/actions/paste.png",
631 EditorCommand::Flags(),
632 {QKeySequence(Qt::CTRL | Qt::Key_V)},
634 };
636 "move_left", // clang-format break
637 QT_TR_NOOP("Move Left"),
638 QT_TR_NOOP("Move the selected object(s) to the left"),
639 QString(),
640 EditorCommand::Flags(),
641 {QKeySequence(Qt::Key_Left)},
643 };
645 "move_right", // clang-format break
646 QT_TR_NOOP("Move Right"),
647 QT_TR_NOOP("Move the selected object(s) to the right"),
648 QString(),
649 EditorCommand::Flags(),
650 {QKeySequence(Qt::Key_Right)},
652 };
654 "move_up", // clang-format break
655 QT_TR_NOOP("Move Up"),
656 QT_TR_NOOP("Move the selected object(s) up"),
657 QString(),
658 EditorCommand::Flags(),
659 {QKeySequence(Qt::Key_Up)},
661 };
663 "move_down", // clang-format break
664 QT_TR_NOOP("Move Down"),
665 QT_TR_NOOP("Move the selected object(s) down"),
666 QString(),
667 EditorCommand::Flags(),
668 {QKeySequence(Qt::Key_Down)},
670 };
672 "rotate_ccw", // clang-format break
673 QT_TR_NOOP("Rotate Counterclockwise"),
674 QT_TR_NOOP("Rotate the selected object(s) counterclockwise"),
675 ":/img/actions/rotate_left.png",
676 EditorCommand::Flags(),
677 {QKeySequence(Qt::Key_R)},
679 };
681 "rotate_cw", // clang-format break
682 QT_TR_NOOP("Rotate Clockwise"),
683 QT_TR_NOOP("Rotate the selected object(s) clockwise"),
684 ":/img/actions/rotate_right.png",
685 EditorCommand::Flags(),
686 {QKeySequence(Qt::SHIFT | Qt::Key_R)},
688 };
690 "mirror_horizontal", // clang-format break
691 QT_TR_NOOP("Mirror Horizontally"),
692 QT_TR_NOOP("Mirror the selected object(s) horizontally"),
693 ":/img/actions/mirror_horizontal.png",
694 EditorCommand::Flags(),
695 {QKeySequence(Qt::Key_M)},
697 };
699 "mirror_vertical", // clang-format break
700 QT_TR_NOOP("Mirror Vertically"),
701 QT_TR_NOOP("Mirror the selected object(s) vertically"),
702 ":/img/actions/mirror_vertical.png",
703 EditorCommand::Flags(),
704 {QKeySequence(Qt::SHIFT | Qt::Key_M)},
706 };
708 "flip_horizontal", // clang-format break
709 QT_TR_NOOP("Flip Horizontally"),
710 QT_TR_NOOP(
711 "Flip the selected object(s) horizontally to the other board side"),
712 ":/img/actions/flip_horizontal.png",
713 EditorCommand::Flags(),
714 {QKeySequence(Qt::Key_F)},
716 };
718 "flip_vertical", // clang-format break
719 QT_TR_NOOP("Flip Vertically"),
720 QT_TR_NOOP(
721 "Flip the selected object(s) vertically to the other board side"),
722 ":/img/actions/flip_vertical.png",
723 EditorCommand::Flags(),
724 {QKeySequence(Qt::SHIFT | Qt::Key_F)},
726 };
728 "snap_to_grid", // clang-format break
729 QT_TR_NOOP("Snap to Grid"),
730 QT_TR_NOOP("Move the selected object(s) to snap the grid"),
731 ":/img/actions/grid.png",
732 EditorCommand::Flags(),
733 {QKeySequence(Qt::Key_S)},
735 };
737 "lock", // clang-format break
738 QT_TR_NOOP("Lock Placement"),
739 QT_TR_NOOP("Lock the placement of the selected object(s)"),
740 ":/img/status/locked.png",
741 EditorCommand::Flags(),
742 {QKeySequence(Qt::CTRL | Qt::Key_L)},
744 };
746 "unlock", // clang-format break
747 QT_TR_NOOP("Unlock Placement"),
748 QT_TR_NOOP("Unlock the placement of the selected object(s)"),
749 ":/img/status/unlocked.png",
750 EditorCommand::Flags(),
751 {QKeySequence(Qt::CTRL | Qt::Key_U)},
753 };
755 "line_width_set", // clang-format break
756 QT_TR_NOOP("Set Line Width"),
757 QT_TR_NOOP(
758 "Change the line/trace/stroke width of the selected object(s)"),
759 QString(),
761 {},
763 };
765 "device_reset_text_all", // clang-format break
766 QT_TR_NOOP("Reset All Texts"),
767 QT_TR_NOOP("Reset all texts of the footprint to their initial state"),
768 ":/img/actions/undo.png",
769 EditorCommand::Flags(),
770 {},
772 };
774 "properties", // clang-format break
775 QT_TR_NOOP("Properties"),
776 QT_TR_NOOP("View/modify the object properties"),
777 ":/img/actions/settings.png",
779 {QKeySequence(Qt::Key_E)},
781 };
783 "rename", // clang-format break
784 QT_TR_NOOP("Rename"),
785 QT_TR_NOOP("Rename the selected object"),
786 ":/img/actions/edit.png",
787 EditorCommand::Flags(),
788 {QKeySequence(Qt::Key_F2)},
790 };
792 "remove", // clang-format break
793 QT_TR_NOOP("Remove"),
794 QT_TR_NOOP("Delete the selected object(s)"),
795 ":/img/actions/delete.png",
796 EditorCommand::Flags(),
797 {QKeySequence(Qt::Key_Delete)},
799 };
800
801 EditorCommandCategory categoryView{"categoryView", QT_TR_NOOP("View"), true,
802 &categoryRoot};
804 "zoom_fit_content", // clang-format break
805 QT_TR_NOOP("Zoom to Fit Contents"),
806 QT_TR_NOOP("Set the zoom level to fit the whole content"),
807 ":/img/actions/zoom_all.png",
808 EditorCommand::Flags(),
809 {QKeySequence(Qt::CTRL | Qt::Key_Home)},
811 };
813 "zoom_in", // clang-format break
814 QT_TR_NOOP("Zoom In"),
815 QT_TR_NOOP("Increase the zoom level"),
816 ":/img/actions/zoom_in.png",
817 EditorCommand::Flags(),
818 {QKeySequence(Qt::CTRL | Qt::Key_Plus)},
820 };
822 "zoom_out", // clang-format break
823 QT_TR_NOOP("Zoom Out"),
824 QT_TR_NOOP("Decrease the zoom level"),
825 ":/img/actions/zoom_out.png",
826 EditorCommand::Flags(),
827 {QKeySequence(Qt::CTRL | Qt::Key_Minus)},
829 };
831 "grid_increase", // clang-format break
832 QT_TR_NOOP("Increase Grid Interval"),
833 QT_TR_NOOP("Increase the grid interval"),
834 QString(),
835 EditorCommand::Flags(),
836 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Plus)},
838 };
840 "grid_decrease", // clang-format break
841 QT_TR_NOOP("Decrease Grid Interval"),
842 QT_TR_NOOP("Decrease the grid interval"),
843 QString(),
844 EditorCommand::Flags(),
845 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Minus)},
847 };
849 "show_pin_numbers", // clang-format break
850 QT_TR_NOOP("Show Pin Numbers"),
851 QT_TR_NOOP("Show or hide symbol pin numbers"),
852 ":/img/actions/show_pin_numbers.png",
853 EditorCommand::Flags(),
854 {QKeySequence()},
856 };
858 "ignore_locks", // clang-format break
859 QT_TR_NOOP("Ignore Placement Locks"),
860 QT_TR_NOOP("Allow dragging locked items"),
861 ":/img/status/unlocked.png",
862 EditorCommand::Flags(),
863 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_L)},
865 };
867 "toggle_3d", // clang-format break
868 QT_TR_NOOP("Toggle 2D/3D Mode"),
869 QT_TR_NOOP("Switch between 2D and 3D viewer mode"),
870 ":/img/actions/view_3d.png",
871 EditorCommand::Flags(),
872 {QKeySequence(Qt::CTRL | Qt::Key_3)},
874 };
875
876 EditorCommandCategory categoryTools{"categoryTools", QT_TR_NOOP("Tools"),
877 true, &categoryRoot};
879 "tool_select", // clang-format break
880 QT_TR_NOOP("Select"),
881 QT_TR_NOOP("Select & modify existing objects"),
882 ":/img/actions/select.png",
883 EditorCommand::Flags(),
884 {},
886 };
888 "tool_line", // clang-format break
889 QT_TR_NOOP("Draw Line"),
890 QT_TR_NOOP("Draw graphical lines"),
891 ":/img/actions/draw_line.png",
892 EditorCommand::Flags(),
893 {QKeySequence(Qt::Key_L)},
895 };
897 "tool_rect", // clang-format break
898 QT_TR_NOOP("Draw Rectangle"),
899 QT_TR_NOOP("Draw graphical rectangles"),
900 ":/img/actions/draw_rectangle.png",
901 EditorCommand::Flags(),
902 {QKeySequence(Qt::Key_G)},
904 };
906 "tool_polygon", // clang-format break
907 QT_TR_NOOP("Draw Polygon"),
908 QT_TR_NOOP("Draw graphical polygons"),
909 ":/img/actions/draw_polygon.png",
910 EditorCommand::Flags(),
911 {QKeySequence(Qt::Key_P)},
913 };
915 "tool_circle", // clang-format break
916 QT_TR_NOOP("Draw Circle"),
917 QT_TR_NOOP("Draw graphical circles"),
918 ":/img/actions/draw_circle.png",
919 EditorCommand::Flags(),
920 {QKeySequence(Qt::Key_C)},
922 };
924 "tool_arc", // clang-format break
925 QT_TR_NOOP("Draw Arc"),
926 QT_TR_NOOP("Draw graphical arcs"),
927 ":/img/actions/draw_arc.png",
928 EditorCommand::Flags(),
929 {QKeySequence(Qt::SHIFT | Qt::Key_C)},
931 };
933 "tool_text", // clang-format break
934 QT_TR_NOOP("Add Text"),
935 QT_TR_NOOP("Add graphical text objects"),
936 ":/img/actions/add_text.png",
937 EditorCommand::Flags(),
938 {QKeySequence(Qt::Key_T)},
940 };
942 "tool_name", // clang-format break
943 QT_TR_NOOP("Add Name"),
944 QT_TR_NOOP("Add graphical text objects for '{{NAME}}'"),
945 ":/img/actions/add_name.png",
946 EditorCommand::Flags(),
947 {QKeySequence(Qt::Key_N)},
949 };
951 "tool_value", // clang-format break
952 QT_TR_NOOP("Add Value"),
953 QT_TR_NOOP("Add graphical text objects for '{{VALUE}}'"),
954 ":/img/actions/add_value.png",
955 EditorCommand::Flags(),
956 {QKeySequence(Qt::Key_V)},
958 };
960 "tool_pin", // clang-format break
961 QT_TR_NOOP("Add Pin"),
962 QT_TR_NOOP("Add symbol pins (electrical connections for schematics)"),
963 ":/img/actions/add_symbol_pin.png",
964 EditorCommand::Flags(),
965 {QKeySequence(Qt::Key_I)},
967 };
969 "tool_pad_tht", // clang-format break
970 QT_TR_NOOP("Add THT Pad"),
971 QT_TR_NOOP("Add plated through-hole copper pads"),
972 ":/img/actions/add_tht_pad.png",
973 EditorCommand::Flags(),
974 {QKeySequence(Qt::Key_H)},
976 };
978 "tool_pad_smt", // clang-format break
979 QT_TR_NOOP("Add SMT Pad"),
980 QT_TR_NOOP("Add surface mounted (single layer) copper pads"),
981 ":/img/actions/add_smt_pad.png",
982 EditorCommand::Flags(),
983 {QKeySequence(Qt::Key_D)},
985 };
987 "tool_pad_thermal", // clang-format break
988 QT_TR_NOOP("Add Thermal Pad"),
989 QT_TR_NOOP("Add special SMT pads used as heat sink"),
990 QString(),
991 EditorCommand::Flags(),
992 {},
994 };
996 "tool_pad_bga", // clang-format break
997 QT_TR_NOOP("Add BGA Pad"),
998 QT_TR_NOOP("Add special SMT pads used for ball grid arrays"),
999 QString(),
1000 EditorCommand::Flags(),
1001 {},
1003 };
1005 "tool_pad_edge_connector", // clang-format break
1006 QT_TR_NOOP("Add Edge Connector Pad"),
1007 QT_TR_NOOP("Add special SMT pads used as edge connector"),
1008 QString(),
1009 EditorCommand::Flags(),
1010 {},
1012 };
1014 "tool_pad_test_point", // clang-format break
1015 QT_TR_NOOP("Add Test Pad"),
1016 QT_TR_NOOP("Add special SMT pads used as test points"),
1017 QString(),
1018 EditorCommand::Flags(),
1019 {},
1021 };
1023 "tool_pad_local_fiducial", // clang-format break
1024 QT_TR_NOOP("Add Local Fiducial Pad"),
1025 QT_TR_NOOP("Add special SMT pads used as local fiducials"),
1026 QString(),
1027 EditorCommand::Flags(),
1028 {},
1030 };
1032 "tool_pad_global_fiducial", // clang-format break
1033 QT_TR_NOOP("Add Global Fiducial Pad"),
1034 QT_TR_NOOP("Add special SMT pads used as global fiducials"),
1035 QString(),
1036 EditorCommand::Flags(),
1037 {},
1039 };
1041 "tool_zone", // clang-format break
1042 QT_TR_NOOP("Draw Keepout Zone"),
1043 QT_TR_NOOP("Draw keep-out zones"),
1044 ":/img/actions/draw_zone.png",
1045 EditorCommand::Flags(),
1046 {QKeySequence(Qt::Key_Z)},
1048 };
1050 "tool_hole", // clang-format break
1051 QT_TR_NOOP("Add Hole"),
1052 QT_TR_NOOP("Add non-plated holes (NPTH drills)"),
1053 ":/img/actions/add_hole.png",
1054 EditorCommand::Flags(),
1055 {QKeySequence(Qt::Key_O)},
1057 };
1059 "tool_wire", // clang-format break
1060 QT_TR_NOOP("Draw Wire"),
1061 QT_TR_NOOP(
1062 "Draw wires to create electrical connections between symbol pins"),
1063 ":/img/actions/draw_wire.png",
1064 EditorCommand::Flags(),
1065 {QKeySequence(Qt::Key_W)},
1067 };
1069 "tool_netlabel", // clang-format break
1070 QT_TR_NOOP("Add Net Label"),
1071 QT_TR_NOOP("Add net labels to explicitly specify the net of wires"),
1072 ":/img/actions/draw_netlabel.png",
1073 EditorCommand::Flags(),
1074 {QKeySequence(Qt::Key_N)},
1076 };
1078 "tool_component", // clang-format break
1079 QT_TR_NOOP("Add Component"),
1080 QT_TR_NOOP("Insert components from the workspace libraries"),
1081 ":/img/actions/add_component.png",
1083 {QKeySequence(Qt::Key_A)},
1085 };
1087 "tool_trace", // clang-format break
1088 QT_TR_NOOP("Draw Trace"),
1089 QT_TR_NOOP("Draw copper traces to interconnect devices"),
1090 ":/img/actions/draw_wire.png",
1091 EditorCommand::Flags(),
1092 {QKeySequence(Qt::Key_W)},
1094 };
1096 "tool_via", // clang-format break
1097 QT_TR_NOOP("Add Via"),
1098 QT_TR_NOOP("Add plated through-hole vias"),
1099 ":/img/actions/add_via.png",
1100 EditorCommand::Flags(),
1101 {QKeySequence(Qt::Key_V)},
1103 };
1105 "tool_plane", // clang-format break
1106 QT_TR_NOOP("Draw Plane"),
1107 QT_TR_NOOP("Draw auto-filled copper areas to interconnect pads and vias"),
1108 ":/img/actions/add_plane.png",
1109 EditorCommand::Flags(),
1110 {QKeySequence(Qt::Key_N)},
1112 };
1114 "tool_generate_outline", // clang-format break
1115 QT_TR_NOOP("Generate Outline"),
1116 QT_TR_NOOP("Automatically generate the outline polygon"),
1117 ":/img/actions/wizard.png",
1118 EditorCommand::Flags(),
1119 {},
1121 };
1123 "tool_generate_courtyard", // clang-format break
1124 QT_TR_NOOP("Generate Courtyard"),
1125 QT_TR_NOOP("Automatically generate the courtyard polygon"),
1126 ":/img/actions/wizard.png",
1128 {},
1130 };
1132 "tool_measure", // clang-format break
1133 QT_TR_NOOP("Measure Distance"),
1134 QT_TR_NOOP("Measure the distance between two points"),
1135 ":/img/actions/ruler.png",
1136 EditorCommand::Flags(),
1137 {QKeySequence(Qt::CTRL | Qt::Key_M)},
1139 };
1140
1142 "categoryCommands", QT_TR_NOOP("Commands"), true, &categoryRoot};
1144 "command_toolbar_focus", // clang-format break
1145 QT_TR_NOOP("Go To Command Toolbar"),
1146 QT_TR_NOOP("Move the focus into the command toolbar"),
1147 QString(),
1148 EditorCommand::Flags(),
1149 {QKeySequence(Qt::Key_Tab)},
1151 };
1153 "abort", // clang-format break
1154 QT_TR_NOOP("Abort Command"),
1155 QT_TR_NOOP("Abort the currently active command"),
1156 ":/img/actions/stop.png",
1157 EditorCommand::Flags(),
1158 {QKeySequence(Qt::Key_Escape)},
1160 };
1162 "layer_up", // clang-format break
1163 QT_TR_NOOP("Layer Up"),
1164 QT_TR_NOOP("Switch to the next higher layer (bottom->top)"),
1165 QString(),
1166 EditorCommand::Flags(),
1167 {QKeySequence(Qt::Key_PageUp)},
1169 };
1171 "layer_down", // clang-format break
1172 QT_TR_NOOP("Layer Down"),
1173 QT_TR_NOOP("Switch to the next lower layer (top->bottom)"),
1174 QString(),
1175 EditorCommand::Flags(),
1176 {QKeySequence(Qt::Key_PageDown)},
1178 };
1180 "line_width_increase", // clang-format break
1181 QT_TR_NOOP("Increase Line Width"),
1182 QT_TR_NOOP("Increase the line/trace/stroke/pad width"),
1183 QString(),
1184 EditorCommand::Flags(),
1185 {QKeySequence(Qt::Key_Plus)},
1187 };
1189 "line_width_decrease", // clang-format break
1190 QT_TR_NOOP("Decrease Line Width"),
1191 QT_TR_NOOP("Decrease the line/trace/stroke/pad width"),
1192 QString(),
1193 EditorCommand::Flags(),
1194 {QKeySequence(Qt::Key_Minus)},
1196 };
1198 "size_increase", // clang-format break
1199 QT_TR_NOOP("Increase Size"),
1200 QT_TR_NOOP("Increase the via/pad/pin/text size"),
1201 QString(),
1202 EditorCommand::Flags(),
1203 {QKeySequence(Qt::Key_Asterisk)},
1205 };
1207 "size_decrease", // clang-format break
1208 QT_TR_NOOP("Decrease Size"),
1209 QT_TR_NOOP("Decrease the via/pad/pin/text size"),
1210 QString(),
1211 EditorCommand::Flags(),
1212 {QKeySequence(Qt::Key_Slash)},
1214 };
1216 "drill_increase", // clang-format break
1217 QT_TR_NOOP("Increase Drill"),
1218 QT_TR_NOOP("Increase the via/pad/hole drill diameter"),
1219 QString(),
1220 EditorCommand::Flags(),
1221 {QKeySequence(Qt::Key_Home)},
1223 };
1225 "drill_decrease", // clang-format break
1226 QT_TR_NOOP("Decrease Drill"),
1227 QT_TR_NOOP("Decrease the via/pad/hole drill diameter"),
1228 QString(),
1229 EditorCommand::Flags(),
1230 {QKeySequence(Qt::Key_End)},
1232 };
1234 "width_auto_toggle", // clang-format break
1235 QT_TR_NOOP("Toggle Auto-Width"),
1236 QT_TR_NOOP("Toggle the auto-width property state"),
1237 QString(),
1238 EditorCommand::Flags(),
1239 {QKeySequence(Qt::Key_Period)},
1241 };
1243 "fill_toggle", // clang-format break
1244 QT_TR_NOOP("Toggle Fill"),
1245 QT_TR_NOOP("Toggle the fill property state"),
1246 QString(),
1247 EditorCommand::Flags(),
1248 {QKeySequence(Qt::Key_F)},
1250 };
1252 "grab_area_toggle", // clang-format break
1253 QT_TR_NOOP("Toggle Grab Area"),
1254 QT_TR_NOOP("Toggle the grab area property state"),
1255 QString(),
1256 EditorCommand::Flags(),
1257 {QKeySequence(Qt::Key_Comma)},
1259 };
1261 "align_horizontal_left", // clang-format break
1262 QT_TR_NOOP("Align Left"),
1263 QT_TR_NOOP("Horizontal alignment: Left"),
1264 ":/img/command_toolbars/align_horizontal_left.png",
1265 EditorCommand::Flags(),
1266 {QKeySequence(Qt::Key_1)},
1268 };
1270 "align_horizontal_center", // clang-format break
1271 QT_TR_NOOP("Align Center"),
1272 QT_TR_NOOP("Horizontal alignment: Center"),
1273 ":/img/command_toolbars/align_horizontal_center.png",
1274 EditorCommand::Flags(),
1275 {QKeySequence(Qt::Key_2)},
1277 };
1279 "align_horizontal_right", // clang-format break
1280 QT_TR_NOOP("Align Right"),
1281 QT_TR_NOOP("Horizontal alignment: Right"),
1282 ":/img/command_toolbars/align_horizontal_right.png",
1283 EditorCommand::Flags(),
1284 {QKeySequence(Qt::Key_3)},
1286 };
1288 "align_vertical_bottom", // clang-format break
1289 QT_TR_NOOP("Align Bottom"),
1290 QT_TR_NOOP("Vertical alignment: Bottom"),
1291 ":/img/command_toolbars/align_vertical_bottom.png",
1292 EditorCommand::Flags(),
1293 {QKeySequence(Qt::Key_4)},
1295 };
1297 "align_vertical_center", // clang-format break
1298 QT_TR_NOOP("Align Center"),
1299 QT_TR_NOOP("Vertical alignment: Center"),
1300 ":/img/command_toolbars/align_vertical_center.png",
1301 EditorCommand::Flags(),
1302 {QKeySequence(Qt::Key_5)},
1304 };
1306 "align_vertical_top", // clang-format break
1307 QT_TR_NOOP("Align Top"),
1308 QT_TR_NOOP("Vertical alignment: Top"),
1309 ":/img/command_toolbars/align_vertical_top.png",
1310 EditorCommand::Flags(),
1311 {QKeySequence(Qt::Key_6)},
1313 };
1315 "wire_mode_h_v", // clang-format break
1316 QT_TR_NOOP("Horizontal - Vertical"),
1317 QT_TR_NOOP(
1318 "Wire mode: First segment horizontal, second segment vertical"),
1319 ":/img/command_toolbars/wire_h_v.png",
1320 EditorCommand::Flags(),
1321 {QKeySequence(Qt::Key_1)},
1323 };
1325 "wire_mode_v_h", // clang-format break
1326 QT_TR_NOOP("Vertical - Horizontal"),
1327 QT_TR_NOOP(
1328 "Wire mode: First segment vertical, second segment horizontal"),
1329 ":/img/command_toolbars/wire_v_h.png",
1330 EditorCommand::Flags(),
1331 {QKeySequence(Qt::Key_2)},
1333 };
1335 "wire_mode_90_45", // clang-format break
1336 QT_TR_NOOP("90° - 45°"),
1337 QT_TR_NOOP("Wire mode: First segment 90°, second segment 45°"),
1338 ":/img/command_toolbars/wire_90_45.png",
1339 EditorCommand::Flags(),
1340 {QKeySequence(Qt::Key_3)},
1342 };
1344 "wire_mode_45_90", // clang-format break
1345 QT_TR_NOOP("45° - 90°"),
1346 QT_TR_NOOP("Wire mode: First segment 45°, second segment 90°"),
1347 ":/img/command_toolbars/wire_45_90.png",
1348 EditorCommand::Flags(),
1349 {QKeySequence(Qt::Key_4)},
1351 };
1353 "wire_mode_straight", // clang-format break
1354 QT_TR_NOOP("Straight"),
1355 QT_TR_NOOP("Wire mode: Straight line"),
1356 ":/img/command_toolbars/wire_straight.png",
1357 EditorCommand::Flags(),
1358 {QKeySequence(Qt::Key_5)},
1360 };
1362 "shape_round", // clang-format break
1363 QT_TR_NOOP("Round"),
1364 QT_TR_NOOP("Shape: Round"),
1365 ":/img/command_toolbars/shape_round.png",
1366 EditorCommand::Flags(),
1367 {QKeySequence(Qt::Key_1)},
1369 };
1371 "shape_rounded_rect", // clang-format break
1372 QT_TR_NOOP("Rounded Rectangle"),
1373 QT_TR_NOOP("Shape: Rounded Rectangle"),
1374 ":/img/command_toolbars/shape_rounded_rect.png",
1375 EditorCommand::Flags(),
1376 {QKeySequence(Qt::Key_2)},
1378 };
1380 "shape_rect", // clang-format break
1381 QT_TR_NOOP("Rectangle"),
1382 QT_TR_NOOP("Shape: Rectangle"),
1383 ":/img/command_toolbars/shape_rect.png",
1384 EditorCommand::Flags(),
1385 {QKeySequence(Qt::Key_3)},
1387 };
1389 "shape_octagon", // clang-format break
1390 QT_TR_NOOP("Octagon"),
1391 QT_TR_NOOP("Shape: Octagon"),
1392 ":/img/command_toolbars/shape_octagon.png",
1393 EditorCommand::Flags(),
1394 {QKeySequence(Qt::Key_4)},
1396 };
1397
1399 "categoryComponents", QT_TR_NOOP("Components"), true, &categoryRoot};
1401 "component_resistor", // clang-format break
1402 QT_TR_NOOP("Resistor"),
1403 QT_TR_NOOP("Add standard component: Resistor"),
1404 ":/img/library/resistor_eu.png",
1405 EditorCommand::Flags(),
1406 {},
1408 };
1410 "component_inductor", // clang-format break
1411 QT_TR_NOOP("Inductor"),
1412 QT_TR_NOOP("Add standard component: Inductor"),
1413 ":/img/library/inductor_eu.png",
1414 EditorCommand::Flags(),
1415 {},
1417 };
1419 "component_capacitor_bipolar", // clang-format break
1420 QT_TR_NOOP("Bipolar Capacitor"),
1421 QT_TR_NOOP("Add standard component: Bipolar capacitor"),
1422 ":/img/library/bipolar_capacitor_eu.png",
1423 EditorCommand::Flags(),
1424 {},
1426 };
1428 "component_capacitor_unipolar", // clang-format break
1429 QT_TR_NOOP("Unipolar Capacitor"),
1430 QT_TR_NOOP("Add standard component: Unipolar capacitor"),
1431 ":/img/library/unipolar_capacitor_eu.png",
1432 EditorCommand::Flags(),
1433 {},
1435 };
1437 "component_gnd", // clang-format break
1438 QT_TR_NOOP("GND Supply"),
1439 QT_TR_NOOP("Add standard component: GND supply"),
1440 ":/img/library/gnd.png",
1441 EditorCommand::Flags(),
1442 {},
1444 };
1446 "component_vcc", // clang-format break
1447 QT_TR_NOOP("VCC Supply"),
1448 QT_TR_NOOP("Add standard component: VCC supply"),
1449 ":/img/library/vcc.png",
1450 EditorCommand::Flags(),
1451 {},
1453 };
1454
1455 EditorCommandCategory categoryDocks{"categoryDocks", QT_TR_NOOP("Docks"),
1456 true, &categoryRoot};
1458 "dock_pages", // clang-format break
1459 QT_TR_NOOP("Pages"),
1460 QT_TR_NOOP("Go to the pages dock"),
1461 QString(),
1462 EditorCommand::Flags(),
1463 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_G)},
1465 };
1467 "dock_erc", // clang-format break
1468 QT_TR_NOOP("Electrical Rule Check (ERC)"),
1469 QT_TR_NOOP("Go to the ERC messages dock"),
1470 QString(),
1471 EditorCommand::Flags(),
1472 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_E)},
1474 };
1476 "dock_drc", // clang-format break
1477 QT_TR_NOOP("Design Rule Check (DRC)"),
1478 QT_TR_NOOP("Go to the DRC messages dock"),
1479 QString(),
1480 EditorCommand::Flags(),
1481 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_D)},
1483 };
1485 "dock_layers", // clang-format break
1486 QT_TR_NOOP("Layers"),
1487 QT_TR_NOOP("Go to the layers dock"),
1488 QString(),
1489 EditorCommand::Flags(),
1490 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_L)},
1492 };
1494 "dock_place_devices", // clang-format break
1495 QT_TR_NOOP("Place Devices"),
1496 QT_TR_NOOP("Go to the dock for placing devices"),
1497 QString(),
1498 EditorCommand::Flags(),
1499 {QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_P)},
1501 };
1502
1504 "categoryWindowManagement", QT_TR_NOOP("Window Management"), true,
1505 &categoryRoot};
1507 "page_next", // clang-format break
1508 QT_TR_NOOP("Next Tab/Page"),
1509 QT_TR_NOOP("Navigate to the next tab or page"),
1510 QString(),
1511 EditorCommand::Flags(),
1512 {QKeySequence(Qt::CTRL | Qt::Key_Tab)},
1514 };
1516 "page_previous", // clang-format break
1517 QT_TR_NOOP("Previous Tab/Page"),
1518 QT_TR_NOOP("Navigate to the previous tab or page"),
1519 QString(),
1520 EditorCommand::Flags(),
1521 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Tab)},
1523 };
1525 "tab_close", // clang-format break
1526 QT_TR_NOOP("Close Tab"),
1527 QT_TR_NOOP("Close the currently opened tab"),
1528 QString(),
1529 EditorCommand::Flags(),
1530 {QKeySequence(Qt::CTRL | Qt::Key_W)},
1532 };
1534 "tab_close_all", // clang-format break
1535 QT_TR_NOOP("Close All Tabs"),
1536 QT_TR_NOOP("Close all currently opened tabs"),
1537 QString(),
1538 EditorCommand::Flags(),
1539 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_W)},
1541 };
1543 "window_close", // clang-format break
1544 QT_TR_NOOP("Close Window"),
1545 QT_TR_NOOP("Close this window"),
1546 QString(),
1547 EditorCommand::Flags(),
1548 {QKeySequence(Qt::ALT | Qt::Key_F4)},
1550 };
1552 "project_close", // clang-format break
1553 QT_TR_NOOP("Close Project"),
1554 QT_TR_NOOP("Close the currently opened project"),
1555 ":/img/actions/close.png",
1556 EditorCommand::Flags(),
1557 {QKeySequence(Qt::CTRL | Qt::Key_F4)},
1559 };
1561 "project_close_all", // clang-format break
1562 QT_TR_NOOP("Close All Projects"),
1563 QT_TR_NOOP("Close all currently opened projects"),
1564 ":/img/actions/close.png",
1565 EditorCommand::Flags(),
1566 {QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_F4)},
1568 };
1570 "application_quit", // clang-format break
1571 QT_TR_NOOP("Quit"),
1572 QT_TR_NOOP("Close the whole application"),
1573 ":/img/actions/quit.png",
1575 {QKeySequence(Qt::CTRL | Qt::Key_Q)},
1577 };
1578
1579 EditorCommandCategory categoryHelp{"categoryHelp", QT_TR_NOOP("Help"), true,
1580 &categoryRoot};
1582 "about_librepcb", // clang-format break
1583 QT_TR_NOOP("About LibrePCB"),
1584 QT_TR_NOOP("Show information about the application"),
1585 ":/img/logo/48x48.png",
1587 {},
1588 &categoryHelp,
1589 };
1591 "about_qt", // clang-format break
1592 QT_TR_NOOP("About Qt"),
1593 QT_TR_NOOP("Show information about Qt"),
1594 QString(),
1596 {},
1597 &categoryHelp,
1598 };
1600 "website", // clang-format break
1601 QT_TR_NOOP("LibrePCB Website"),
1602 QT_TR_NOOP("Open the LibrePCB website in the web browser"),
1603 ":/img/actions/open_browser.png",
1604 EditorCommand::Flags(),
1605 {},
1606 &categoryHelp,
1607 };
1609 "documentation_online", // clang-format break
1610 QT_TR_NOOP("Online Documentation"),
1611 QT_TR_NOOP("Open the documentation in the web browser"),
1612 ":/img/actions/help.png",
1613 EditorCommand::Flags(),
1614 {QKeySequence(Qt::Key_F1)},
1615 &categoryHelp,
1616 };
1618 "keyboard_shortcuts_reference", // clang-format break
1619 QT_TR_NOOP("Keyboard Shortcuts Reference"),
1620 QT_TR_NOOP("Open a quick reference about the keyboard shortcuts"),
1621 QString(),
1622 EditorCommand::Flags(),
1623 {QKeySequence(Qt::CTRL | Qt::Key_F1)},
1624 &categoryHelp,
1625 };
1626
1628 "categoryContextMenu", QT_TR_NOOP("Context Menu"), false, &categoryRoot};
1630 "folder_new", // clang-format break
1631 QT_TR_NOOP("New Folder"),
1632 QT_TR_NOOP("Create a new folder"),
1633 ":/img/actions/new_folder.png",
1634 EditorCommand::Flags(),
1635 {},
1637 };
1639 "favorite_add", // clang-format break
1640 QT_TR_NOOP("Add To Favorites"),
1641 QT_TR_NOOP("Add project to favorites"),
1642 ":/img/actions/bookmark_gray.png",
1643 EditorCommand::Flags(),
1644 {},
1646 };
1648 "favorite_remove", // clang-format break
1649 QT_TR_NOOP("Remove From Favorites"),
1650 QT_TR_NOOP("Remove project from favorites"),
1651 ":/img/actions/bookmark.png",
1652 EditorCommand::Flags(),
1653 {},
1655 };
1657 "vertex_add", // clang-format break
1658 QT_TR_NOOP("Add Vertex"),
1659 QT_TR_NOOP("Insert a new vertex into the selected polygon edge"),
1660 ":/img/actions/add.png",
1661 EditorCommand::Flags(),
1662 {},
1664 };
1666 "vertex_remove", // clang-format break
1667 QT_TR_NOOP("Remove Vertex"),
1668 QT_TR_NOOP("Remove the selected vertex from the polygon"),
1669 ":/img/actions/delete.png",
1670 EditorCommand::Flags(),
1671 {},
1673 };
1675 "trace_select_whole", // clang-format break
1676 QT_TR_NOOP("Select Whole Trace"),
1677 QT_TR_NOOP("Select the whole trace"),
1678 ":/img/actions/bookmark.png",
1679 EditorCommand::Flags(),
1680 {},
1682 };
1684 "trace_measure_length", // clang-format break
1685 QT_TR_NOOP("Measure Selected Segments Length"),
1686 QT_TR_NOOP("Measure the total length of all selected trace segments"),
1687 ":/img/actions/ruler.png",
1688 EditorCommand::Flags(),
1689 {},
1691 };
1693 "trace_remove_whole", // clang-format break
1694 QT_TR_NOOP("Remove Whole Trace"),
1695 QT_TR_NOOP("Remove the whole trace"),
1696 ":/img/actions/minus.png",
1697 EditorCommand::Flags(),
1698 {},
1700 };
1702 "locked", // clang-format break
1703 QT_TR_NOOP("Lock Placement"),
1704 QT_TR_NOOP("Toggle placement lock"),
1705 ":/img/status/locked.png", // For consistent context menu look.
1706 EditorCommand::Flags(),
1707 {},
1709 };
1711 "visible", // clang-format break
1712 QT_TR_NOOP("Visible"),
1713 QT_TR_NOOP("Toggle visibility"),
1714 QString(),
1715 EditorCommand::Flags(),
1716 {},
1718 };
1720 "copy_mpn_to_clipboard", // clang-format break
1721 QT_TR_NOOP("Copy MPN to Clipboard"),
1722 QT_TR_NOOP("Copy this MPN into the clipboard"),
1723 ":/img/actions/copy.png",
1724 EditorCommand::Flags(),
1725 {QKeySequence(Qt::CTRL | Qt::Key_C)},
1727 };
1729 "open_product_website", // clang-format break
1730 QT_TR_NOOP("Open Product Website"),
1731 QT_TR_NOOP("Open product details about this part in the web browser"),
1732 ":/img/actions/open_browser.png",
1734 {},
1736 };
1738 "open_pricing_website", // clang-format break
1739 QT_TR_NOOP("Open Pricing Website"),
1740 QT_TR_NOOP("Open pricing details about this part in the web browser"),
1741 ":/img/library/part.png",
1743 {},
1745 };
1747 // Actually not really for the context menu :-/
1748 "generate_content", // clang-format break
1749 QT_TR_NOOP("Generate Content"),
1750 QT_TR_NOOP("Automatically generate some content"),
1751 ":/img/actions/wizard.png",
1753 {},
1755 };
1756};
1757
1758/*******************************************************************************
1759 * End of File
1760 ******************************************************************************/
1761
1762} // namespace editor
1763} // namespace librepcb
1764
1765#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:1569
EditorCommand dockPages
Definition: editorcommandset.h:1457
EditorCommand controlPanel
Definition: editorcommandset.h:165
EditorCommand toolPadBga
Definition: editorcommandset.h:995
EditorCommand save
Definition: editorcommandset.h:102
EditorCommand toolPin
Definition: editorcommandset.h:959
EditorCommand sizeIncrease
Definition: editorcommandset.h:1197
EditorCommand toolGenerateOutline
Definition: editorcommandset.h:1113
EditorCommand zoomFitContent
Definition: editorcommandset.h:803
EditorCommand shapeRoundedRect
Definition: editorcommandset.h:1370
EditorCommand projectCloseAll
Definition: editorcommandset.h:1560
EditorCommand layerDown
Definition: editorcommandset.h:1170
EditorCommand tabClose
Definition: editorcommandset.h:1524
EditorCommand print
Definition: editorcommandset.h:523
EditorCommandCategory categoryTextInput
Definition: editorcommandset.h:410
EditorCommandCategory categoryHelp
Definition: editorcommandset.h:1579
EditorCommand alignVerticalTop
Definition: editorcommandset.h:1305
EditorCommand toolPadEdgeConnector
Definition: editorcommandset.h:1004
EditorCommand flipVertical
Definition: editorcommandset.h:717
EditorCommand generateBom
Definition: editorcommandset.h:532
EditorCommand sheetNew
Definition: editorcommandset.h:319
EditorCommand gridProperties
Definition: editorcommandset.h:264
EditorCommand inputAcceptAdd
Definition: editorcommandset.h:439
EditorCommand componentGnd
Definition: editorcommandset.h:1436
EditorCommand toolLine
Definition: editorcommandset.h:887
EditorCommand componentResistor
Definition: editorcommandset.h:1400
EditorCommand moveLeft
Definition: editorcommandset.h:635
EditorCommand itemOpen
Definition: editorcommandset.h:93
EditorCommand abort
Definition: editorcommandset.h:1152
EditorCommand clipboardPaste
Definition: editorcommandset.h:626
EditorCommandCategory categoryComponents
Definition: editorcommandset.h:1398
EditorCommand openProductWebsite
Definition: editorcommandset.h:1728
EditorCommand toolText
Definition: editorcommandset.h:932
EditorCommandCategory categoryTools
Definition: editorcommandset.h:876
EditorCommand toolPadLocalFiducial
Definition: editorcommandset.h:1022
EditorCommand unlock
Definition: editorcommandset.h:745
EditorCommand toolWire
Definition: editorcommandset.h:1058
EditorCommand copyMpnToClipboard
Definition: editorcommandset.h:1719
EditorCommand mirrorHorizontal
Definition: editorcommandset.h:689
EditorCommand componentInductor
Definition: editorcommandset.h:1409
EditorCommandCategory categoryDocks
Definition: editorcommandset.h:1455
EditorCommand projectNew
Definition: editorcommandset.h:228
EditorCommand toolMeasure
Definition: editorcommandset.h:1131
EditorCommand sheetRename
Definition: editorcommandset.h:328
EditorCommand rotateCw
Definition: editorcommandset.h:680
EditorCommand schematicEditor
Definition: editorcommandset.h:310
EditorCommand runDesignRuleCheck
Definition: editorcommandset.h:291
EditorCommandCategory categoryWindowManagement
Definition: editorcommandset.h:1503
EditorCommand pageNext
Definition: editorcommandset.h:1506
EditorCommand libraryElementDuplicate
Definition: editorcommandset.h:219
EditorCommand toolPadTest
Definition: editorcommandset.h:1013
EditorCommand website
Definition: editorcommandset.h:1599
EditorCommand redo
Definition: editorcommandset.h:598
EditorCommand drillDecrease
Definition: editorcommandset.h:1224
EditorCommand exportImage
Definition: editorcommandset.h:496
EditorCommand mirrorVertical
Definition: editorcommandset.h:698
EditorCommand zoomIn
Definition: editorcommandset.h:812
EditorCommand favoriteAdd
Definition: editorcommandset.h:1638
EditorCommand boardRemove
Definition: editorcommandset.h:373
EditorCommand toolPadThermal
Definition: editorcommandset.h:986
EditorCommand locked
Definition: editorcommandset.h:1701
EditorCommand projectOpen
Definition: editorcommandset.h:237
EditorCommand toggle3d
Definition: editorcommandset.h:866
EditorCommand commandToolBarFocus
Definition: editorcommandset.h:1143
EditorCommand pagePrevious
Definition: editorcommandset.h:1515
EditorCommand toolSelect
Definition: editorcommandset.h:878
void updateTranslations() noexcept
Definition: editorcommandset.h:64
EditorCommand wireMode9045
Definition: editorcommandset.h:1334
EditorCommand runQuickCheck
Definition: editorcommandset.h:282
EditorCommand workspaceSettings
Definition: editorcommandset.h:183
EditorCommand rename
Definition: editorcommandset.h:782
EditorCommand vertexAdd
Definition: editorcommandset.h:1656
EditorCommand toolCircle
Definition: editorcommandset.h:914
EditorCommand importEagleLibrary
Definition: editorcommandset.h:469
EditorCommand grabAreaToggle
Definition: editorcommandset.h:1251
EditorCommand exportStep
Definition: editorcommandset.h:514
EditorCommand drillIncrease
Definition: editorcommandset.h:1215
EditorCommand layerUp
Definition: editorcommandset.h:1161
EditorCommand inputRemove
Definition: editorcommandset.h:430
EditorCommand saveAll
Definition: editorcommandset.h:111
EditorCommand planeHideAll
Definition: editorcommandset.h:391
EditorCommand toolComponent
Definition: editorcommandset.h:1077
EditorCommand workspaceSwitch
Definition: editorcommandset.h:174
EditorCommand generateContent
Definition: editorcommandset.h:1746
EditorCommand wireMode4590
Definition: editorcommandset.h:1343
EditorCommand properties
Definition: editorcommandset.h:773
EditorCommand toolPolygon
Definition: editorcommandset.h:905
EditorCommand generateD356Netlist
Definition: editorcommandset.h:559
EditorCommand boardNew
Definition: editorcommandset.h:355
EditorCommandCategory categoryView
Definition: editorcommandset.h:801
EditorCommand flipHorizontal
Definition: editorcommandset.h:707
EditorCommand toolPadGlobalFiducial
Definition: editorcommandset.h:1031
EditorCommand libraryElementNew
Definition: editorcommandset.h:210
EditorCommand showPinNumbers
Definition: editorcommandset.h:848
EditorCommandCategory categoryEditor
Definition: editorcommandset.h:82
EditorCommand inputBrowse
Definition: editorcommandset.h:412
EditorCommand exportPdf
Definition: editorcommandset.h:505
EditorCommand dockDrc
Definition: editorcommandset.h:1475
EditorCommand setLineWidth
Definition: editorcommandset.h:754
EditorCommand favoriteRemove
Definition: editorcommandset.h:1647
EditorCommand lineWidthDecrease
Definition: editorcommandset.h:1188
EditorCommand aboutQt
Definition: editorcommandset.h:1590
EditorCommand alignVerticalBottom
Definition: editorcommandset.h:1287
EditorCommand componentCapacitorUnipolar
Definition: editorcommandset.h:1427
EditorCommandCategory categoryContextMenu
Definition: editorcommandset.h:1627
EditorCommandCategory categoryCommands
Definition: editorcommandset.h:1141
~EditorCommandSet() noexcept
Definition: editorcommandset.h:56
EditorCommand generateFabricationData
Definition: editorcommandset.h:541
EditorCommandSet() noexcept
Definition: editorcommandset.h:55
EditorCommand toolName
Definition: editorcommandset.h:941
EditorCommand componentVcc
Definition: editorcommandset.h:1445
EditorCommand moveUp
Definition: editorcommandset.h:653
EditorCommand openPricingWebsite
Definition: editorcommandset.h:1737
EditorCommand workspaceLibrariesRescan
Definition: editorcommandset.h:192
EditorCommand traceRemoveWhole
Definition: editorcommandset.h:1692
EditorCommand boardEditor
Definition: editorcommandset.h:346
EditorCommand lineWidthIncrease
Definition: editorcommandset.h:1179
EditorCommand deviceResetTextAll
Definition: editorcommandset.h:764
EditorCommand toolValue
Definition: editorcommandset.h:950
EditorCommand toolPadTht
Definition: editorcommandset.h:968
EditorCommand projectSetup
Definition: editorcommandset.h:255
EditorCommand toolHole
Definition: editorcommandset.h:1049
EditorCommand snapToGrid
Definition: editorcommandset.h:727
QList< EditorCommandCategory * > getCategories() noexcept
Definition: editorcommandset.h:73
EditorCommand sheetRemove
Definition: editorcommandset.h:337
EditorCommand tabCloseAll
Definition: editorcommandset.h:1533
EditorCommand boardCopy
Definition: editorcommandset.h:364
EditorCommand moveRight
Definition: editorcommandset.h:644
EditorCommand dockLayers
Definition: editorcommandset.h:1484
EditorCommand sizeDecrease
Definition: editorcommandset.h:1206
EditorCommand find
Definition: editorcommandset.h:129
EditorCommand keyboardShortcutsReference
Definition: editorcommandset.h:1617
EditorCommand remove
Definition: editorcommandset.h:791
EditorCommand vertexRemove
Definition: editorcommandset.h:1665
EditorCommand itemNew
Definition: editorcommandset.h:84
EditorCommand toolPadSmt
Definition: editorcommandset.h:977
EditorCommand importEagleProject
Definition: editorcommandset.h:478
EditorCommand visible
Definition: editorcommandset.h:1710
EditorCommand toolZone
Definition: editorcommandset.h:1040
EditorCommand toolTrace
Definition: editorcommandset.h:1086
EditorCommandCategory categoryRoot
Definition: editorcommandset.h:53
EditorCommand widthAutoToggle
Definition: editorcommandset.h:1233
EditorCommand fillToggle
Definition: editorcommandset.h:1242
EditorCommand aboutLibrePcb
Definition: editorcommandset.h:1581
EditorCommand findPrevious
Definition: editorcommandset.h:147
EditorCommand alignVerticalCenter
Definition: editorcommandset.h:1296
EditorCommand alignHorizontalLeft
Definition: editorcommandset.h:1260
EditorCommand toolGenerateCourtyard
Definition: editorcommandset.h:1122
EditorCommand selectAll
Definition: editorcommandset.h:120
EditorCommand gridDecrease
Definition: editorcommandset.h:839
EditorCommand alignHorizontalRight
Definition: editorcommandset.h:1278
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:821
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:487
EditorCommand gridIncrease
Definition: editorcommandset.h:830
EditorCommand clipboardCut
Definition: editorcommandset.h:608
EditorCommand wireModeVH
Definition: editorcommandset.h:1324
EditorCommand projectLibraryUpdate
Definition: editorcommandset.h:300
EditorCommand toolVia
Definition: editorcommandset.h:1095
EditorCommand outputJobs
Definition: editorcommandset.h:568
EditorCommandCategory categoryImportExport
Definition: editorcommandset.h:449
EditorCommand componentCapacitorBipolar
Definition: editorcommandset.h:1418
EditorCommand planeShowAll
Definition: editorcommandset.h:382
EditorCommand toolRect
Definition: editorcommandset.h:896
EditorCommand toolArc
Definition: editorcommandset.h:923
EditorCommand undo
Definition: editorcommandset.h:589
QList< EditorCommand * > getCommands(const EditorCommandCategory *category) noexcept
Definition: editorcommandset.h:76
EditorCommand traceSelectWhole
Definition: editorcommandset.h:1674
EditorCommandCategory categoryModify
Definition: editorcommandset.h:587
EditorCommand wireModeStraight
Definition: editorcommandset.h:1352
EditorCommand generatePickPlace
Definition: editorcommandset.h:550
EditorCommand documentationOnline
Definition: editorcommandset.h:1608
EditorCommand fileManager
Definition: editorcommandset.h:156
EditorCommand traceMeasureLength
Definition: editorcommandset.h:1683
EditorCommand toolNetLabel
Definition: editorcommandset.h:1068
EditorCommand toolPlane
Definition: editorcommandset.h:1104
EditorCommand alignHorizontalCenter
Definition: editorcommandset.h:1269
EditorCommand dockPlaceDevices
Definition: editorcommandset.h:1493
EditorCommand rotateCcw
Definition: editorcommandset.h:671
EditorCommand moveDown
Definition: editorcommandset.h:662
EditorCommand clipboardCopy
Definition: editorcommandset.h:617
EditorCommand shapeOctagon
Definition: editorcommandset.h:1388
EditorCommand orderPcb
Definition: editorcommandset.h:577
EditorCommand shapeRound
Definition: editorcommandset.h:1361
EditorCommand shapeRect
Definition: editorcommandset.h:1379
EditorCommand projectClose
Definition: editorcommandset.h:1551
EditorCommand dockErc
Definition: editorcommandset.h:1466
EditorCommand windowClose
Definition: editorcommandset.h:1542
EditorCommand ignoreLocks
Definition: editorcommandset.h:857
EditorCommand folderNew
Definition: editorcommandset.h:1629
EditorCommand importDxf
Definition: editorcommandset.h:460
EditorCommand lock
Definition: editorcommandset.h:736
EditorCommand wireModeHV
Definition: editorcommandset.h:1314
Definition: occmodel.cpp:77