3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/21/2010 Created this file. :-)
17 #include "createqtactions.h"
19 // Here are the actions to be created...
21 QAction * actionFileNew;
22 QAction * actionFileOpen;
23 QAction * actionFileSave;
24 QAction * actionFileSaveAs;
25 QAction * actionFileExport;
26 QAction * actionFileClose;
27 QAction * actionFilePrint;
28 QAction * actionFilePrintPreview;
29 QAction * actionFileQuit;
31 QAction * actionEditUndo;
32 QAction * actionEditRedo;
33 QAction * actionEditCut;
34 QAction * actionEditCopy;
35 QAction * actionEditPaste;
36 QAction * actionOptionsGeneral;
37 QAction * actionOptionsDrawing;
39 QAction * actionViewGrid;
40 QAction * actionViewDraft;
41 QAction * actionZoomRedraw;
42 QAction * actionZoomIn;
43 QAction * actionZoomOut;
44 QAction * actionZoomAuto;
45 QAction * actionZoomPrevious;
46 QAction * actionZoomWindow;
47 QAction * actionZoomPan;
48 QAction * actionViewStatusbar;
49 QAction * actionFocusCommandLine;
51 QAction * actionDeselectAll;
52 QAction * actionSelectAll;
53 QAction * actionSelectSingle;
54 QAction * actionSelectContour;
55 QAction * actionDeselectWindow;
56 QAction * actionSelectWindow;
57 QAction * actionSelectInvert;
58 QAction * actionSelectIntersected;
59 QAction * actionDeselectIntersected;
60 QAction * actionSelectLayer;
62 QAction * actionDrawPoint;
63 QAction * actionDrawLine;
64 QAction * actionDrawLineAngle;
65 QAction * actionDrawLineHorizontal;
66 QAction * actionDrawLineVertical;
67 QAction * actionDrawLineRectangle;
68 QAction * actionDrawLineParallel;
69 QAction * actionDrawLineParallelThrough;
70 QAction * actionDrawLineBisector;
71 QAction * actionDrawLineTangent1;
72 QAction * actionDrawLineTangent2;
73 QAction * actionDrawLineOrthogonal;
74 QAction * actionDrawLineRelAngle;
75 QAction * actionDrawLineFree;
76 QAction * actionDrawLinePolygon;
77 QAction * actionDrawLinePolygon2;
78 QAction * actionDrawLinePolyline;
80 QAction * actionDrawArc;
81 QAction * actionDrawArc3P;
82 QAction * actionDrawArcParallel;
83 QAction * actionDrawArcTangential;
85 QAction * actionDrawCircle;
86 QAction * actionDrawCircleCR;
87 QAction * actionDrawCircle2P;
88 QAction * actionDrawCircle3P;
89 QAction * actionDrawCircleParallel;
91 QAction * actionDrawEllipseAxis;
92 QAction * actionDrawEllipseArcAxis;
94 QAction * actionDrawSpline;
96 QAction * actionDrawPolyline;
97 QAction * actionPolylineAdd;
98 QAction * actionPolylineAppend;
99 QAction * actionPolylineDel;
100 QAction * actionPolylineDelBetween;
101 QAction * actionPolylineTrim;
103 QAction * actionDrawText;
104 QAction * actionDrawHatch;
105 QAction * actionDrawImage;
107 QAction * actionDimAligned;
108 QAction * actionDimLinear;
109 QAction * actionDimLinearHor;
110 QAction * actionDimLinearVer;
111 QAction * actionDimRadial;
112 QAction * actionDimDiametric;
113 QAction * actionDimAngular;
114 QAction * actionDimLeader;
116 QAction * actionModifyMove;
117 QAction * actionModifyRotate;
118 QAction * actionModifyScale;
119 QAction * actionModifyMirror;
120 QAction * actionModifyMoveRotate;
121 QAction * actionModifyRotate2;
122 QAction * actionModifyTrim;
123 QAction * actionModifyTrim2;
124 QAction * actionModifyTrimAmount;
125 QAction * actionModifyBevel;
126 QAction * actionModifyRound;
127 QAction * actionModifyCut;
128 QAction * actionModifyStretch;
129 QAction * actionModifyEntity;
130 QAction * actionModifyAttributes;
131 QAction * actionModifyDelete;
132 QAction * actionModifyDeleteQuick;
133 QAction * actionModifyExplodeText;
134 QAction * actionModifyExplode;
136 QAction * actionSnapFree;
137 QAction * actionSnapGrid;
138 QAction * actionSnapEndpoint;
139 QAction * actionSnapOnEntity;
140 QAction * actionSnapCenter;
141 QAction * actionSnapMiddle;
142 QAction * actionSnapDist;
143 QAction * actionSnapIntersection;
144 QAction * actionSnapIntersectionManual;
145 QAction * actionRestrictNothing;
146 QAction * actionRestrictOrthogonal;
147 QAction * actionRestrictHorizontal;
148 QAction * actionRestrictVertical;
149 QAction * actionSetRelativeZero;
150 QAction * actionLockRelativeZero;
152 QAction * actionInfoDist;
153 QAction * actionInfoDist2;
154 QAction * actionInfoAngle;
155 QAction * actionInfoArea;
156 QAction * actionInfoTotalLength;
158 QAction * actionLayersDefreezeAll;
159 QAction * actionLayersFreezeAll;
160 QAction * actionLayersAdd;
161 QAction * actionLayersRemove;
162 QAction * actionLayersEdit;
163 QAction * actionLayersToggleView;
165 QAction * actionBlocksDefreezeAll;
166 QAction * actionBlocksFreezeAll;
167 QAction * actionBlocksAdd;
168 QAction * actionBlocksRemove;
169 QAction * actionBlocksAttributes;
170 QAction * actionBlocksInsert;
171 QAction * actionBlocksEdit;
172 QAction * actionBlocksCreate;
173 QAction * actionBlocksExplode;
175 QAction * actionScriptOpenIDE;
176 QAction * actionScriptRun;
178 QAction * actionCamExportAuto;
179 QAction * actionCamReorder;
181 QAction * actionHelpAboutApp;
182 QAction * actionHelpManual;
185 // Function prototypes
187 //QAction * CreateAction(name, tooltip, statustip, icon, keysequence, parent);
188 QAction * CreateAction(QString, QString, QString, QIcon, QKeySequence, QWidget *);
189 //QAction * CreateAction2(name, tooltip, statustip, icon, keysequence, keysequence, parent);
190 QAction * CreateAction2(QString, QString, QString, QIcon, QKeySequence, QKeySequence, QWidget *);
192 //nope using namespace Qt;
194 #define tr QObject::tr
197 // Create all Qt actions associated with the main application window.
199 void CreateQtActions(QWidget * parent)
201 actionFileNew = CreateAction(tr("&New"), tr("New Drawing"), tr("Creates a new drawing"), QIcon(":/res/filenew.png"), QKeySequence(Qt::CTRL + Qt::Key_N), parent);
202 actionFileOpen = CreateAction(tr("&Open..."), tr("Open Drawing"), tr("Opens an existing drawing"), QIcon(":/res/fileopen2.png"), QKeySequence(Qt::CTRL + Qt::Key_O), parent);
203 actionFileSave = CreateAction(tr("&Save"), tr("Save Drawing"), tr("Saves the current drawing"), QIcon(":/res/filesave2.png"), QKeySequence(Qt::CTRL + Qt::Key_S), parent);
204 actionFileSaveAs = CreateAction(tr("Save &As..."), tr("Save Drawing As"), tr("Saves the current drawing under a new filename"), QIcon(":/res/filesaveas.png"), QKeySequence(), parent);
205 actionFileExport = CreateAction(tr("&Export..."), tr("Export Drawing"), tr("Exports the current drawing as bitmap"), QIcon(), QKeySequence(), parent);
206 actionFileClose = CreateAction(tr("&Close"), tr("Close Drawing"), tr("Closes the current drawing"), QIcon(":/res/fileclose.png"), QKeySequence(Qt::CTRL + Qt::Key_W), parent);
207 actionFilePrint = CreateAction(tr("&Print..."), tr("Print Drawing"), tr("Prints out the current drawing"), QIcon(":/res/fileprint.png"), QKeySequence(Qt::CTRL + Qt::Key_P), parent);
208 actionFilePrintPreview = CreateAction(tr("Print Pre&view"), tr("Print Preview"), tr("Shows a preview of a print"), QIcon(":/res/fileprintpreview.png"), QKeySequence(), NULL);
209 actionFilePrintPreview->setCheckable(true);
210 actionFileQuit = CreateAction(tr("&Quit"), tr("Quit"), tr("Quits the application"), QIcon(":/res/exit.png"), QKeySequence(Qt::CTRL + Qt::Key_Q), parent);
212 actionEditUndo = CreateAction2(tr("&Undo"), tr("Undo"), tr("Undoes last action"), QIcon(":/res/undo2.png"), QKeySequence(tr("o, o", "Edit|Undo")), QKeySequence(Qt::CTRL + Qt::Key_Z), parent);
213 actionEditRedo = CreateAction2(tr("&Redo"), tr("Redo"), tr("Redoes last action"), QIcon(":/res/redo2.png"), QKeySequence(tr("u, u", "Edit|Redo")), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z), parent);
214 actionEditCut = CreateAction(tr("Cu&t"), tr("Cut"), tr("Cuts entities to the clipboard"), QIcon(":/res/editcut2.png"), QKeySequence(Qt::CTRL + Qt::Key_X), parent);
215 actionEditCopy = CreateAction(tr("&Copy"), tr("Copy"), tr("Copies entities to the clipboard"), QIcon(":/res/editcopy2.png"), QKeySequence(Qt::CTRL + Qt::Key_C), parent);
216 actionEditPaste = CreateAction(tr("&Paste"), tr("Paste"), tr("Pastes the clipboard contents"), QIcon(":/res/editpaste2.png"), QKeySequence(Qt::CTRL + Qt::Key_V), parent);
217 actionOptionsGeneral = CreateAction(tr(
221 "&Application Preferences..."
223 ), tr("Application"), tr("General Application Preferences"), QIcon(":/res/configure.png"), QKeySequence(), NULL);
224 actionOptionsDrawing = CreateAction(tr("Current &Drawing Preferences..."), tr("Drawing"), tr("Settings for the current Drawing"), QIcon(), QKeySequence(), NULL);
226 actionViewGrid = CreateAction(tr("&Grid"), tr("Grid"), tr("Enables/disables the grid"), QIcon(":/res/viewgrid.png"), QKeySequence("g, r"), parent);
227 actionViewGrid->setCheckable(true);
228 actionViewDraft = CreateAction(tr("&Draft"), tr("Draft"), tr("Enables/disables the draft mode"), QIcon(":/res/viewdraft.png"), QKeySequence("d, f"), parent);
229 actionViewDraft->setCheckable(true);
230 actionZoomRedraw = CreateAction(tr("&Redraw"), tr("Redraw"), tr("Redraw"), QIcon(":/res/zoomredraw.png"), QKeySequence("r, g"), NULL);
231 actionZoomIn = CreateAction(tr("Zoom &In"), tr("Zoom in"), tr("Zooms in"), QIcon(":/res/zoomin.png"), QKeySequence("+"), NULL);
232 actionZoomOut = CreateAction(tr("Zoom &Out"), tr("Zoom out"), tr("Zooms out"), QIcon(":/res/zoomout.png"), QKeySequence("-"), NULL);
233 actionZoomAuto = CreateAction(tr("&Auto Zoom"), tr("Auto Zoom"), tr("Zooms automatic"), QIcon(":/res/zoomauto.png"), QKeySequence("z, a"), NULL);
234 actionZoomPrevious = CreateAction(tr("&Previous View"), tr("Previous View"), tr("Shows previous view"), QIcon(":/res/zoomprevious.png"), QKeySequence("z, v"), NULL);
235 actionZoomWindow = CreateAction(tr("&Window Zoom"), tr("Window Zoom"), tr("Zooms in a window"), QIcon(":/res/zoomwindow.png"), QKeySequence("z, w"), NULL);
236 actionZoomPan = CreateAction(tr("&Pan Zoom"), tr("Pan Zoom"), tr("Realtime Panning"), QIcon(":/res/zoompan.png"), QKeySequence("z, p"), NULL);
237 actionViewStatusbar = CreateAction(tr("&Statusbar"), tr("Statusbar"), tr("Enables/disables the statusbar"), QIcon(), QKeySequence(), parent);
238 actionViewStatusbar->setCheckable(true);
239 actionFocusCommandLine = CreateAction(tr("Focus on &Command Line"), tr("Focus on Command Line"), tr(""), QIcon(":/res/editclear.png"), QKeySequence(Qt::Key_Space), parent);
241 actionDeselectAll = CreateAction2(tr("Deselect &all"), tr("Deselect all"), tr("Deselects all Entities"), QIcon(":/res/select-none"), QKeySequence("t, n"), QKeySequence(Qt::CTRL + Qt::Key_K), parent);
242 actionSelectAll = CreateAction2(tr("Select &All"), tr("Select All"), tr("Selects all Entities"), QIcon(":/res/select-all"), QKeySequence("t, a"), QKeySequence(Qt::CTRL + Qt::Key_A), parent);
243 actionSelectSingle = CreateAction(tr("(De-)&Select Entity"), tr("Select Entity"), tr("Selects single Entities"), QIcon(":/res/select-single"), QKeySequence("t, s"), NULL);
244 actionSelectContour = CreateAction(tr("(De-)Select &Contour"), tr("(De-)Select Contour"), tr("(De-)Selects connected entities"), QIcon(":/res/select-contour"), QKeySequence("t, c"), NULL);
245 actionDeselectWindow = CreateAction(tr("Deselect &Window"), tr("Deselect Window"), tr("Deselects all Entities in a given Window"), QIcon(":/res/select-nonwindow"), QKeySequence("u, w"), NULL);
246 actionSelectWindow = CreateAction(tr("Select &Window"), tr("Select Window"), tr("Selects all Entities in a given Window"), QIcon(":/res/select-window"), QKeySequence("t, w"), NULL);
247 actionSelectInvert = CreateAction(tr("&Invert Selection"), tr("Invert Selection"), tr("Inverts the current selection"), QIcon(":/res/select-invert"), QKeySequence("t, i"), NULL);
248 actionSelectIntersected = CreateAction(tr("In&tersected Entities"), tr("Select Intersected Entities"), tr("Selects all entities intersected by a line"), QIcon(":/res/select-intersection"), QKeySequence("t, x"), NULL);
249 actionDeselectIntersected = CreateAction(tr("Deselect Inte&rsected Entities"), tr("Deselect Intersected Entities"), tr("Deselects all entities intersected by a line"), QIcon(":/res/select-nonintersection"), QKeySequence("u, x"), NULL);
250 actionSelectLayer = CreateAction(tr("(De-)Select Layer"), tr("(De-)Select Layer"), tr("(De-)Selects layers"), QIcon(":/res/select-layer"), QKeySequence("t, l"), NULL);
252 actionDrawPoint = CreateAction(tr("&Points"), tr("Points"), tr("Draw Points"), QIcon(":/res/qg_points.xpm"), QKeySequence("p, o"), NULL);
253 actionDrawLine = CreateAction(tr("&2 Points"), tr("Line: 2 Points"), tr("Draw lines"), QIcon(":/res/qg_linesnormal.xpm"), QKeySequence("l, i"), NULL);
254 actionDrawLineAngle = CreateAction(tr("&Angle"), tr("Line: Angle"), tr("Draw lines with a given angle"), QIcon(":/res/qg_linesangle.xpm"), QKeySequence("l, a"), NULL);
255 actionDrawLineHorizontal = CreateAction(tr("&Horizontal"), tr("Line: Horizontal"), tr("Draw horizontal lines"), QIcon(":/res/qg_lineshor.xpm"), QKeySequence("l, h"), NULL);
256 actionDrawLineVertical = CreateAction(tr("&Vertical"), tr("hor./vert. line"), tr("Draw horizontal/vertical lines"), QIcon(":/res/qg_linesver.xpm"), QKeySequence("l, v"), NULL);
257 actionDrawLineRectangle = CreateAction(tr("&Rectangle"), tr("Rectangle"), tr("Draw rectangles"), QIcon(":/res/qg_linesrect.xpm"), QKeySequence("r, e"), NULL);
258 actionDrawLineParallel = CreateAction(tr("Para&llel"), tr("Parallel"), tr("Draw parallels to existing lines, arcs, circles"), QIcon(":/res/qg_linespara.xpm"), QKeySequence("l, p"), NULL);
259 actionDrawLineParallelThrough = CreateAction(tr("Par&allel through point"), tr("Parallel through point"), tr("Draw parallel through a given point"), QIcon(":/res/qg_linesparathrough.xpm"), QKeySequence("l, g"), NULL);
260 actionDrawLineBisector = CreateAction(tr("&Bisector"), tr("Bisector"), tr("Draw bisectors"), QIcon(":/res/qg_linesbisector.xpm"), QKeySequence("l, b"), NULL);
261 actionDrawLineTangent1 = CreateAction(tr("&Tangent (P,C)"), tr("Tangent (P,C)"), tr("Draw tangent (point, circle)"), QIcon(":/res/qg_linestan1.xpm"), QKeySequence("l, t, 1"), NULL);
262 actionDrawLineTangent2 = CreateAction(tr("Tan&gent (C,C)"), tr("Tangent (C,C)"), tr("Draw tangent (circle, circle)"), QIcon(":/res/qg_linestan2.xpm"), QKeySequence("l, t, 2"), NULL);
263 actionDrawLineOrthogonal = CreateAction(tr("&Orthogonal"), tr("Orthogonal"), tr("Draw orthogonal line"), QIcon(":/res/qg_linesorthogonal.xpm"), QKeySequence("l, o"), NULL);
264 actionDrawLineRelAngle = CreateAction(tr("R&elative angle"), tr("Relative angle"), tr("Draw line with relative angle"), QIcon(":/res/qg_linesrelativeangle.xpm"), QKeySequence("l, r"), NULL);
265 actionDrawLineFree = CreateAction(tr("&Freehand Line"), tr("Line: Freehand"), tr("Draw freehand lines"), QIcon(":/res/qg_linesfree.xpm"), QKeySequence("l, f"), NULL);
266 actionDrawLinePolygon = CreateAction(tr("Pol&ygon (Cen,Cor)"), tr("Polygon"), tr("Draw polygon with center and corner"), QIcon(":/res/qg_linespolygon.xpm"), QKeySequence("p, g, 1"), NULL);
267 actionDrawLinePolygon2 = CreateAction(tr("Polygo&n (Cor,Cor)"), tr("Polygon"), tr("Draw polygon with two corners"), QIcon(":/res/qg_linespolygon2.xpm"), QKeySequence("p, g, 2"), NULL);
269 // actionDrawLinePolyline = CreateAction(tr(""), tr(""), tr(""), QIcon(), QKeySequence(), NULL);
271 actionDrawArc = CreateAction(tr("&Center, Point, Angles"), tr("Arc: Center, Point, Angles"), tr("Draw arcs"), QIcon(":/res/qg_arcscraa.xpm"), QKeySequence("a, r"), NULL);
272 actionDrawArc3P = CreateAction(tr("&3 Points"), tr("Arc: 3 Points"), tr("Draw arcs with 3 points"), QIcon(":/res/qg_arcs3p.xpm"), QKeySequence("a, 3"), NULL);
273 actionDrawArcParallel = CreateAction(tr("&Concentric"), tr("Concentric"), tr("Draw parallels to existing lines, arcs, circles"), QIcon(":/res/qg_arcspara.xpm"), QKeySequence("a, c"), NULL);
274 actionDrawArcTangential = CreateAction(tr("&Tangential"), tr("Arc: Tangential"), tr("Draw arcs tangential to base entity"), QIcon(":/res/qg_arcstangential.xpm"), QKeySequence("a, n"), NULL);
276 actionDrawCircle = CreateAction(tr("Center, &Point"), tr("Circle: Center, Point"), tr("Draw circles with center and point"), QIcon(":/res/qg_circles.xpm"), QKeySequence("c, i"), NULL);
277 actionDrawCircleCR = CreateAction(tr("Center, &Radius"), tr("Circle: Center, Radius"), tr("Draw circles with center and radius"), QIcon(":/res/qg_circlescr.xpm"), QKeySequence("c, r"), NULL);
278 actionDrawCircle2P = CreateAction(tr("2 Points"), tr("Circle: 2 Points"), tr("Draw circles with 2 points"), QIcon(":/res/qg_circles2p.xpm"), QKeySequence("c, 2"), NULL);
279 actionDrawCircle3P = CreateAction(tr("3 Points"), tr("Circle: 3 Points"), tr("Draw circles with 3 points"), QIcon(":/res/qg_circles3p.xpm"), QKeySequence("c, 3"), NULL);
280 actionDrawCircleParallel = CreateAction(tr("&Concentric"), tr("Concentric"), tr("Draw parallels to existing lines, arcs, circles"), QIcon(":/res/qg_circlespara.xpm"), QKeySequence("c, c"), NULL);
282 actionDrawEllipseAxis = CreateAction(tr("&Ellipse (Axis)"), tr("Ellipse with Axis"), tr("Draw Ellipses"), QIcon(":/res/qg_ellipsesaxes.xpm"), QKeySequence("e, p"), NULL);
283 actionDrawEllipseArcAxis = CreateAction(tr("&Ellipse Arc (Axis)"), tr("Ellipse Arc with Axis"), tr("Draw Ellipse Arcs"), QIcon(":/res/qg_ellipsearcsaxes.xpm"), QKeySequence("e, a"), NULL);
285 actionDrawSpline = CreateAction(tr("&Spline"), tr("Spline"), tr("Draw splines"), QIcon(":/res/qg_splinesnurbs.xpm"), QKeySequence("s, p"), NULL);
287 actionDrawPolyline = CreateAction(tr("&Draw"), tr(""), tr(""), QIcon(":/res/qg_polyline.xpm"), QKeySequence("p, l"), NULL);
288 actionPolylineAdd = CreateAction(tr("&Add Node"), tr(""), tr(""), QIcon(":/res/qg_polylineadd.xpm"), QKeySequence("o, a"), NULL);
289 actionPolylineAppend = CreateAction(tr("A&ppend Node"), tr(""), tr(""), QIcon(":/res/qg_polylineappend.xpm"), QKeySequence("o, p"), NULL);
290 actionPolylineDel = CreateAction(tr("&Delete Node"), tr(""), tr(""), QIcon(":/res/qg_polylinedel.xpm"), QKeySequence("o, d"), NULL);
291 actionPolylineDelBetween = CreateAction(tr("Delete Segments &Between Two Nodes"), tr(""), tr(""), QIcon(":/res/qg_polylinedelbetween.xpm"), QKeySequence("o, b"), NULL);
292 actionPolylineTrim = CreateAction(tr("&Trim Segments"), tr(""), tr(""), QIcon(":/res/qg_polylinetrim.xpm"), QKeySequence("o, t"), NULL);
294 actionDrawText = CreateAction(tr("&Text"), tr("Text"), tr("Draw Text Entities"), QIcon(":/res/qg_menutext.xpm"), QKeySequence("t, e"), NULL);
295 actionDrawHatch = CreateAction(tr("&Hatch"), tr("Hatch"), tr("Draw Hatches and Solid Fills"), QIcon(":/res/qg_menuhatch.xpm"), QKeySequence("h, a"), NULL);
296 actionDrawImage = CreateAction(tr("Insert &Image"), tr("Image"), tr("Insert Image (Bitmap)"), QIcon(":/res/qg_menuimage.xpm"), QKeySequence("i, m"), NULL);
298 actionDimAligned = CreateAction(tr("&Aligned"), tr("Aligned"), tr("Aligned Dimension"), QIcon(":/res/qg_dimaligned.xpm"), QKeySequence("d, a"), NULL);
299 actionDimLinear = CreateAction(tr("&Linear"), tr("Linear"), tr("Linear Dimension"), QIcon(":/res/qg_dimlinear.xpm"), QKeySequence("d, l"), NULL);
300 actionDimLinearHor = CreateAction(tr("&Horizontal"), tr("Horizontal"), tr("Horizontal Dimension"), QIcon(":/res/qg_dimhor.xpm"), QKeySequence("d, h"), NULL);
301 actionDimLinearVer = CreateAction(tr("&Vertical"), tr("Vertical"), tr("Vertical Dimension"), QIcon(":/res/qg_dimver.xpm"), QKeySequence("d, v"), NULL);
302 actionDimRadial = CreateAction(tr("&Radial"), tr("Radial"), tr("Radial Dimension"), QIcon(":/res/qg_dimradial.xpm"), QKeySequence("d, r"), NULL);
303 actionDimDiametric = CreateAction(tr("&Diametric"), tr("Diametric"), tr("Diametric Dimension"), QIcon(":/res/qg_dimdiametric.xpm"), QKeySequence("d, d"), NULL);
304 actionDimAngular = CreateAction(tr("&Angular"), tr("Angular"), tr("Angular Dimension"), QIcon(":/res/qg_dimangular.xpm"), QKeySequence("d, n"), NULL);
305 actionDimLeader = CreateAction(tr("&Leader"), tr("Leader"), tr("Leader Dimension"), QIcon(":/res/qg_dimleader.xpm"), QKeySequence("d, e"), NULL);
307 actionModifyMove = CreateAction(tr("&Move / Copy"), tr("Move / Copy"), tr("Move or copy entities one or multiple times"), QIcon(":/res/qg_modifymove.xpm"), QKeySequence("m, v"), NULL);
308 actionModifyRotate = CreateAction(tr("&Rotate"), tr("Rotate"), tr("Rotate Entities"), QIcon(":/res/qg_modifyrotate.xpm"), QKeySequence("r, o"), NULL);
309 actionModifyScale = CreateAction(tr("&Scale"), tr("Scale"), tr("Scale Entities"), QIcon(":/res/qg_modifyscale.xpm"), QKeySequence("s, z"), NULL);
310 actionModifyMirror = CreateAction(tr("&Mirror"), tr("Mirror"), tr("Mirror Entities"), QIcon(":/res/qg_modifymirror.xpm"), QKeySequence("m, i"), NULL);
311 actionModifyMoveRotate = CreateAction(tr("M&ove and Rotate"), tr("Move and Rotate"), tr("Move and Rotate Entities"), QIcon(":/res/qg_modifymoverotate.xpm"), QKeySequence("m, r"), NULL);
312 actionModifyRotate2 = CreateAction(tr("Rotate T&wo"), tr("Rotate Two"), tr("Rotate Entities around two centers"), QIcon(":/res/qg_modifyrotate2.xpm"), QKeySequence("r, 2"), NULL);
313 actionModifyTrim = CreateAction(tr("&Trim"), tr("Trim"), tr("Trim Entities"), QIcon(":/res/qg_modifytrim.xpm"), QKeySequence("r, m"), NULL);
314 actionModifyTrim2 = CreateAction(tr("&Trim Two"), tr("Trim Two"), tr("Trim two Entities"), QIcon(":/res/qg_modifytrim2.xpm"), QKeySequence("t, m"), NULL);
315 actionModifyTrimAmount = CreateAction(tr("&Lengthen"), tr("Lengthen"), tr("Lengthen by a given amount"), QIcon(":/res/qg_modifytrimamount.xpm"), QKeySequence("l, e"), NULL);
316 actionModifyBevel = CreateAction(tr("&Bevel"), tr("Bevel"), tr("Bevel Entities"), QIcon(":/res/qg_modifybevel.xpm"), QKeySequence("c, h"), NULL);
317 actionModifyRound = CreateAction(tr("&Round"), tr("Round"), tr("Round Entities"), QIcon(":/res/qg_modifyround.xpm"), QKeySequence("r, n"), NULL);
318 actionModifyCut = CreateAction(tr("&Divide"), tr("Divide"), tr("Cut Entities"), QIcon(":/res/qg_modifycut.xpm"), QKeySequence("d, i"), NULL);
319 actionModifyStretch = CreateAction(tr("&Stretch"), tr("Stretch"), tr("Stretch Entities"), QIcon(":/res/qg_modifystretch.xpm"), QKeySequence("s, s"), NULL);
320 actionModifyEntity = CreateAction(tr("&Properties"), tr("Properties"), tr("Modify Entity Properties"), QIcon(":/res/qg_modifyentity.xpm"), QKeySequence("p, r"), NULL);
321 actionModifyAttributes = CreateAction(tr("&Attributes"), tr("Attributes"), tr("Modify Entity Attributes"), QIcon(":/res/qg_modifyattributes.xpm"), QKeySequence("a, t"), NULL);
322 actionModifyDelete = CreateAction(tr("&Delete"), tr("Delete"), tr("Delete Entities"), QIcon(":/res/qg_modifydelete.xpm"), QKeySequence("e, r"), NULL);
323 // actionModifyDeleteFree = CreateAction(tr("&Delete Freehand"), tr("Delete Freehand"), tr("Delete Freehand"), QIcon(), QKeySequence(), NULL);
325 actionModifyDeleteQuick = CreateAction(tr("&Delete selected"), tr("Delete selected"), tr("Delete selected entities"), QIcon(":/res/qg_modifydelete.xpm"), QKeySequence(
332 actionModifyExplodeText = CreateAction(tr("&Explode Text into Letters"), tr("Explode Text"), tr("Explodes Text Entities into single Letters"), QIcon(":/res/qg_modifyexplodetext.xpm"), QKeySequence("x, e"), NULL);
333 actionModifyExplode = CreateAction(tr("&Explode"), tr("Explode"), tr("Explode Blocks and other Entity Groups"), QIcon(":/res/qg_modifyexplode.xpm"), QKeySequence("x, p"), NULL);
335 actionSnapFree = CreateAction(tr("&Free"), tr("Free"), tr("Free positioning"), QIcon(":/res/qg_snapfree.xpm"), QKeySequence("s, f"), parent);
336 actionSnapFree->setCheckable(true);
337 actionSnapGrid = CreateAction(tr("&Grid"), tr("Grid"), tr("Grid psoitioning"), QIcon(":/res/qg_snapgrid.xpm"), QKeySequence("s, g"), parent);
338 actionSnapGrid->setCheckable(true);
339 actionSnapEndpoint = CreateAction(tr("&Endpoints"), tr("Endpoints"), tr("Snap to endpoints"), QIcon(":/res/qg_snapendpoint.xpm"), QKeySequence("s, e"), parent);
340 actionSnapEndpoint->setCheckable(true);
341 actionSnapOnEntity = CreateAction(tr("&On Entity"), tr("On Entity"), tr("Snap to nearest point on entity"), QIcon(":/res/qg_snaponentity.xpm"), QKeySequence("s, t"), parent);
342 actionSnapOnEntity->setCheckable(true);
343 actionSnapCenter = CreateAction(tr("&Center"), tr("Center"), tr("Snap to centers"), QIcon(":/res/qg_snapcenter.xpm"), QKeySequence("s, c"), parent);
344 actionSnapCenter->setCheckable(true);
345 actionSnapMiddle = CreateAction(tr("&Middle"), tr("Middle"), tr("Snap to middle points"), QIcon(":/res/qg_snapmiddle.xpm"), QKeySequence("s, m"), parent);
346 actionSnapMiddle->setCheckable(true);
347 actionSnapDist = CreateAction(tr("&Distance from Endpoint"), tr("Distance from Endpoint"), tr("Snap to points with a given distance to an endpoint"), QIcon(":/res/qg_snapdist.xpm"), QKeySequence("s, d"), parent);
348 actionSnapDist->setCheckable(true);
349 actionSnapIntersection = CreateAction(tr("&Intersection"), tr("Intersection"), tr("Snap to intersection points"), QIcon(":/res/qg_snapintersection.xpm"), QKeySequence("s, i"), parent);
350 actionSnapIntersection->setCheckable(true);
351 actionSnapIntersectionManual = CreateAction(tr("I&ntersection Manually"), tr("Intersection Manually"), tr("Snap to intersection points manually"), QIcon(":/res/qg_snapintersectionm.xpm"), QKeySequence("s, y"), parent);
352 actionSnapIntersectionManual->setCheckable(true);
353 actionRestrictNothing = CreateAction(tr("Restrict &Nothing"), tr("Restrict Nothing"), tr("No snap restriction"), QIcon(":/res/qg_restrictnothing.xpm"), QKeySequence("e, n"), parent);
354 actionRestrictNothing->setCheckable(true);
355 actionRestrictOrthogonal = CreateAction(tr("Restrict &Orthogonally"), tr("Restrict Orthogonally"), tr("Restrict snapping orthogonally"), QIcon(":/res/qg_restrictorthogonal.xpm"), QKeySequence("e, o"), parent);
356 actionRestrictOrthogonal->setCheckable(true);
357 actionRestrictHorizontal = CreateAction(tr("Restrict &Horizontally"), tr("Restrict Horizontally"), tr("Restrict snapping horizontally"), QIcon(":/res/qg_restricthorizontal.xpm"), QKeySequence("e, h"), parent);
358 actionRestrictHorizontal->setCheckable(true);
359 actionRestrictVertical = CreateAction(tr("Restrict &Vertically"), tr("Restrict Vertically"), tr("Restrict snapping vertically"), QIcon(":/res/qg_restrictvertical.xpm"), QKeySequence("e, v"), parent);
360 actionRestrictVertical->setCheckable(true);
361 actionSetRelativeZero = CreateAction(tr("&Set Relative Zero"), tr("Set Relative Zero"), tr("Set position of the Relative Zero point"), QIcon(":/res/qg_relzeromove.xpm"), QKeySequence("r, z"), NULL);
362 actionLockRelativeZero = CreateAction(tr("(Un-)&Lock Relative Zero"), tr("(Un-)Lock Relative Zero"), tr("(Un-)Lock relative Zero"), QIcon(":/res/qg_relzerolock.xpm"), QKeySequence("r, l"), NULL);
363 actionLockRelativeZero->setCheckable(true);
365 actionInfoDist = CreateAction(tr("&Distance Point to Point"), tr("Distance Point to Point"), tr("Measures the distance between two points"), QIcon(":/res/qg_infodist.xpm"), QKeySequence("i, p"), NULL);
366 actionInfoDist2 = CreateAction(tr("&Distance Entity to Point"), tr("Distance Entity to Point"), tr("Measures the distance between an entity and a point"), QIcon(":/res/qg_infodist2.xpm"), QKeySequence("i, e"), NULL);
367 actionInfoAngle = CreateAction(tr("&Angle between two lines"), tr("Angle between two lines"), tr("Measures the angle between two lines"), QIcon(":/res/qg_infoangle.xpm"), QKeySequence("i, a"), NULL);
368 actionInfoTotalLength = CreateAction(tr("&Total length of selected entities"), tr("Total length of selected entities"), tr("Measures the total length of all selected entities"), QIcon(":/res/qg_infototallength.xpm"), QKeySequence("i, s"), NULL);
369 actionInfoArea = CreateAction(tr("&Polygonal Area"), tr("Polygonal Area"), tr("Measures the area of a polygon"), QIcon(":/res/qg_infoarea.xpm"), QKeySequence("i, r"), NULL);
371 actionLayersDefreezeAll = CreateAction(tr("&Show all"), tr("Show all"), tr("Show all layers"), QIcon(":/res/visiblelayer.xpm"), QKeySequence("y, s"), NULL);
372 actionLayersFreezeAll = CreateAction(tr("&Hide all"), tr("Hide all"), tr("Hide all layers"), QIcon(":/res/hiddenlayer.xpm"), QKeySequence("y, h"), NULL);
373 actionLayersAdd = CreateAction(tr("&Add Layer"), tr("Add Layer"), tr("Add Layer"), QIcon(":/res/layeradd.xpm"), QKeySequence("y, a"), NULL);
374 actionLayersRemove = CreateAction(tr("&Remove Layer"), tr("Remove Layer"), tr("Remove Layer"), QIcon(":/res/layerremove.xpm"), QKeySequence("y, r"), NULL);
375 actionLayersEdit = CreateAction(tr("&Edit Layer"), tr("Edit Layer"), tr("Edit Layer"), QIcon(":/res/layeredit.xpm"), QKeySequence("y, e"), NULL);
376 actionLayersToggleView = CreateAction(tr("&Toggle Layer"), tr("Toggle Layer Visibility"), tr("Toggle Layer"), QIcon(), QKeySequence("y, v"), NULL);
378 actionBlocksDefreezeAll = CreateAction(tr("&Show all"), tr("Show all"), tr("Show all blocks"), QIcon(":/res/visibleblock.xpm"), QKeySequence("b, s"), NULL);
379 actionBlocksFreezeAll = CreateAction(tr("&Hide all"), tr("Hide all"), tr("Hide all blocks"), QIcon(":/res/hiddenblock.xpm"), QKeySequence("b, h"), NULL);
380 actionBlocksAdd = CreateAction(tr("&Add Block"), tr("Add Block"), tr("Add Block"), QIcon(":/res/blockadd.xpm"), QKeySequence("b, a"), NULL);
381 actionBlocksRemove = CreateAction(tr("&Remove Block"), tr("Remove Block"), tr("Remove Block"), QIcon(":/res/blockremove.xpm"), QKeySequence("b, r"), NULL);
382 actionBlocksAttributes = CreateAction(tr("&Rename Block"), tr("Rename Block"), tr("Rename Block and all Inserts"), QIcon(":/res/blockattributes.xpm"), QKeySequence("b, n"), NULL);
383 actionBlocksInsert = CreateAction(tr("&Insert Block"), tr("Insert Block"), tr("Insert Block"), QIcon(":/res/blockinsert.xpm"), QKeySequence("b, i"), NULL);
384 actionBlocksEdit = CreateAction(tr("&Edit Block"), tr("Edit Block"), tr("Edit Block"), QIcon(":/res/blockedit.xpm"), QKeySequence("b, e"), NULL);
385 actionBlocksCreate = CreateAction(tr("&Create Block"), tr("Create Block"), tr("Create Block"), QIcon(":/res/qg_menublock.xpm"), QKeySequence("b, c"), NULL);
386 actionBlocksExplode = CreateAction(tr("&Explode"), tr("Explode"), tr("Explode Blocks and other Entity Groups"), QIcon(":/res/qg_modifyexplode.xpm"), QKeySequence("x, p"), NULL);
388 actionScriptOpenIDE = CreateAction(tr(""), tr(""), tr(""), QIcon(), QKeySequence(), NULL);
389 actionScriptRun = CreateAction(tr(""), tr(""), tr(""), QIcon(), QKeySequence(), NULL);
391 actionCamExportAuto = CreateAction(tr(""), tr(""), tr(""), QIcon(), QKeySequence(), NULL);
392 actionCamReorder = CreateAction(tr(""), tr(""), tr(""), QIcon(), QKeySequence(), NULL);
394 actionHelpAboutApp = CreateAction(tr(""), tr(""), tr(""), QIcon(), QKeySequence(), NULL);
395 actionHelpManual = CreateAction(tr(""), tr(""), tr(""), QIcon(), QKeySequence(), NULL);
399 // Consolidates action creation from a multi-step process to a single-step one.
401 QAction * CreateAction(QString name, QString tooltip, QString statustip, QIcon icon, QKeySequence key, QWidget * w)
403 QAction * action = new QAction(icon, name, w);
404 action->setToolTip(tooltip);
405 action->setStatusTip(statustip);
406 action->setShortcut(key);
412 // This is essentially the same as the previous function, but this allows more
413 // than one key sequence to be added as key shortcuts.
415 QAction * CreateAction2(QString name, QString tooltip, QString statustip, QIcon icon, QKeySequence key1, QKeySequence key2, QWidget * w)
417 QAction * action = new QAction(icon, name, w);
418 action->setToolTip(tooltip);
419 action->setStatusTip(statustip);
420 QList<QKeySequence> keyList;
421 keyList.append(key1);
422 keyList.append(key2);
423 action->setShortcuts(keyList);
428 // Stuff that needs to be added...
430 src/actions/rs_actionblockstoggleview.cpp- QAction * action = new QAction(tr("&Toggle Block"), 0);
431 src/actions/rs_actionblockstoggleview.cpp-// QAction* action = new QAction(tr("Toggle Block Visibility"),
432 src/actions/rs_actionblockstoggleview.cpp-// tr("&Toggle Block"),
433 src/actions/rs_actionblockstoggleview.cpp-// QKeySequence(), NULL);
434 src/actions/rs_actionblockstoggleview.cpp- action->setStatusTip(tr("Toggle Block"));
435 src/actions/rs_actionblockstoggleview.cpp-
436 src/actions/rs_actionblockstoggleview.cpp- return action;
437 src/actions/rs_actionblockstoggleview.cpp-}
439 src/actions/rs_actiondrawlinehorvert.cpp:QAction * RS_ActionDrawLineHorVert::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/)
440 src/actions/rs_actiondrawlinehorvert.cpp-{
441 src/actions/rs_actiondrawlinehorvert.cpp- QAction * action = new QAction(tr("H&orizontal / Vertical"), 0);
442 src/actions/rs_actiondrawlinehorvert.cpp-// QAction* action = new QAction(tr("hor./vert. line"),
443 src/actions/rs_actiondrawlinehorvert.cpp-// tr("H&orizontal / Vertical"),
444 src/actions/rs_actiondrawlinehorvert.cpp-// QKeySequence(), NULL);
445 src/actions/rs_actiondrawlinehorvert.cpp- action->setStatusTip(tr("Draw horizontal/vertical lines"));
446 src/actions/rs_actiondrawlinehorvert.cpp- return action;
447 src/actions/rs_actiondrawlinehorvert.cpp-}
449 src/actions/rs_actioninfoinside.cpp:QAction* RS_ActionInfoInside::createGUIAction(RS2::ActionType /*type*/, QObject* /*parent*/)
450 src/actions/rs_actioninfoinside.cpp-{
451 src/actions/rs_actioninfoinside.cpp- QAction * action = new QAction(tr("&Point inside contour"), 0);
452 src/actions/rs_actioninfoinside.cpp-// QAction* action = new QAction(tr("Point inside contour"),
453 src/actions/rs_actioninfoinside.cpp-// tr("&Point inside contour"),
454 src/actions/rs_actioninfoinside.cpp-// QKeySequence(), NULL);
455 src/actions/rs_actioninfoinside.cpp- action->setStatusTip(tr("Checks if a given point is inside the selected contour"));
456 src/actions/rs_actioninfoinside.cpp-
457 src/actions/rs_actioninfoinside.cpp- return action;
458 src/actions/rs_actioninfoinside.cpp-}
460 src/actions/rs_actionlayerstogglelock.cpp- QAction * action = new QAction(tr("&Toggle Lock"), 0);
461 src/actions/rs_actionlayerstogglelock.cpp-// QAction* action = new QAction(tr("Toggle Layer Lock"),
462 src/actions/rs_actionlayerstogglelock.cpp-// tr("&Toggle Lock"),
463 src/actions/rs_actionlayerstogglelock.cpp-// QKeySequence(), NULL);
464 src/actions/rs_actionlayerstogglelock.cpp- action->setStatusTip(tr("Toggle Lock"));
465 src/actions/rs_actionlayerstogglelock.cpp- return action;
466 src/actions/rs_actionlayerstogglelock.cpp-}
468 src/actions/rs_actionlibraryinsert.cpp:QAction * RS_ActionLibraryInsert::createGUIAction(RS2::ActionType /*type*/, QObject* /*parent*/)
469 src/actions/rs_actionlibraryinsert.cpp-{
470 src/actions/rs_actionlibraryinsert.cpp- QAction * action = new QAction(tr("&Insert Library Object"), 0);
471 src/actions/rs_actionlibraryinsert.cpp-// QAction* action = new QAction(tr("Insert Library Object"),
472 src/actions/rs_actionlibraryinsert.cpp-// tr("&Insert Library Object"),
473 src/actions/rs_actionlibraryinsert.cpp-// QKeySequence(), NULL);
474 src/actions/rs_actionlibraryinsert.cpp- action->setStatusTip(tr("Inserts an Object from the part library."));
475 src/actions/rs_actionlibraryinsert.cpp- return action;
476 src/actions/rs_actionlibraryinsert.cpp-}
478 src/actions/rs_actiontoolregeneratedimensions.cpp:QAction * RS_ActionToolRegenerateDimensions::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/)
479 src/actions/rs_actiontoolregeneratedimensions.cpp-{
480 src/actions/rs_actiontoolregeneratedimensions.cpp- QAction * action = new QAction(tr("&Regenerate Dimension Entities"), 0);
481 src/actions/rs_actiontoolregeneratedimensions.cpp-// QAction* action = new QAction(tr("Regenerate Dimension Entities"),
482 src/actions/rs_actiontoolregeneratedimensions.cpp-// tr("&Regenerate Dimension Entities"),
483 src/actions/rs_actiontoolregeneratedimensions.cpp-// QKeySequence(), NULL);
484 src/actions/rs_actiontoolregeneratedimensions.cpp- action->setStatusTip(tr("Regenerates all Dimension Entities"));
485 src/actions/rs_actiontoolregeneratedimensions.cpp-
486 src/actions/rs_actiontoolregeneratedimensions.cpp- return action;
487 src/actions/rs_actiontoolregeneratedimensions.cpp-}