Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
qucs_init.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qucs_init.cpp
3  ---------------
4  begin : Sat May 1 2004
5  copyright : (C) 2004 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifdef HAVE_CONFIG_H
19 # include <config.h>
20 #endif
21 #include <QtGui>
22 
23 #include "main.h"
24 #include "qucs.h"
26 #include "octave_window.h"
27 
28 
33 {
34  activeAction = 0; // no active action
35 
36  // note: first argument of QAction() for backward compatibility Qt < 3.2
37 
38  fileNew = new QAction(QIcon((":/bitmaps/filenew.png")), tr("&New"), this);
39  fileNew->setShortcut(Qt::CTRL+Qt::Key_N);
40  fileNew->setStatusTip(tr("Creates a new document"));
41  fileNew->setWhatsThis(
42  tr("New\n\nCreates a new schematic or data display document"));
43  connect(fileNew, SIGNAL(activated()), SLOT(slotFileNew()));
44 
45  textNew = new QAction(QIcon((":/bitmaps/textnew.png")), tr("New &Text"), this);
46  textNew->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_V);
47  textNew->setStatusTip(tr("Creates a new text document"));
48  textNew->setWhatsThis(tr("New Text\n\nCreates a new text document"));
49  connect(textNew, SIGNAL(activated()), SLOT(slotTextNew()));
50 
51  fileOpen = new QAction(QIcon((":/bitmaps/fileopen.png")), tr("&Open..."), this);
52  fileOpen->setShortcut(Qt::CTRL+Qt::Key_O);
53  fileOpen->setStatusTip(tr("Opens an existing document"));
54  fileOpen->setWhatsThis(tr("Open File\n\nOpens an existing document"));
55  connect(fileOpen, SIGNAL(activated()), SLOT(slotFileOpen()));
56 
57  fileSave = new QAction(QIcon((":/bitmaps/filesave.png")), tr("&Save"), this);
58  fileSave->setShortcut(Qt::CTRL+Qt::Key_S);
59  fileSave->setStatusTip(tr("Saves the current document"));
60  fileSave->setWhatsThis(tr("Save File\n\nSaves the current document"));
61  connect(fileSave, SIGNAL(activated()), SLOT(slotFileSave()));
62 
63  fileSaveAs = new QAction(tr("Save as..."), this);
64  fileSaveAs->setShortcut(Qt::CTRL+Qt::Key_Minus);
65  fileSaveAs->setStatusTip(
66  tr("Saves the current document under a new filename"));
67  fileSaveAs->setWhatsThis(
68  tr("Save As\n\nSaves the current document under a new filename"));
69  connect(fileSaveAs, SIGNAL(activated()), SLOT(slotFileSaveAs()));
70 
71  fileSaveAll = new QAction(QIcon((":/bitmaps/filesaveall.png")), tr("Save &All"), this);
72  fileSaveAll->setShortcut(Qt::CTRL+Qt::Key_Plus);
73  fileSaveAll->setStatusTip(tr("Saves all open documents"));
74  fileSaveAll->setWhatsThis(tr("Save All Files\n\nSaves all open documents"));
75  connect(fileSaveAll, SIGNAL(activated()), SLOT(slotFileSaveAll()));
76 
77  fileClose = new QAction(QIcon((":/bitmaps/fileclose.png")), tr("&Close"), this);
78  fileClose->setShortcut(Qt::CTRL+Qt::Key_W);
79  fileClose->setStatusTip(tr("Closes the current document"));
80  fileClose->setWhatsThis(tr("Close File\n\nCloses the current document"));
81  connect(fileClose, SIGNAL(activated()), SLOT(slotFileClose()));
82 
83  fileExamples = new QAction(tr("&Examples"), this);
84  fileExamples->setStatusTip(tr("Opens a file explorer with example documents"));
85  fileExamples->setWhatsThis(
86  tr("Examples\n\nOpens a file explorer with example documents"));
87  connect(fileExamples, SIGNAL(activated()), SLOT(slotFileExamples()));
88 
89 
90  symEdit = new QAction(tr("&Edit Circuit Symbol"), this);
91  symEdit->setShortcut(Qt::Key_F9);
92  symEdit->setStatusTip(tr("Edits the symbol for this schematic"));
93  symEdit->setWhatsThis(
94  tr("Edit Circuit Symbol\n\nEdits the symbol for this schematic"));
95  connect(symEdit, SIGNAL(activated()), SLOT(slotSymbolEdit()));
96 
97  fileSettings = new QAction(tr("&Document Settings..."), this);
98  fileSettings->setShortcut(Qt::CTRL+Qt::Key_Period);
99  fileSettings->setStatusTip(tr("Document Settings"));
100  fileSettings->setWhatsThis(tr("Settings\n\nSets properties of the file"));
101  connect(fileSettings, SIGNAL(activated()), SLOT(slotFileSettings()));
102 
103  filePrint = new QAction(QIcon((":/bitmaps/fileprint.png")), tr("&Print..."), this);
104  filePrint->setShortcut(Qt::CTRL+Qt::Key_P);
105  filePrint->setStatusTip(tr("Prints the current document"));
106  filePrint->setWhatsThis(tr("Print File\n\nPrints the current document"));
107  connect(filePrint, SIGNAL(activated()), SLOT(slotFilePrint()));
108 
109  filePrintFit = new QAction(tr("Print Fit to Page..."), this);
110  filePrintFit->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_P);
111  filePrintFit->setStatusTip(tr("Print Fit to Page"));
112  filePrintFit->setWhatsThis(
113  tr("Print Fit to Page\n\n"
114  "Print and fit content to the page size"));
115  connect(filePrintFit, SIGNAL(activated()), SLOT(slotFilePrintFit()));
116 
117  fileQuit = new QAction(tr("E&xit"), this);
118  fileQuit->setShortcut(Qt::CTRL+Qt::Key_Q);
119  fileQuit->setStatusTip(tr("Quits the application"));
120  fileQuit->setWhatsThis(tr("Exit\n\nQuits the application"));
121  connect(fileQuit, SIGNAL(activated()), SLOT(slotFileQuit()));
122 
123  applSettings = new QAction(tr("Application Settings..."), this);
124  applSettings->setShortcut(Qt::CTRL+Qt::Key_Comma);
125  applSettings->setStatusTip(tr("Application Settings"));
126  applSettings->setWhatsThis(
127  tr("Qucs Settings\n\nSets properties of the application"));
128  connect(applSettings, SIGNAL(activated()), SLOT(slotApplSettings()));
129 
130  refreshSchPath = new QAction(tr("Refresh Search Path..."), this);
131  //refreshSchPath->setShortcut(Qt::CTRL+Qt::Key_Comma);
132  refreshSchPath->setStatusTip(tr("Refresh Search Path"));
133  refreshSchPath->setWhatsThis(
134  tr("Refresh Path\n\nRechecks the list of paths for subcircuit files."));
135  connect(refreshSchPath, SIGNAL(activated()), SLOT(slotRefreshSchPath()));
136 
137  alignTop = new QAction(tr("Align top"), this);
138  alignTop->setShortcut(Qt::CTRL+Qt::Key_T);
139  alignTop->setStatusTip(tr("Align top selected elements"));
140  alignTop->setWhatsThis(
141  tr("Align top\n\nAlign selected elements to their upper edge"));
142  connect(alignTop, SIGNAL(activated()), SLOT(slotAlignTop()));
143 
144  alignBottom = new QAction(tr("Align bottom"), this);
145  alignBottom->setStatusTip(tr("Align bottom selected elements"));
146  alignBottom->setWhatsThis(
147  tr("Align bottom\n\nAlign selected elements to their lower edge"));
148  connect(alignBottom, SIGNAL(activated()), SLOT(slotAlignBottom()));
149 
150  alignLeft = new QAction(tr("Align left"), this);
151  alignLeft->setStatusTip(tr("Align left selected elements"));
152  alignLeft->setWhatsThis(
153  tr("Align left\n\nAlign selected elements to their left edge"));
154  connect(alignLeft, SIGNAL(activated()), SLOT(slotAlignLeft()));
155 
156  alignRight = new QAction(tr("Align right"), this);
157  alignRight->setStatusTip(tr("Align right selected elements"));
158  alignRight->setWhatsThis(
159  tr("Align right\n\nAlign selected elements to their right edge"));
160  connect(alignRight, SIGNAL(activated()), SLOT(slotAlignRight()));
161 
162  distrHor = new QAction(tr("Distribute horizontally"), this);
163  distrHor->setStatusTip(tr("Distribute equally horizontally"));
164  distrHor->setWhatsThis(
165  tr("Distribute horizontally\n\n"
166  "Distribute horizontally selected elements"));
167  connect(distrHor, SIGNAL(activated()), SLOT(slotDistribHoriz()));
168 
169  distrVert = new QAction(tr("Distribute vertically"), this);
170  distrVert->setStatusTip(tr("Distribute equally vertically"));
171  distrVert->setWhatsThis(
172  tr("Distribute vertically\n\n"
173  "Distribute vertically selected elements"));
174  connect(distrVert, SIGNAL(activated()), SLOT(slotDistribVert()));
175 
176  centerHor = new QAction(tr("Center horizontally"), this);
177  centerHor->setStatusTip(tr("Center horizontally selected elements"));
178  centerHor->setWhatsThis(
179  tr("Center horizontally\n\nCenter horizontally selected elements"));
180  connect(centerHor, SIGNAL(activated()), SLOT(slotCenterHorizontal()));
181 
182  centerVert = new QAction(tr("Center vertically"), this);
183  centerVert->setStatusTip(tr("Center vertically selected elements"));
184  centerVert->setWhatsThis(
185  tr("Center vertically\n\nCenter vertically selected elements"));
186  connect(centerVert, SIGNAL(activated()), SLOT(slotCenterVertical()));
187 
188  onGrid = new QAction(tr("Set on Grid"), this);
189  onGrid->setShortcut(Qt::CTRL+Qt::Key_U);
190  onGrid->setStatusTip(tr("Sets selected elements on grid"));
191  onGrid->setWhatsThis(
192  tr("Set on Grid\n\nSets selected elements on grid"));
193  onGrid->setToggleAction(true);
194  connect(onGrid, SIGNAL(toggled(bool)), SLOT(slotOnGrid(bool)));
195 
196  moveText = new QAction(tr("Move Component Text"), this);
197  moveText->setShortcut(Qt::CTRL+Qt::Key_K);
198  moveText->setStatusTip(tr("Moves the property text of components"));
199  moveText->setWhatsThis(
200  tr("Move Component Text\n\nMoves the property text of components"));
201  moveText->setToggleAction(true);
202  connect(moveText, SIGNAL(toggled(bool)), SLOT(slotMoveText(bool)));
203 
204  changeProps = new QAction(tr("Replace..."), this);
205  changeProps->setShortcut(Qt::Key_F7);
206  changeProps->setStatusTip(tr("Replace component properties or VHDL code"));
207  changeProps->setWhatsThis(
208  tr("Replace\n\nChange component properties\nor\ntext in VHDL code"));
209  connect(changeProps, SIGNAL(activated()), SLOT(slotChangeProps()));
210 
211  editCut = new QAction(QIcon((":/bitmaps/editcut.png")), tr("Cu&t"), this);
212  editCut->setShortcut(Qt::CTRL+Qt::Key_X);
213  editCut->setStatusTip(
214  tr("Cuts out the selection and puts it into the clipboard"));
215  editCut->setWhatsThis(
216  tr("Cut\n\nCuts out the selection and puts it into the clipboard"));
217  connect(editCut, SIGNAL(activated()), SLOT(slotEditCut()));
218 
219  editCopy = new QAction(QIcon((":/bitmaps/editcopy.png")), tr("&Copy"), this);
220  editCopy->setShortcut(Qt::CTRL+Qt::Key_C);
221  editCopy->setStatusTip(
222  tr("Copies the selection into the clipboard"));
223  editCopy->setWhatsThis(
224  tr("Copy\n\nCopies the selection into the clipboard"));
225  connect(editCopy, SIGNAL(activated()), SLOT(slotEditCopy()));
226 
227  editPaste = new QAction(QIcon((":/bitmaps/editpaste.png")), tr("&Paste"), this);
228  editPaste->setShortcut(Qt::CTRL+Qt::Key_V);
229  editPaste->setStatusTip(
230  tr("Pastes the clipboard contents to the cursor position"));
231  editPaste->setWhatsThis(
232  tr("Paste\n\nPastes the clipboard contents to the cursor position"));
233  editPaste->setToggleAction(true);
234  connect(editPaste, SIGNAL(toggled(bool)), SLOT(slotEditPaste(bool)));
235 
236  editDelete = new QAction(QIcon((":/bitmaps/editdelete.png")), tr("&Delete"), this);
237  editDelete->setShortcut(Qt::Key_Delete);
238  editDelete->setStatusTip(tr("Deletes the selected components"));
239  editDelete->setWhatsThis(tr("Delete\n\nDeletes the selected components"));
240  editDelete->setToggleAction(true);
241  connect(editDelete, SIGNAL(toggled(bool)), SLOT(slotEditDelete(bool)));
242 
243  editFind = new QAction(tr("Find..."), this);
244  editFind->setShortcut(Qt::CTRL+Qt::Key_F);
245  editFind->setStatusTip(tr("Find a piece of text"));
246  editFind->setWhatsThis(tr("Find\n\nSearches for a piece of text"));
247  connect(editFind, SIGNAL(activated()), SLOT(slotEditFind()));
248 
249  editFindAgain = new QAction(tr("Find Again"), this);
250  editFindAgain->setShortcut(Qt::Key_F3);
251  editFindAgain->setStatusTip(tr("Find same text again"));
252  editFindAgain->setWhatsThis(
253  tr("Find\n\nSearches for the same piece of text again"));
254  connect(editFindAgain, SIGNAL(activated()), SLOT(slotEditFindAgain()));
255 
256  // to ease usage with notebooks, backspace can also be used to delete
257  // currently not supported
258  //mainAccel->connectItem(mainAccel->insertItem(Qt::Key_Backspace),
259  // editDelete, SLOT(toggle()) );
260 
261  exportAsImage = new QAction(tr("Export as image"),this);
262  connect(exportAsImage,SIGNAL(activated()),SLOT(slotSaveSchematicToGraphicsFile()));
263 
264  // cursor left/right/up/down to move marker on a graph
265  cursorLeft = new QShortcut(QKeySequence(Qt::Key_Left), this);
266  connect(cursorLeft, SIGNAL(activated()), SLOT(slotCursorLeft()));
267 
268  cursorRight = new QShortcut(QKeySequence(Qt::Key_Right), this);
269  connect(cursorRight, SIGNAL(activated()), SLOT(slotCursorRight()));
270 
271  cursorUp = new QShortcut(QKeySequence(Qt::Key_Up), this);
272  connect(cursorUp, SIGNAL(activated()), SLOT(slotCursorUp()));
273 
274  cursorDown = new QShortcut(QKeySequence(Qt::Key_Down), this);
275  connect(cursorDown, SIGNAL(activated()), SLOT(slotCursorDown()));
276 
277 
278 /*
279  mainAccel->connectItem(mainAccel->insertItem(Qt::Key_Left),
280  this, SLOT(slotCursorLeft()));
281  mainAccel->connectItem(mainAccel->insertItem(Qt::Key_Right),
282  this, SLOT(slotCursorRight()));
283  mainAccel->connectItem(mainAccel->insertItem(Qt::Key_Up),
284  this, SLOT(slotCursorUp()));
285  mainAccel->connectItem(mainAccel->insertItem(Qt::Key_Down),
286  this, SLOT(slotCursorDown()));
287  mainAccel->connectItem(mainAccel->insertItem(Qt::Key_Tab),
288  this, SLOT(slotNextTab()));
289 */
290 
291  undo = new QAction(QIcon((":/bitmaps/undo.png")), tr("&Undo"), this);
292  undo->setShortcut(Qt::CTRL+Qt::Key_Z);
293  undo->setStatusTip(tr("Undoes the last command"));
294  undo->setWhatsThis(tr("Undo\n\nMakes the last action undone"));
295  connect(undo, SIGNAL(activated()), SLOT(slotEditUndo()));
296 
297  redo = new QAction(QIcon((":/bitmaps/redo.png")), tr("&Redo"), this);
298  redo->setShortcut(Qt::CTRL+Qt::Key_Y);
299  redo->setStatusTip(tr("Redoes the last command"));
300  redo->setWhatsThis(tr("Redo\n\nRepeats the last action once more"));
301  connect(redo, SIGNAL(activated()), SLOT(slotEditRedo()));
302 
303  projNew = new QAction(tr("&New Project..."), this);
304  projNew->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_N);
305  projNew->setStatusTip(tr("Creates a new project"));
306  projNew->setWhatsThis(tr("New Project\n\nCreates a new project"));
307  connect(projNew, SIGNAL(activated()), SLOT(slotProjNewButt()));
308 
309  projOpen = new QAction(tr("&Open Project..."), this);
310  projOpen->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_O);
311  projOpen->setStatusTip(tr("Opens an existing project"));
312  projOpen->setWhatsThis(tr("Open Project\n\nOpens an existing project"));
313  connect(projOpen, SIGNAL(activated()), SLOT(slotMenuOpenProject()));
314 
315  projDel = new QAction(tr("&Delete Project..."), this);
316  projDel->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_D);
317  projDel->setStatusTip(tr("Deletes an existing project"));
318  projDel->setWhatsThis(tr("Delete Project\n\nDeletes an existing project"));
319  connect(projDel, SIGNAL(activated()), SLOT(slotMenuDelProject()));
320 
321  projClose = new QAction(tr("&Close Project"), this);
322  projClose->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_W);
323  projClose->setStatusTip(tr("Closes the current project"));
324  projClose->setWhatsThis(tr("Close Project\n\nCloses the current project"));
325  connect(projClose, SIGNAL(activated()), SLOT(slotMenuCloseProject()));
326 
327  addToProj = new QAction(tr("&Add Files to Project..."), this);
328  addToProj->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_A);
329  addToProj->setStatusTip(tr("Copies files to project directory"));
330  addToProj->setWhatsThis(
331  tr("Add Files to Project\n\nCopies files to project directory"));
332  connect(addToProj, SIGNAL(activated()), SLOT(slotAddToProject()));
333 
334  createLib = new QAction(tr("Create &Library..."), this);
335  createLib->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_L);
336  createLib->setStatusTip(tr("Create Library from Subcircuits"));
337  createLib->setWhatsThis(
338  tr("Create Library\n\nCreate Library from Subcircuits"));
339  connect(createLib, SIGNAL(activated()), SLOT(slotCreateLib()));
340 
341  createPkg = new QAction(tr("Create &Package..."), this);
342  createPkg->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_Z);
343  createPkg->setStatusTip(tr("Create compressed Package from Projects"));
344  createPkg->setWhatsThis(
345  tr("Create Package\n\nCreate compressed Package from complete Projects"));
346  connect(createPkg, SIGNAL(activated()), SLOT(slotCreatePackage()));
347 
348  extractPkg = new QAction(tr("E&xtract Package..."), this);
349  extractPkg->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_X);
350  extractPkg->setStatusTip(tr("Install Content of a Package"));
351  extractPkg->setWhatsThis(
352  tr("Extract Package\n\nInstall Content of a Package"));
353  connect(extractPkg, SIGNAL(activated()), SLOT(slotExtractPackage()));
354 
355  importData = new QAction(tr("&Import/Export Data..."), this);
356  importData->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_I);
357  importData->setStatusTip(tr("Convert data file"));
358  importData->setWhatsThis(
359  tr("Import/Export Data\n\nConvert data file to various file formats"));
360  connect(importData, SIGNAL(activated()), SLOT(slotImportData()));
361 
362  graph2csv = new QAction(tr("Export to &CSV..."), this);
363  graph2csv->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_C);
364  graph2csv->setStatusTip(tr("Convert graph data to CSV file"));
365  graph2csv->setWhatsThis(
366  tr("Export to CSV\n\nConvert graph data to CSV file"));
367  connect(graph2csv, SIGNAL(activated()), SLOT(slotExportGraphAsCsv()));
368 
369  buildModule = new QAction(tr("Build Verilog-A module..."), this);
370  buildModule->setStatusTip(tr("Run admsXml and C++ compiler"));
371  buildModule->setWhatsThis(tr("Build Verilog-A module\nRuns amdsXml and C++ compiler"));
372  connect(buildModule, SIGNAL(activated()), SLOT(slotBuildModule()));
373 
374  loadModule = new QAction(tr("Load Verilog-A module..."), this);
375  loadModule->setStatusTip(tr("Select Verilog-A symbols to be loaded"));
376  loadModule->setWhatsThis(tr("Load Verilog-A module\nLet the user select and load symbols"));
377  connect(loadModule, SIGNAL(activated()), SLOT(slotLoadModule()));
378 
379  magAll = new QAction(QIcon((":/bitmaps/viewmagfit.png")), tr("View All"), this);
380  magAll->setShortcut(Qt::Key_0);
381  magAll->setStatusTip(tr("Show the whole page"));
382  magAll->setWhatsThis(tr("View All\n\nShows the whole page content"));
383  connect(magAll, SIGNAL(activated()), SLOT(slotShowAll()));
384 
385  magOne = new QAction(QIcon((":/bitmaps/viewmag1.png")), tr("View 1:1"), this);
386  magOne->setShortcut(Qt::Key_1);
387  magOne->setStatusTip(tr("Views without magnification"));
388  magOne->setWhatsThis(tr("View 1:1\n\nShows the page content without magnification"));
389  connect(magOne, SIGNAL(activated()), SLOT(slotShowOne()));
390 
391  magPlus = new QAction(QIcon((":/bitmaps/viewmag+.png")), tr("Zoom in"), this);
392  magPlus->setShortcut(Qt::Key_Plus);
393  magPlus->setStatusTip(tr("Zooms into the current view"));
394  magPlus->setWhatsThis(tr("Zoom in\n\nZooms the current view"));
395  magPlus->setToggleAction(true);
396  connect(magPlus, SIGNAL(toggled(bool)), SLOT(slotZoomIn(bool)));
397 
398  magMinus = new QAction(QIcon((":/bitmaps/viewmag-.png")), tr("Zoom out"), this);
399  magMinus->setShortcut(Qt::Key_Minus);
400  magMinus->setStatusTip(tr("Zooms out the current view"));
401  magMinus->setWhatsThis(tr("Zoom out\n\nZooms out the current view"));
402  connect(magMinus, SIGNAL(activated()), SLOT(slotZoomOut()));
403 
404  QAction *escape = new QAction(this);
405  escape->setShortcut(Qt::Key_Escape);
406  connect(escape, SIGNAL(activated()), SLOT(slotEscape()));
407  this->addAction(escape);
408 
409  select = new QAction(QIcon((":/bitmaps/pointer.png")), tr("Select"), this);
410  select->setStatusTip(tr("Activate select mode"));
411  select->setWhatsThis(tr("Select\n\nActivates select mode"));
412  select->setToggleAction(true);
413  connect(select, SIGNAL(toggled(bool)), SLOT(slotSelect(bool)));
414 
415  selectAll = new QAction(tr("Select All"), this);
416  selectAll->setShortcut(Qt::CTRL+Qt::Key_A);
417  selectAll->setStatusTip(tr("Selects all elements"));
418  selectAll->setWhatsThis(
419  tr("Select All\n\nSelects all elements of the document"));
420  connect(selectAll, SIGNAL(activated()), SLOT(slotSelectAll()));
421 
422  selectMarker = new QAction(tr("Select Markers"), this);
423  selectMarker->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_M);
424  selectMarker->setStatusTip(tr("Selects all markers"));
425  selectMarker->setWhatsThis(
426  tr("Select Markers\n\nSelects all diagram markers of the document"));
427  connect(selectMarker, SIGNAL(activated()), SLOT(slotSelectMarker()));
428 
429  editRotate = new QAction(QIcon((":/bitmaps/rotate_ccw.png")), tr("Rotate"), this);
430  editRotate->setShortcut(Qt::CTRL+Qt::Key_R);
431  editRotate->setStatusTip(tr("Rotates the selected component by 90\x00B0"));
432  editRotate->setWhatsThis(
433  tr("Rotate\n\nRotates the selected component by 90\x00B0 counter-clockwise"));
434  editRotate->setToggleAction(true);
435  connect(editRotate, SIGNAL(toggled(bool)), SLOT(slotEditRotate(bool)));
436 
437  editMirror = new QAction(QIcon((":/bitmaps/mirror.png")), tr("Mirror about X Axis"), this);
438  editMirror->setShortcut(Qt::CTRL+Qt::Key_J);
439  editMirror->setStatusTip(tr("Mirrors the selected item about X Axis"));
440  editMirror->setWhatsThis(
441  tr("Mirror about X Axis\n\nMirrors the selected item about X Axis"));
442  editMirror->setToggleAction(true);
443  connect(editMirror, SIGNAL(toggled(bool)), SLOT(slotEditMirrorX(bool)));
444 
445  editMirrorY = new QAction(QIcon((":/bitmaps/mirrory.png")), tr("Mirror about Y Axis"), this);
446  editMirrorY->setShortcut(Qt::CTRL+Qt::Key_M);
447  editMirrorY->setStatusTip(tr("Mirrors the selected item about Y Axis"));
448  editMirrorY->setWhatsThis(
449  tr("Mirror about Y Axis\n\nMirrors the selected item about Y Axis"));
450  editMirrorY->setToggleAction(true);
451  connect(editMirrorY, SIGNAL(toggled(bool)), SLOT(slotEditMirrorY(bool)));
452 
453  intoH = new QAction(QIcon((":/bitmaps/bottom.png")), tr("Go into Subcircuit"), this);
454  intoH->setShortcut(Qt::CTRL+Qt::Key_I);
455  intoH->setStatusTip(tr("Goes inside the selected subcircuit"));
456  intoH->setWhatsThis(
457  tr("Go into Subcircuit\n\nGoes inside the selected subcircuit"));
458  connect(intoH, SIGNAL(activated()), SLOT(slotIntoHierarchy()));
459 
460  popH = new QAction(QIcon((":/bitmaps/top.png")), tr("Pop out"), this);
461  popH->setShortcut(Qt::CTRL+Qt::Key_H);
462  popH->setStatusTip(tr("Pop outside subcircuit"));
463  popH->setWhatsThis(
464  tr("Pop out\n\nGoes up one hierarchy level, i.e. leaves subcircuit"));
465  connect(popH, SIGNAL(activated()), SLOT(slotPopHierarchy()));
466  popH->setEnabled(false); // only enabled if useful !!!!
467 
468  editActivate = new QAction(QIcon((":/bitmaps/deactiv.png")), tr("Deactivate/Activate"), this);
469  editActivate->setShortcut(Qt::CTRL+Qt::Key_D);
470  editActivate->setStatusTip(tr("Deactivate/Activate selected components"));
471  editActivate->setWhatsThis(
472  tr("Deactivate/Activate\n\nDeactivate/Activate the selected components"));
473  editActivate->setToggleAction(true);
474  connect(editActivate, SIGNAL(toggled(bool)), SLOT(slotEditActivate(bool)));
475 
476  insEquation = new QAction(QIcon((":/bitmaps/equation.png")), tr("Insert Equation"), this);
477  insEquation->setShortcut(Qt::CTRL+Qt::Key_Less);
478  insEquation->setStatusTip(tr("Inserts an equation"));
479  insEquation->setWhatsThis(
480  tr("Insert Equation\n\nInserts a user defined equation"));
481  insEquation->setToggleAction(true);
482  connect(insEquation, SIGNAL(toggled(bool)), SLOT(slotInsertEquation(bool)));
483 
484  insGround = new QAction(QIcon((":/bitmaps/ground.png")), tr("Insert Ground"), this);
485  insGround->setShortcut(Qt::CTRL+Qt::Key_G);
486  insGround->setStatusTip(tr("Inserts a ground symbol"));
487  insGround->setWhatsThis(tr("Insert Ground\n\nInserts a ground symbol"));
488  insGround->setToggleAction(true);
489  connect(insGround, SIGNAL(toggled(bool)), SLOT(slotInsertGround(bool)));
490 
491  insPort = new QAction(QIcon((":/bitmaps/port.png")), tr("Insert Port"), this);
492  insPort->setStatusTip(tr("Inserts a port symbol"));
493  insPort->setWhatsThis(tr("Insert Port\n\nInserts a port symbol"));
494  insPort->setToggleAction(true);
495  connect(insPort, SIGNAL(toggled(bool)), SLOT(slotInsertPort(bool)));
496 
497  insWire = new QAction(QIcon((":/bitmaps/wire.png")), tr("Wire"), this);
498  insWire->setShortcut(Qt::CTRL+Qt::Key_E);
499  insWire->setStatusTip(tr("Inserts a wire"));
500  insWire->setWhatsThis(tr("Wire\n\nInserts a wire"));
501  insWire->setToggleAction(true);
502  connect(insWire, SIGNAL(toggled(bool)), SLOT(slotSetWire(bool)));
503 
504  insLabel = new QAction(QIcon((":/bitmaps/nodename.png")), tr("Wire Label"), this);
505  insLabel->setShortcut(Qt::CTRL+Qt::Key_L);
506  insLabel->setStatusTip(tr("Inserts a wire or pin label"));
507  insLabel->setWhatsThis(tr("Wire Label\n\nInserts a wire or pin label"));
508  insLabel->setToggleAction(true);
509  connect(insLabel, SIGNAL(toggled(bool)), SLOT(slotInsertLabel(bool)));
510 
511  insEntity = new QAction(tr("VHDL entity"), this);
512  insEntity->setShortcut(Qt::CTRL+Qt::Key_Space);
513  insEntity->setStatusTip(tr("Inserts skeleton of VHDL entity"));
514  insEntity->setWhatsThis(
515  tr("VHDL entity\n\nInserts the skeleton of a VHDL entity"));
516  connect(insEntity, SIGNAL(activated()), SLOT(slotInsertEntity()));
517 
518  callEditor = new QAction(tr("Text Editor"), this);
519  callEditor->setShortcut(Qt::CTRL+Qt::Key_1);
520  callEditor->setStatusTip(tr("Starts the Qucs text editor"));
521  callEditor->setWhatsThis(tr("Text editor\n\nStarts the Qucs text editor"));
522  connect(callEditor, SIGNAL(activated()), SLOT(slotCallEditor()));
523 
524  callFilter = new QAction(tr("Filter synthesis"), this);
525  callFilter->setShortcut(Qt::CTRL+Qt::Key_2);
526  callFilter->setStatusTip(tr("Starts QucsFilter"));
527  callFilter->setWhatsThis(tr("Filter synthesis\n\nStarts QucsFilter"));
528  connect(callFilter, SIGNAL(activated()), SLOT(slotCallFilter()));
529 
530  callLine = new QAction(tr("Line calculation"), this);
531  callLine->setShortcut(Qt::CTRL+Qt::Key_3);
532  callLine->setStatusTip(tr("Starts QucsTrans"));
533  callLine->setWhatsThis(
534  tr("Line calculation\n\nStarts transmission line calculator"));
535  connect(callLine, SIGNAL(activated()), SLOT(slotCallLine()));
536 
537  callLib = new QAction(tr("Component Library"), this);
538  callLib->setShortcut(Qt::CTRL+Qt::Key_4);
539  callLib->setStatusTip(tr("Starts QucsLib"));
540  callLib->setWhatsThis(
541  tr("Component Library\n\nStarts component library program"));
542  connect(callLib, SIGNAL(activated()), SLOT(slotCallLibrary()));
543 
544  callMatch = new QAction(tr("Matching Circuit"), this);
545  callMatch->setShortcut(Qt::CTRL+Qt::Key_5);
546  callMatch->setStatusTip(tr("Creates Matching Circuit"));
547  callMatch->setWhatsThis(
548  tr("Matching Circuit\n\nDialog for Creating Matching Circuit"));
549  connect(callMatch, SIGNAL(activated()), SLOT(slotCallMatch()));
550 
551  callAtt = new QAction(tr("Attenuator synthesis"), this);
552  callAtt->setShortcut(Qt::CTRL+Qt::Key_6);
553  callAtt->setStatusTip(tr("Starts QucsAttenuator"));
554  callAtt->setWhatsThis(
555  tr("Attenuator synthesis\n\nStarts attenuator calculation program"));
556  connect(callAtt, SIGNAL(activated()), SLOT(slotCallAtt()));
557 
558  callRes = new QAction(tr("Resistor color codes"), this);
559  callRes->setShortcut(Qt::CTRL+Qt::Key_7);
560  callRes->setStatusTip(tr("Starts Qucs resistor color codes"));
561  callRes->setWhatsThis(
562  tr("Resistor color codes\n\nStarts standard resistor color code computation program"));
563  connect(callRes, SIGNAL(activated()), SLOT(slotCallRes()));
564 
565  simulate = new QAction(QIcon((":/bitmaps/gear.png")), tr("Simulate"), this);
566  simulate->setShortcut(Qt::Key_F2);
567  simulate->setStatusTip(tr("Simulates the current schematic"));
568  simulate->setWhatsThis(tr("Simulate\n\nSimulates the current schematic"));
569  connect(simulate, SIGNAL(activated()), SLOT(slotSimulate()));
570 
571  dpl_sch = new QAction(QIcon((":/bitmaps/rebuild.png")), tr("View Data Display/Schematic"), this);
572  dpl_sch->setShortcut(Qt::Key_F4);
573  dpl_sch->setStatusTip(tr("Changes to data display or schematic page"));
574  dpl_sch->setWhatsThis(
575  tr("View Data Display/Schematic\n\n")+
576  tr("Changes to data display or schematic page"));
577  connect(dpl_sch, SIGNAL(activated()), SLOT(slotToPage()));
578 
579  dcbias = new QAction(tr("Calculate DC bias"), this);
580  dcbias->setShortcut(Qt::Key_F8);
581  dcbias->setStatusTip(tr("Calculates DC bias and shows it"));
582  dcbias->setWhatsThis(
583  tr("Calculate DC bias\n\nCalculates DC bias and shows it"));
584  connect(dcbias, SIGNAL(activated()), SLOT(slotDCbias()));
585 
586  setMarker = new QAction(QIcon((":/bitmaps/marker.png")), tr("Set Marker on Graph"), this);
587  setMarker->setShortcut(Qt::CTRL+Qt::Key_B);
588  setMarker->setStatusTip(tr("Sets a marker on a diagram's graph"));
589  setMarker->setWhatsThis(
590  tr("Set Marker\n\nSets a marker on a diagram's graph"));
591  setMarker->setToggleAction(true);
592  connect(setMarker, SIGNAL(toggled(bool)), SLOT(slotSetMarker(bool)));
593 
594  showMsg = new QAction(tr("Show Last Messages"), this);
595  showMsg->setShortcut(Qt::Key_F5);
596  showMsg->setStatusTip(tr("Shows last simulation messages"));
597  showMsg->setWhatsThis(
598  tr("Show Last Messages\n\nShows the messages of the last simulation"));
599  connect(showMsg, SIGNAL(activated()), SLOT(slotShowLastMsg()));
600 
601  showNet = new QAction(tr("Show Last Netlist"), this);
602  showNet->setShortcut(Qt::Key_F6);
603  showNet->setStatusTip(tr("Shows last simulation netlist"));
604  showNet->setWhatsThis(
605  tr("Show Last Netlist\n\nShows the netlist of the last simulation"));
606  connect(showNet, SIGNAL(activated()), SLOT(slotShowLastNetlist()));
607 
608  viewToolBar = new QAction(tr("Tool&bar"), this);
609  viewToolBar->setToggleAction(true);
610  viewToolBar->setStatusTip(tr("Enables/disables the toolbar"));
611  viewToolBar->setWhatsThis(tr("Toolbar\n\nEnables/disables the toolbar"));
612  connect(viewToolBar, SIGNAL(toggled(bool)), SLOT(slotViewToolBar(bool)));
613 
614  viewStatusBar = new QAction(tr("&Statusbar"), this);
615  viewStatusBar->setToggleAction(true);
616  viewStatusBar->setStatusTip(tr("Enables/disables the statusbar"));
617  viewStatusBar->setWhatsThis(
618  tr("Statusbar\n\nEnables/disables the statusbar"));
619  connect(viewStatusBar, SIGNAL(toggled(bool)), SLOT(slotViewStatusBar(bool)));
620 
621  viewBrowseDock = new QAction(tr("&Dock Window"), this);
622  viewBrowseDock->setToggleAction(true);
623  viewBrowseDock->setStatusTip(tr("Enables/disables the browse dock window"));
624  viewBrowseDock->setWhatsThis(
625  tr("Browse Window\n\nEnables/disables the browse dock window"));
626  connect(viewBrowseDock, SIGNAL(toggled(bool)), SLOT(slotViewBrowseDock(bool)));
627 
628  viewOctaveDock = new QAction(tr("&Octave Window"), this);
629  viewOctaveDock->setToggleAction(true);
630  viewOctaveDock->setStatusTip(tr("Shows/hides the Octave dock window"));
631  viewOctaveDock->setWhatsThis(
632  tr("Octave Window\n\nShows/hides the Octave dock window"));
633  connect(viewOctaveDock, SIGNAL(toggled(bool)), SLOT(slotViewOctaveDock(bool)));
634 
635  helpIndex = new QAction(tr("Help Index..."), this);
636  helpIndex->setShortcut(Qt::Key_F1);
637  helpIndex->setStatusTip(tr("Index of Qucs Help"));
638  helpIndex->setWhatsThis(tr("Help Index\n\nIndex of intern Qucs help"));
639  connect(helpIndex, SIGNAL(activated()), SLOT(slotHelpIndex()));
640 
641  helpGetStart = new QAction(tr("Getting Started..."), this);
642  helpGetStart->setStatusTip(tr("Getting Started with Qucs"));
643  helpGetStart->setWhatsThis(
644  tr("Getting Started\n\nShort introduction into Qucs"));
645  connect(helpGetStart, SIGNAL(activated()), SLOT(slotGettingStarted()));
646 
647  helpAboutApp = new QAction(tr("&About Qucs..."), this);
648  helpAboutApp->setStatusTip(tr("About the application"));
649  helpAboutApp->setWhatsThis(tr("About\n\nAbout the application"));
650  connect(helpAboutApp, SIGNAL(activated()), SLOT(slotHelpAbout()));
651 
652  helpAboutQt = new QAction(tr("About Qt..."), this);
653  helpAboutQt->setStatusTip(tr("About Qt"));
654  helpAboutQt->setWhatsThis(tr("About Qt\n\nAbout Qt by Trolltech"));
655  connect(helpAboutQt, SIGNAL(activated()), SLOT(slotHelpAboutQt()));
656 }
657 
658 // ----------------------------------------------------------
660 {
661  fileMenu = new QMenu(tr("&File")); // menuBar entry fileMenu
662  fileMenu->addAction(fileNew);
663  fileMenu->addAction(textNew);
664  fileMenu->addAction(fileOpen);
665  fileMenu->addAction(fileClose);
666 
667  recentfilesMenu = new QMenu(tr("Open Recent"),fileMenu);
668  fileMenu->addMenu(recentfilesMenu);
670 
671  fileMenu->insertSeparator();
672  fileMenu->addAction(fileSave);
673  fileMenu->addAction(fileSaveAll);
674  fileMenu->addAction(fileSaveAs);
675  fileMenu->addAction(exportAsImage);
676  fileMenu->addAction(filePrint);
677  fileMenu->addAction(filePrintFit);
678  fileMenu->insertSeparator();
679  fileMenu->addAction(fileExamples);
680  fileMenu->insertSeparator();
681  fileMenu->addAction(fileSettings);
682  fileMenu->addAction(symEdit);
683  fileMenu->insertSeparator();
684  fileMenu->addAction(applSettings);
685  fileMenu->addAction(refreshSchPath);
686  fileMenu->insertSeparator();
687  fileMenu->addAction(fileQuit);
688 
689  editMenu = new QMenu(tr("&Edit")); // menuBar entry editMenu
690  editMenu->addAction(undo);
691  editMenu->addAction(redo);
692  editMenu->insertSeparator();
693  editMenu->addAction(editCut);
694  editMenu->addAction(editCopy);
695  editMenu->addAction(editPaste);
696  editMenu->addAction(editDelete);
697  editMenu->insertSeparator();
698  editMenu->addAction(select);
699  editMenu->addAction(selectAll);
700  editMenu->addAction(selectMarker);
701  editMenu->addAction(editFind);
702  editMenu->addAction(editFindAgain);
703  editMenu->addAction(changeProps);
704  editMenu->addAction(editRotate);
705  editMenu->addAction(editMirror);
706  editMenu->addAction(editMirrorY);
707  editMenu->addAction(editActivate);
708  editMenu->insertSeparator();
709  editMenu->addAction(intoH);
710  editMenu->addAction(popH);
711 
712 
713 
714  alignMenu = new QMenu(tr("P&ositioning")); // menuBar entry alignMenu
715  alignMenu->addAction(moveText);
716  alignMenu->addAction(onGrid);
717  alignMenu->insertSeparator();
718  alignMenu->addAction(centerHor);
719  alignMenu->addAction(centerVert);
720  alignMenu->insertSeparator();
721  alignMenu->addAction(alignTop);
722  alignMenu->addAction(alignBottom);
723  alignMenu->addAction(alignLeft);
724  alignMenu->addAction(alignRight);
725  alignMenu->insertSeparator();
726  alignMenu->addAction(distrHor);
727  alignMenu->addAction(distrVert);
728 
729 
730 
731  insMenu = new QMenu(tr("&Insert")); // menuBar entry insMenu
732  insMenu->addAction(insWire);
733  insMenu->addAction(insLabel);
734  insMenu->addAction(insEquation);
735  insMenu->addAction(insGround);
736  insMenu->addAction(insPort);
737  insMenu->addAction(setMarker);
738  insMenu->addAction(insEntity);
739 
740 
741  projMenu = new QMenu(tr("&Project")); // menuBar entry projMenu
742  projMenu->addAction(projNew);
743  projMenu->addAction(projOpen);
744  projMenu->addAction(addToProj);
745  projMenu->addAction(projClose);
746  projMenu->addAction(projDel);
747  projMenu->insertSeparator();
748  projMenu->addAction(createLib);
749  projMenu->addAction(createPkg);
750  projMenu->addAction(extractPkg);
751  projMenu->insertSeparator();
752  projMenu->addAction(importData);
753  projMenu->addAction(graph2csv);
754  projMenu->insertSeparator();
755  // TODO only enable if document is VA file
756  projMenu->addAction(buildModule);
757  projMenu->addAction(loadModule);
758 
759  toolMenu = new QMenu(tr("&Tools")); // menuBar entry toolMenu
760  toolMenu->addAction(callEditor);
761  toolMenu->addAction(callFilter);
762  toolMenu->addAction(callLine);
763  toolMenu->addAction(callLib);
764  toolMenu->addAction(callMatch);
765  toolMenu->addAction(callAtt);
766  toolMenu->addAction(callRes);
767 
768 
769 
770  simMenu = new QMenu(tr("&Simulation")); // menuBar entry simMenu
771  simMenu->addAction(simulate);
772  simMenu->addAction(dpl_sch);
773  simMenu->addAction(dcbias);
774  simMenu->addAction(showMsg);
775  simMenu->addAction(showNet);
776 
777 
778  viewMenu = new QMenu(tr("&View")); // menuBar entry viewMenu
779  viewMenu->addAction(magAll);
780  viewMenu->addAction(magOne);
781  viewMenu->addAction(magPlus);
782  viewMenu->addAction(magMinus);
783  viewMenu->insertSeparator();
784  viewMenu->setCheckable(true);
785  viewMenu->addAction(viewToolBar);
786  viewMenu->addAction(viewStatusBar);
787  viewMenu->addAction(viewBrowseDock);
788  viewMenu->addAction(viewOctaveDock);
789 
790 
791  helpMenu = new QMenu(tr("&Help")); // menuBar entry helpMenu
792  helpMenu->addAction(helpIndex);
793  helpMenu->addAction(helpGetStart);
794  helpMenu->insertSeparator();
795 
796 
797 
798  //Fill submenu's with filenames of PDF documents
799  QDir TechnicalDir = QDir(QucsSettings.DocDir.replace('\\','/'));
800 
801  if(TechnicalDir.cd("technical"))
802  {
803  helpTechnical = new QMenu(tr("&Technical Papers"));
804  helpMenu->addMenu(helpTechnical);
805  TechnicalDir.setFilter(QDir::Files);
806  QStringList entries = TechnicalDir.entryList();
807  for(int i=0;i<entries.size();i++)
808  {
809  QAction* helpTechnicalActions = new QAction(entries[i], this);
810  helpTechnicalActions->setObjectName ( entries[i] );
811  helpTechnicalActions->setStatusTip(tr("Open ")+entries[i]);
812  helpTechnicalActions->setWhatsThis(tr(entries[i]+"\n\nOpen "+entries[i]));
813  connect(helpTechnicalActions, SIGNAL(activated()), SLOT(slotHelpTechnical()));
814  helpTechnical->addAction(helpTechnicalActions);
815  }
816 
817  }
818 
819 //Fill submenu's with filenames of PDF documents
820  QDir ReportDir = QDir(QucsSettings.DocDir.replace('\\','/'));
821  if(ReportDir.cd("report"))
822  {
823  helpReport = new QMenu(tr("Technical &Reports"));
824  helpMenu->addMenu(helpReport);
825  ReportDir.setFilter(QDir::Files);
826  QStringList entries = ReportDir.entryList();
827  for(int i=0;i<entries.size();i++)
828  {
829  QAction* helpReportActions = new QAction(entries[i], this);
830  helpReportActions->setObjectName ( entries[i] );
831  helpReportActions->setStatusTip(tr("Open ")+entries[i]);
832  helpReportActions->setWhatsThis(tr(entries[i]+"\n\nOpen "+entries[i]));
833  connect(helpReportActions, SIGNAL(activated()), SLOT(slotHelpReport()));
834  helpReport->addAction(helpReportActions);
835  }
836  }
837 
838 //Fill submenu's with filenames of PDF documents
839  QDir TutorialDir = QDir(QucsSettings.DocDir.replace('\\','/'));
840  if(TutorialDir.cd("tutorial"))
841  {
842  helpTutorial = new QMenu(tr("T&utorials"));
843  helpMenu->addMenu(helpTutorial);
844  TutorialDir.setFilter(QDir::Files);
845  QStringList entries = TutorialDir.entryList();
846  for(int i=0;i<entries.size();i++)
847  {
848  QAction* helpTutorialActions = new QAction(entries[i], this);
849  helpTutorialActions->setObjectName ( entries[i] );
850  helpTutorialActions->setStatusTip(tr("Open ")+entries[i]);
851  helpTutorialActions->setWhatsThis(tr(entries[i]+"\n\nOpen "+entries[i]));
852  connect(helpTutorialActions, SIGNAL(activated()), SLOT(slotHelpTutorial()));
853  helpTutorial->addAction(helpTutorialActions);
854  }
855  }
856 
857 
858  helpMenu->insertSeparator();
859  helpMenu->addAction(helpAboutApp);
860  helpMenu->addAction(helpAboutQt);
861 
862 
863  menuBar()->addMenu(fileMenu);
864  menuBar()->addMenu(editMenu);
865  menuBar()->addMenu(alignMenu);
866  menuBar()->addMenu(insMenu);
867  menuBar()->addMenu(projMenu);
868  menuBar()->addMenu(toolMenu);
869  menuBar()->addMenu(simMenu);
870  menuBar()->addMenu(viewMenu);
871  menuBar()->insertSeparator();
872  menuBar()->addMenu(helpMenu);
873 
874 }
875 
876 // ----------------------------------------------------------
878 {
879  fileToolbar = new QToolBar(tr("File"));
880  this->addToolBar(fileToolbar);
881  fileToolbar->addAction(fileNew);
882  fileToolbar->addAction(textNew);
883  fileToolbar->addAction(fileOpen);
884  fileToolbar->addAction(fileSave);
885  fileToolbar->addAction(fileSaveAll);
886  fileToolbar->addAction(fileClose);
887  fileToolbar->addAction(filePrint);
888 
889 
890 
891  editToolbar = new QToolBar(tr("Edit"));
892  this->addToolBar(editToolbar);
893  editToolbar->addAction(editCut);
894  editToolbar->addAction(editCopy);
895  editToolbar->addAction(editPaste);
896  editToolbar->addAction(editDelete);
897  editToolbar->addAction(undo);
898  editToolbar->addAction(redo);
899 
900 
901 
902  viewToolbar = new QToolBar(tr("View"));
903  this->addToolBar(viewToolbar);
904  viewToolbar->addAction(magAll);
905  viewToolbar->addAction(magOne);
906  viewToolbar->addAction(magPlus);
907  viewToolbar->addAction(magMinus);
908 
909 
910  workToolbar = new QToolBar(tr("Work"));
911  this->addToolBar(workToolbar);
912  workToolbar->addAction(select);
913  workToolbar->addAction(editActivate);
914  workToolbar->addAction(editMirror);
915  workToolbar->addAction(editMirrorY);
916  workToolbar->addAction(editRotate);
917  workToolbar->addAction(intoH);
918  workToolbar->addAction(popH);
919  workToolbar->addAction(insWire);
920  workToolbar->addAction(insLabel);
921  workToolbar->addAction(insEquation);
922  workToolbar->addAction(insGround);
923  workToolbar->addAction(insPort);
924  workToolbar->addAction(simulate);
925  workToolbar->addAction(dpl_sch);
926  workToolbar->addAction(setMarker);
927  workToolbar->addSeparator(); // <<<=======================
928 
929 }
930 
931 // ----------------------------------------------------------
933 {
934  // To reserve enough space, insert the longest text and rewrite it afterwards.
935  WarningLabel = new QLabel(tr("no warnings"), statusBar());
936  statusBar()->addWidget(WarningLabel, 0, true);
937 
938  PositionLabel = new QLabel("0 : 0", statusBar());
939  PositionLabel->setAlignment(Qt::AlignRight);
940  statusBar()->addWidget(PositionLabel, 0, true);
941 
942  statusBar()->message(tr("Ready."), 2000);
943 }
944 
945 // ----------------------------------------------------------
947 {
948  static int ResultState = 0;
949 
950  if(ResultState == 0) {
951  QFont f = WarningLabel->font();
952  f.setWeight(QFont::DemiBold);
953  WarningLabel->setFont(f);
954  WarningLabel->setText(tr("Warnings in last simulation! Press F5"));
955  }
956 
957  ResultState++;
958  if(ResultState & 1)
959  WarningLabel->setPaletteForegroundColor(Qt::red);
960  else
961  WarningLabel->setPaletteForegroundColor(Qt::black);
962 
963  if(ResultState < 9)
964  QTimer::singleShot(500, this, SLOT(slotShowWarnings()));
965  else
966  ResultState = 0;
967 }
968 
969 // ----------------------------------------------------------
971 {
972  QFont f = WarningLabel->font(); // reset warning label
973  f.setWeight(QFont::Normal);
974  WarningLabel->setFont(f);
975  WarningLabel->setPaletteForegroundColor(Qt::black);
976  WarningLabel->setText(tr("no warnings"));
977 }
978 
979 // ----------------------------------------------------------
981 {
982  PositionLabel->setText(QString::number(x)+" : "+QString::number(y));
983  PositionLabel->setMinimumWidth(PositionLabel->width());
984 }
985 
986 // ----------------------------------------------------------
987 // turn Toolbar on or off
988 void QucsApp::slotViewToolBar(bool toggle)
989 {
990  if (toggle== false) {
991  fileToolbar->hide();
992  editToolbar->hide();
993  viewToolbar->hide();
994  workToolbar->hide();
995  }
996  else {
997  fileToolbar->show();
998  editToolbar->show();
999  viewToolbar->show();
1000  workToolbar->show();
1001  }
1002 }
1003 
1004 // ----------------------------------------------------------
1005 // turn Statusbar on or off
1007 {
1008  if (toggle == false)
1009  statusBar()->hide();
1010  else
1011  statusBar()->show();
1012 }
1013 
1014 // ----------------------------------------------------------
1015 // turn Brwose Dock Window on or off
1017 {
1018  if (toggle == false)
1019  dock->hide();
1020  else
1021  dock->show();
1022 }
1023 
1024 // ----------------------------------------------------------
1026 {
1027  viewBrowseDock->blockSignals(true);
1028  viewBrowseDock->setOn(on);
1029  viewBrowseDock->blockSignals(false);
1030 }
1031 
1032 // ----------------------------------------------------------
1033 // turn Octave Dock Window on or off
1035 {
1036  if(toggle) {
1037  octDock->show();
1038  octave->startOctave();
1039  }
1040  else
1041  octDock->hide();
1042 }
1043 
1044 // ----------------------------------------------------------
1046 {
1047  viewOctaveDock->blockSignals(true);
1048  viewOctaveDock->setOn(on);
1049  viewOctaveDock->blockSignals(false);
1050 }
1051 
1052 // ----------------------------------------------------------
1054 {
1055  QMessageBox::about(this, tr("About..."),
1056  tr("Qucs Version")+" "+PACKAGE_VERSION+"\n"+
1057  tr("Quite Universal Circuit Simulator")+"\n"+
1058  tr("Copyright (C)")+" 2003-2009 "+
1059  tr("by Michael Margraf")+"\n"+
1060  tr("Copyright (C)")+" 2011-2014 "+
1061  tr("Qucs Team")+"\n"+
1062  "\nThis is free software; see the source for copying conditions."
1063  "\nThere is NO warranty; not even for MERCHANTABILITY or "
1064  "\nFITNESS FOR A PARTICULAR PURPOSE.\n\n"+
1065  tr("Simulator by Stefan Jahn")+"\n"+
1066  tr("VHDL simulator 'FreeHDL' by Edwin Naroska and Marius Vollmer")+"\n"+
1067  tr("Special thanks to Jens Flucke and Raimund Jacob")+"\n"+
1068  tr("Many thanks to Mike Brinson for correcting the VHDL output")+"\n"+
1069  tr("GUI improvements by Gopala Krishna A")+"\n"+
1070  tr("Verilog-AMS interface by Helene Parruitte")+"\n"+
1071  tr("Verilog-AMS dynamic loader by Guilherme Brondani Torri")+"\n\n"+
1072  tr("Translations:")+"\n"+
1073  tr("German by Stefan Jahn")+"\n"+
1074  tr("Polish by Dariusz Pienkowski")+"\n"+
1075  tr("Romanian by Radu Circa")+"\n"+
1076  tr("French by Vincent Habchi, F5RCS")+"\n"+
1077  tr("Portuguese by Luciano Franca, Helio de Sousa, Guilherme Brondani Torri")+"\n"+
1078  tr("Spanish by Jose L. Redrejo Rodriguez")+"\n"+
1079  tr("Japanese by Toyoyuki Ishikawa")+"\n"+
1080  tr("Italian by Giorgio Luparia and Claudio Girardi")+"\n"+
1081  tr("Hebrew by Dotan Nahum")+"\n"+
1082  tr("Swedish by Peter Landgren")+"\n"+
1083  tr("Turkish by Onur and Ozgur Cobanoglu")+"\n"+
1084  tr("Hungarian by Jozsef Bus")+"\n"+
1085  tr("Russian by Igor Gorbounov")+"\n"+
1086  tr("Czech by Marek Straka")+"\n"+
1087  tr("Catalan by Antoni Subirats")+"\n"+
1088  tr("Arabic by Chabane Noureddine")+"\n"+
1089  tr("Kazakh by Erbol Keshubaev"));
1090 }
1091 
1092 // ----------------------------------------------------------
1094 {
1095  QMessageBox::aboutQt(this, tr("About Qt"));
1096 }
1097 
void slotHelpReport()
Definition: qucs.cpp:1892
void slotCursorRight()
void slotAddToProject()
QAction * selectAll
Definition: qucs.h:292
void slotShowOne()
Definition: qucs.cpp:2275
void slotZoomOut()
Definition: qucs.cpp:2282
QAction * alignTop
Definition: qucs.h:292
void slotCenterVertical()
void slotDCbias()
Definition: qucs.cpp:2406
QAction * callLib
Definition: qucs.h:292
void slotInsertPort(bool)
QMenu * helpTechnical
Definition: qucs.h:272
QAction * filePrint
Definition: qucs.h:174
void slotMenuOpenProject()
Definition: qucs.cpp:1336
void slotEditRedo()
void initToolBar()
Definition: qucs_init.cpp:877
QToolBar * fileToolbar
Definition: qucs.h:274
QAction * setMarker
Definition: qucs.h:292
QAction * helpGetStart
Definition: qucs.h:292
void slotPopHierarchy()
Definition: qucs.cpp:2247
void slotShowAll()
Definition: qucs.cpp:2267
void slotProjNewButt()
Definition: qucs.cpp:1136
QAction * centerVert
Definition: qucs.h:292
void slotFilePrintFit()
Definition: qucs.cpp:2130
void slotFilePrint()
Definition: qucs.cpp:2123
void slotFileClose()
Definition: qucs.cpp:1800
void slotZoomIn(bool)
QAction * callFilter
Definition: qucs.h:292
void slotShowLastNetlist()
void slotHelpTechnical()
Definition: qucs.cpp:1885
QAction * fileSave
Definition: qucs.h:174
void slotInsertLabel(bool)
void slotInsertEquation(bool)
QAction * magPlus
Definition: qucs.h:292
QAction * applSettings
Definition: qucs.h:174
void slotApplSettings()
Definition: qucs.cpp:1990
QAction * projOpen
Definition: qucs.h:174
void slotOnGrid(bool)
void slotCallLibrary()
void slotCallRes()
QAction * magAll
Definition: qucs.h:174
bool startOctave()
QAction * centerHor
Definition: qucs.h:292
void slotFileSaveAs()
Definition: qucs.cpp:1743
QAction * callRes
Definition: qucs.h:292
tQucsSettings QucsSettings
Definition: main.cpp:52
void slotHelpAbout()
Definition: qucs_init.cpp:1053
void slotFileSettings()
Definition: qucs.cpp:1959
void slotFileSave()
Definition: qucs.cpp:1611
QAction * callEditor
Definition: qucs.h:292
void slotDistribVert()
QShortcut * cursorDown
Definition: qucs.h:278
QShortcut * cursorUp
Definition: qucs.h:278
void slotEditDelete(bool)
QAction * alignLeft
Definition: qucs.h:292
void slotChangeProps()
void slotHelpAboutQt()
Definition: qucs_init.cpp:1093
void slotMoveText(bool)
QAction * editFind
Definition: qucs.h:292
QAction * viewOctaveDock
Definition: qucs.h:264
void slotToPage()
Definition: qucs.cpp:2477
void slotCallAtt()
QAction * insEntity
Definition: qucs.h:292
void slotSymbolEdit()
Definition: qucs.cpp:2774
QMenu * simMenu
Definition: qucs.h:268
QToolBar * workToolbar
Definition: qucs.h:274
QAction * showNet
Definition: qucs.h:292
void slotSelectMarker()
QMenu * recentfilesMenu
Definition: qucs.h:268
QAction * magMinus
Definition: qucs.h:174
void slotEditFind()
QAction * editRotate
Definition: qucs.h:292
QAction * insEquation
Definition: qucs.h:292
Definitions and declarations for the main application.
QAction * insWire
Definition: qucs.h:292
void slotRefreshSchPath()
Definition: qucs.cpp:2001
void slotFileOpen()
Definition: qucs.cpp:1567
QAction * callAtt
Definition: qucs.h:292
QAction * fileOpen
Definition: qucs.h:174
QAction * editDelete
Definition: qucs.h:292
QMenu * helpReport
Definition: qucs.h:272
void slotInsertGround(bool)
void slotAlignTop()
QAction * helpAboutQt
Definition: qucs.h:264
void slotIntoHierarchy()
Definition: qucs.cpp:2224
void slotEscape()
QAction * editCut
Definition: qucs.h:174
QShortcut * cursorRight
Definition: qucs.h:278
QToolBar * editToolbar
Definition: qucs.h:274
QLabel * PositionLabel
Definition: qucs.h:280
void printCursorPosition(int, int)
Definition: qucs_init.cpp:980
void slotCursorDown()
QAction * insGround
Definition: qucs.h:292
void slotCursorLeft()
void slotLoadModule()
QucsApp::slotLoadModule launches the dialog to select dynamic modueles.
QAction * filePrintFit
Definition: qucs.h:174
void slotHelpIndex()
void slotCallFilter()
void slotFileExamples()
Definition: qucs.cpp:1870
void slotEditPaste(bool)
QAction * loadModule
Definition: qucs.h:292
void slotDistribHoriz()
void slotSimulate()
QucsApp::slotSimulate is called when the simulate toolbar button is pressed.
Definition: qucs.cpp:2293
QAction * magOne
Definition: qucs.h:174
QAction * dcbias
Definition: qucs.h:174
QAction * intoH
Definition: qucs.h:174
void slotSetWire(bool)
QAction * callMatch
Definition: qucs.h:292
void slotEditUndo()
QAction * textNew
Definition: qucs.h:174
QAction * showMsg
Definition: qucs.h:292
void slotHelpTutorial()
Definition: qucs.cpp:1878
QAction * dpl_sch
Definition: qucs.h:174
QAction * extractPkg
Definition: qucs.h:292
QMenu * editMenu
Definition: qucs.h:268
QAction * alignRight
Definition: qucs.h:292
void slotExtractPackage()
QAction * helpAboutApp
Definition: qucs.h:264
void slotCenterHorizontal()
QAction * insLabel
Definition: qucs.h:292
void slotBuildModule()
QucsApp::slotBuildModule runs admsXml, C++ compiler to build library.
QMenu * helpMenu
Definition: qucs.h:268
QAction * moveText
Definition: qucs.h:292
QString DocDir
Definition: main.h:62
void initActions()
QucsApp::initActions Initializes all QActions of the application.
Definition: qucs_init.cpp:32
void initStatusBar()
Definition: qucs_init.cpp:932
void slotMenuDelProject()
Definition: qucs.cpp:1461
QAction * undo
Definition: qucs.h:174
QAction * fileExamples
Definition: qucs.h:174
QAction * fileClose
Definition: qucs.h:174
void slotSelectAll()
QAction * editMirrorY
Definition: qucs.h:292
QAction * redo
Definition: qucs.h:174
void initMenuBar()
Definition: qucs_init.cpp:659
QMenu * fileMenu
Definition: qucs.h:268
QMenu * alignMenu
Definition: qucs.h:268
QAction * symEdit
Definition: qucs.h:174
void slotToggleDock(bool)
Definition: qucs_init.cpp:1025
QAction * projDel
Definition: qucs.h:174
void slotMenuCloseProject()
Definition: qucs.cpp:1373
QAction * viewBrowseDock
Definition: qucs.h:264
QAction * editActivate
Definition: qucs.h:292
QDockWidget * octDock
Definition: qucs.h:190
void slotShowLastMsg()
void slotImportData()
QAction * importData
Definition: qucs.h:292
void slotCallMatch()
void slotSelect(bool)
void slotExportGraphAsCsv()
QAction * projClose
Definition: qucs.h:174
void slotCallLine()
void slotAlignBottom()
void slotAlignLeft()
void slotResetWarnings()
Definition: qucs_init.cpp:970
QAction * popH
Definition: qucs.h:174
QAction * editCopy
Definition: qucs.h:174
QMenu * helpTutorial
Definition: qucs.h:272
QAction * activeAction
Definition: qucs.h:182
QAction * graph2csv
Definition: qucs.h:292
QAction * select
Definition: qucs.h:292
void slotFileNew()
Definition: qucs.cpp:1504
QAction * exportAsImage
Definition: qucs.h:180
QAction * distrHor
Definition: qucs.h:292
void slotEditCut()
Definition: qucs.cpp:2177
QAction * fileSettings
Definition: qucs.h:174
QAction * changeProps
Definition: qucs.h:292
QAction * editPaste
Definition: qucs.h:292
void slotEditMirrorX(bool)
void slotSaveSchematicToGraphicsFile(bool diagram=false)
Definition: qucs.cpp:3112
QMenu * insMenu
Definition: qucs.h:268
QDockWidget * dock
Definition: qucs.h:188
QAction * addToProj
Definition: qucs.h:292
void slotViewOctaveDock(bool)
Definition: qucs_init.cpp:1034
QAction * createPkg
Definition: qucs.h:292
QShortcut * cursorLeft
Definition: qucs.h:278
void slotUpdateRecentFiles()
void slotFileQuit()
Definition: qucs.cpp:2137
void slotInsertEntity()
QAction * onGrid
Definition: qucs.h:292
QAction * fileSaveAll
Definition: qucs.h:174
void slotEditMirrorY(bool)
QAction * callLine
Definition: qucs.h:292
void slotEditCopy()
Definition: qucs.cpp:2201
QMenu * viewMenu
Definition: qucs.h:268
void slotEditRotate(bool)
QAction * distrVert
Definition: qucs.h:292
void slotGettingStarted()
void slotCreatePackage()
void slotAlignRight()
void slotViewBrowseDock(bool toggle)
Definition: qucs_init.cpp:1016
void slotCursorUp()
void slotCreateLib()
QAction * buildModule
Definition: qucs.h:292
QAction * projNew
Definition: qucs.h:174
QAction * simulate
Definition: qucs.h:174
void slotEditActivate(bool)
QAction * alignBottom
Definition: qucs.h:292
void slotEditFindAgain()
QAction * viewStatusBar
Definition: qucs.h:264
QToolBar * viewToolbar
Definition: qucs.h:274
QAction * fileNew
Definition: qucs.h:174
QAction * fileQuit
Definition: qucs.h:174
QAction * fileSaveAs
Definition: qucs.h:174
QAction * selectMarker
Definition: qucs.h:292
OctaveWindow * octave
Definition: qucs.h:191
QMenu * toolMenu
Definition: qucs.h:268
void slotViewStatusBar(bool toggle)
Definition: qucs_init.cpp:1006
void slotCallEditor()
QAction * refreshSchPath
Definition: qucs.h:174
QAction * insPort
Definition: qucs.h:292
QAction * createLib
Definition: qucs.h:292
void slotToggleOctave(bool)
Definition: qucs_init.cpp:1045
QAction * helpIndex
Definition: qucs.h:292
void slotTextNew()
Definition: qucs.cpp:1515
QAction * viewToolBar
Definition: qucs.h:264
void slotFileSaveAll()
Definition: qucs.cpp:1769
void slotShowWarnings()
Definition: qucs_init.cpp:946
void slotViewToolBar(bool toggle)
Definition: qucs_init.cpp:988
void slotSetMarker(bool)
QMenu * projMenu
Definition: qucs.h:268
QAction * editFindAgain
Definition: qucs.h:292
QLabel * WarningLabel
Definition: qucs.h:280
QAction * editMirror
Definition: qucs.h:292