25 #include <qstatusbar.h>
29 #include <qwhatsthis.h>
30 #include <qmessagebox.h>
39 void QucsApp::initActions()
42 mainAccel =
new QAccel(
this);
48 fileNew =
new QAction(tr(
"New"),
50 tr(
"&New"), CTRL+Key_N,
this);
51 fileNew->setStatusTip(tr(
"Creates a new document"));
53 tr(
"New\n\nCreates a new schematic or data display document"));
56 textNew =
new QAction(tr(
"New Text"),
58 tr(
"New &Text"), CTRL+SHIFT+Key_V,
this);
59 textNew->setStatusTip(tr(
"Creates a new text document"));
60 textNew->setWhatsThis(tr(
"New Text\n\nCreates a new text document"));
65 tr(
"&Open..."), CTRL+Key_O,
this);
66 fileOpen->setStatusTip(tr(
"Opens an existing document"));
67 fileOpen->setWhatsThis(tr(
"Open File\n\nOpens an existing document"));
72 tr(
"&Save"), CTRL+Key_S,
this);
73 fileSave->setStatusTip(tr(
"Saves the current document"));
74 fileSave->setWhatsThis(tr(
"Save File\n\nSaves the current document"));
78 tr(
"Save as..."), CTRL+Key_Minus,
this);
80 tr(
"Saves the current document under a new filename"));
82 tr(
"Save As\n\nSaves the current document under a new filename"));
87 tr(
"Save &All"), CTRL+Key_Plus,
this);
88 fileSaveAll->setStatusTip(tr(
"Saves all open documents"));
89 fileSaveAll->setWhatsThis(tr(
"Save All Files\n\nSaves all open documents"));
94 tr(
"&Close"), CTRL+Key_W,
this);
95 fileClose->setStatusTip(tr(
"Closes the current document"));
96 fileClose->setWhatsThis(tr(
"Close File\n\nCloses the current document"));
99 symEdit =
new QAction(
"Edit Circuit Symbol",
100 tr(
"&Edit Circuit Symbol"), Key_F9,
this);
101 symEdit->setStatusTip(tr(
"Edits the symbol for this schematic"));
103 tr(
"Edit Circuit Symbol\n\nEdits the symbol for this schematic"));
107 tr(
"&Document Settings..."), CTRL+Key_Period,
this);
109 fileSettings->setWhatsThis(tr(
"Settings\n\nSets properties of the file"));
114 tr(
"&Print..."), CTRL+Key_P,
this);
115 filePrint->setStatusTip(tr(
"Prints the current document"));
116 filePrint->setWhatsThis(tr(
"Print File\n\nPrints the current document"));
120 tr(
"Print Fit to Page..."), CTRL+SHIFT+Key_P,
this);
123 tr(
"Print Fit to Page\n\n"
124 "Print and fit content to the page size"));
127 fileQuit =
new QAction(
"Exit", tr(
"E&xit"), CTRL+Key_Q,
this);
128 fileQuit->setStatusTip(tr(
"Quits the application"));
129 fileQuit->setWhatsThis(tr(
"Exit\n\nQuits the application"));
133 tr(
"Application Settings..."), CTRL+Key_Comma,
this);
136 tr(
"Qucs Settings\n\nSets properties of the application"));
139 alignTop =
new QAction(
"Align top", tr(
"Align top"), CTRL+Key_T,
this);
140 alignTop->setStatusTip(tr(
"Align top selected elements"));
142 tr(
"Align top\n\nAlign selected elements to their upper edge"));
145 alignBottom =
new QAction(
"Align bottom", tr(
"Align bottom"), 0,
this);
146 alignBottom->setStatusTip(tr(
"Align bottom selected elements"));
148 tr(
"Align bottom\n\nAlign selected elements to their lower edge"));
151 alignLeft =
new QAction(
"Align left", tr(
"Align left"), 0,
this);
152 alignLeft->setStatusTip(tr(
"Align left selected elements"));
154 tr(
"Align left\n\nAlign selected elements to their left edge"));
157 alignRight =
new QAction(
"Align right", tr(
"Align right"), 0,
this);
158 alignRight->setStatusTip(tr(
"Align right selected elements"));
160 tr(
"Align right\n\nAlign selected elements to their right edge"));
163 distrHor =
new QAction(
"Distribute horizontally",
164 tr(
"Distribute horizontally"), 0,
this);
165 distrHor->setStatusTip(tr(
"Distribute equally horizontally"));
167 tr(
"Distribute horizontally\n\n"
168 "Distribute horizontally selected elements"));
171 distrVert =
new QAction(
"Distribute vertically",
172 tr(
"Distribute vertically"), 0,
this);
173 distrVert->setStatusTip(tr(
"Distribute equally vertically"));
175 tr(
"Distribute vertically\n\n"
176 "Distribute vertically selected elements"));
179 centerHor =
new QAction(
"Center horizontally",
180 tr(
"Center horizontally"), 0,
this);
181 centerHor->setStatusTip(tr(
"Center horizontally selected elements"));
183 tr(
"Center horizontally\n\nCenter horizontally selected elements"));
187 tr(
"Center vertically"), 0,
this);
188 centerVert->setStatusTip(tr(
"Center vertically selected elements"));
190 tr(
"Center vertically\n\nCenter vertically selected elements"));
193 onGrid =
new QAction(
"Set on Grid", tr(
"Set on Grid"), CTRL+Key_U,
this);
194 onGrid->setStatusTip(tr(
"Sets selected elements on grid"));
196 tr(
"Set on Grid\n\nSets selected elements on grid"));
197 onGrid->setToggleAction(
true);
200 moveText =
new QAction(
"Move Component Text",
201 tr(
"Move Component Text"), CTRL+Key_K,
this);
202 moveText->setStatusTip(tr(
"Moves the property text of components"));
204 tr(
"Move Component Text\n\nMoves the property text of components"));
208 changeProps =
new QAction(
"Replace...", tr(
"Replace..."), Key_F7,
this);
209 changeProps->setStatusTip(tr(
"Replace component properties or VHDL code"));
211 tr(
"Replace\n\nChange component properties\nor\ntext in VHDL code"));
214 editCut =
new QAction(tr(
"Cut"),
216 tr(
"Cu&t"), CTRL+Key_X,
this);
218 tr(
"Cuts out the selection and puts it into the clipboard"));
220 tr(
"Cut\n\nCuts out the selection and puts it into the clipboard"));
225 tr(
"&Copy"), CTRL+Key_C,
this);
227 tr(
"Copies the selection into the clipboard"));
229 tr(
"Copy\n\nCopies the selection into the clipboard"));
234 tr(
"&Paste"), CTRL+Key_V,
this);
236 tr(
"Pastes the clipboard contents to the cursor position"));
238 tr(
"Paste\n\nPastes the clipboard contents to the cursor position"));
244 tr(
"&Delete"), Key_Delete,
this);
245 editDelete->setStatusTip(tr(
"Deletes the selected components"));
246 editDelete->setWhatsThis(tr(
"Delete\n\nDeletes the selected components"));
250 editFind =
new QAction(
"Find...", tr(
"Find..."), CTRL+Key_F,
this);
251 editFind->setStatusTip(tr(
"Find a piece of text"));
252 editFind->setWhatsThis(tr(
"Find\n\nSearches for a piece of text"));
255 editFindAgain =
new QAction(
"Find Again", tr(
"Find Again"), Key_F3,
this);
258 tr(
"Find\n\nSearches for the same piece of text again"));
262 mainAccel->connectItem(mainAccel->insertItem(Key_Backspace),
266 mainAccel->connectItem(mainAccel->insertItem(Key_Left),
267 this, SLOT(slotCursorLeft()));
268 mainAccel->connectItem(mainAccel->insertItem(Key_Right),
269 this, SLOT(slotCursorRight()));
270 mainAccel->connectItem(mainAccel->insertItem(Key_Up),
271 this, SLOT(slotCursorUp()));
272 mainAccel->connectItem(mainAccel->insertItem(Key_Down),
273 this, SLOT(slotCursorDown()));
274 mainAccel->connectItem(mainAccel->insertItem(Key_Tab),
275 this, SLOT(slotNextTab()));
277 undo =
new QAction(tr(
"Undo"),
279 tr(
"&Undo"), CTRL+Key_Z,
this);
280 undo->setStatusTip(tr(
"Undoes the last command"));
281 undo->setWhatsThis(tr(
"Undo\n\nMakes the last action undone"));
284 redo =
new QAction(tr(
"Redo"),
286 tr(
"&Redo"), CTRL+Key_Y,
this);
287 redo->setStatusTip(tr(
"Redoes the last command"));
288 redo->setWhatsThis(tr(
"Redo\n\nRepeats the last action once more"));
291 projNew =
new QAction(
"New Project...",
292 tr(
"&New Project..."), CTRL+SHIFT+Key_N,
this);
293 projNew->setStatusTip(tr(
"Creates a new project"));
294 projNew->setWhatsThis(tr(
"New Project\n\nCreates a new project"));
295 connect(
projNew, SIGNAL(activated()), SLOT(slotProjNewButt()));
297 projOpen =
new QAction(
"Open Project...", tr(
"&Open Project..."),
298 CTRL+SHIFT+Key_O,
this);
299 projOpen->setStatusTip(tr(
"Opens an existing project"));
300 projOpen->setWhatsThis(tr(
"Open Project\n\nOpens an existing project"));
301 connect(
projOpen, SIGNAL(activated()), SLOT(slotMenuOpenProject()));
303 projDel =
new QAction(
"Delete Project...",
304 tr(
"&Delete Project..."), CTRL+SHIFT+Key_D,
this);
305 projDel->setStatusTip(tr(
"Deletes an existing project"));
306 projDel->setWhatsThis(tr(
"Delete Project\n\nDeletes an existing project"));
307 connect(
projDel, SIGNAL(activated()), SLOT(slotMenuDelProject()));
310 tr(
"&Close Project"), CTRL+SHIFT+Key_W,
this);
311 projClose->setStatusTip(tr(
"Closes the current project"));
312 projClose->setWhatsThis(tr(
"Close Project\n\nCloses the current project"));
313 connect(
projClose, SIGNAL(activated()), SLOT(slotMenuCloseProject()));
315 addToProj =
new QAction(
"Add Files to Project...",
316 tr(
"&Add Files to Project..."), CTRL+SHIFT+Key_A,
this);
317 addToProj->setStatusTip(tr(
"Copies files to project directory"));
319 tr(
"Add Files to Project\n\nCopies files to project directory"));
322 createLib =
new QAction(
"Create Library...",
323 tr(
"Create &Library..."), CTRL+SHIFT+Key_L,
this);
324 createLib->setStatusTip(tr(
"Create Library from Subcircuits"));
326 tr(
"Create Library\n\nCreate Library from Subcircuits"));
327 connect(
createLib, SIGNAL(activated()), SLOT(slotCreateLib()));
329 createPkg =
new QAction(
"Create Package...",
330 tr(
"Create &Package..."), CTRL+SHIFT+Key_Z,
this);
331 createPkg->setStatusTip(tr(
"Create compressed Package from Projects"));
333 tr(
"Create Package\n\nCreate compressed Package from complete Projects"));
334 connect(
createPkg, SIGNAL(activated()), SLOT(slotCreatePackage()));
336 extractPkg =
new QAction(
"Extract Package...",
337 tr(
"E&xtract Package..."), CTRL+SHIFT+Key_X,
this);
338 extractPkg->setStatusTip(tr(
"Install Content of a Package"));
340 tr(
"Extract Package\n\nInstall Content of a Package"));
341 connect(
extractPkg, SIGNAL(activated()), SLOT(slotExtractPackage()));
343 importData =
new QAction(
"Import/Export Data...",
344 tr(
"&Import/Export Data..."), CTRL+SHIFT+Key_I,
this);
345 importData->setStatusTip(tr(
"Convert data file"));
347 tr(
"Import/Export Data\n\nConvert data file to various file formats"));
348 connect(
importData, SIGNAL(activated()), SLOT(slotImportData()));
350 graph2csv =
new QAction(
"Export to CSV...",
351 tr(
"Export to &CSV..."), CTRL+SHIFT+Key_C,
this);
352 graph2csv->setStatusTip(tr(
"Convert graph data to CSV file"));
354 tr(
"Export to CSV\n\nConvert graph data to CSV file"));
355 connect(
graph2csv, SIGNAL(activated()), SLOT(slotExportGraphAsCsv()));
357 magAll =
new QAction(tr(
"View All"),
359 tr(
"View All"), Key_0,
this);
360 magAll->setStatusTip(tr(
"Show the whole page"));
361 magAll->setWhatsThis(tr(
"View All\n\nShows the whole page content"));
364 magOne =
new QAction(tr(
"View 1:1"),
366 tr(
"View 1:1"), Key_1,
this);
367 magOne->setStatusTip(tr(
"Views without magnification"));
369 tr(
"View 1:1\n\nShows the page content without magnification"));
372 magPlus =
new QAction(tr(
"Zoom in"),
374 tr(
"Zoom in"), Key_Plus,
this);
375 magPlus->setStatusTip(tr(
"Zooms into the current view"));
376 magPlus->setWhatsThis(tr(
"Zoom in\n\nZooms the current view"));
377 magPlus->setToggleAction(
true);
380 magMinus =
new QAction(tr(
"Zoom out"),
382 tr(
"Zoom out"), Key_Minus,
this);
383 magMinus->setStatusTip(tr(
"Zooms out the current view"));
384 magMinus->setWhatsThis(tr(
"Zoom out\n\nZooms out the current view"));
387 select =
new QAction(tr(
"Select"),
389 tr(
"Select"), Key_Escape,
this);
390 select->setStatusTip(tr(
"Activate select mode"));
391 select->setWhatsThis(tr(
"Select\n\nActivates select mode"));
392 select->setToggleAction(
true);
395 selectAll =
new QAction(
"Select All", tr(
"Select All"), CTRL+Key_A,
this);
396 selectAll->setStatusTip(tr(
"Selects all elements"));
398 tr(
"Select All\n\nSelects all elements of the document"));
401 selectMarker =
new QAction(
"Select Markers", tr(
"Select Markers"), CTRL+SHIFT+Key_M,
this);
404 tr(
"Select Markers\n\nSelects all diagram markers of the document"));
409 tr(
"Rotate"), CTRL+Key_R,
this);
410 editRotate->setStatusTip(tr(
"Rotates the selected component by 90°"));
412 tr(
"Rotate\n\nRotates the selected component by 90° counter-clockwise"));
416 editMirror =
new QAction(tr(
"Mirror about X Axis"),
418 tr(
"Mirror about X Axis"), CTRL+Key_J,
this);
419 editMirror->setStatusTip(tr(
"Mirrors the selected item about X Axis"));
421 tr(
"Mirror about X Axis\n\nMirrors the selected item about X Axis"));
425 editMirrorY =
new QAction(tr(
"Mirror about Y Axis"),
427 tr(
"Mirror about Y Axis"), CTRL+Key_M,
this);
428 editMirrorY->setStatusTip(tr(
"Mirrors the selected item about Y Axis"));
430 tr(
"Mirror about Y Axis\n\nMirrors the selected item about Y Axis"));
434 intoH =
new QAction(tr(
"Go into Subcircuit"),
436 tr(
"Go into Subcircuit"), CTRL+Key_I,
this);
437 intoH->setStatusTip(tr(
"Goes inside the selected subcircuit"));
439 tr(
"Go into Subcircuit\n\nGoes inside the selected subcircuit"));
442 popH =
new QAction(tr(
"Pop out"),
444 tr(
"Pop out"), CTRL+Key_H,
this);
445 popH->setStatusTip(tr(
"Pop outside subcircuit"));
447 tr(
"Pop out\n\nGoes up one hierarchy level, i.e. leaves subcircuit"));
449 popH->setEnabled(
false);
453 tr(
"Deactivate/Activate"), CTRL+Key_D,
this);
454 editActivate->setStatusTip(tr(
"Deactivate/Activate selected components"));
456 tr(
"Deactivate/Activate\n\nDeactivate/Activate the selected components"));
462 tr(
"Insert Equation"), CTRL+Key_Less,
this);
463 insEquation->setStatusTip(tr(
"Inserts an equation"));
465 tr(
"Insert Equation\n\nInserts a user defined equation"));
469 insGround =
new QAction(tr(
"Insert Ground"),
471 tr(
"Insert Ground"), CTRL+Key_G,
this);
472 insGround->setStatusTip(tr(
"Inserts a ground symbol"));
473 insGround->setWhatsThis(tr(
"Insert Ground\n\nInserts a ground symbol"));
477 insPort =
new QAction(tr(
"Insert Port"),
479 tr(
"Insert Port"), 0,
this);
480 insPort->setStatusTip(tr(
"Inserts a port symbol"));
481 insPort->setWhatsThis(tr(
"Insert Port\n\nInserts a port symbol"));
482 insPort->setToggleAction(
true);
485 insWire =
new QAction(tr(
"Wire"),
487 tr(
"Wire"), CTRL+Key_E,
this);
488 insWire->setStatusTip(tr(
"Inserts a wire"));
489 insWire->setWhatsThis(tr(
"Wire\n\nInserts a wire"));
490 insWire->setToggleAction(
true);
493 insLabel =
new QAction(tr(
"Wire Label"),
495 tr(
"Wire Label"), CTRL+Key_L,
this);
496 insLabel->setStatusTip(tr(
"Inserts a wire or pin label"));
497 insLabel->setWhatsThis(tr(
"Wire Label\n\nInserts a wire or pin label"));
502 tr(
"VHDL entity"), CTRL+Key_Space,
this);
503 insEntity->setStatusTip(tr(
"Inserts skeleton of VHDL entity"));
505 tr(
"VHDL entity\n\nInserts the skeleton of a VHDL entity"));
508 callEditor =
new QAction(
"Text Editor", tr(
"Text Editor"), CTRL+Key_1,
this);
509 callEditor->setStatusTip(tr(
"Starts the Qucs text editor"));
510 callEditor->setWhatsThis(tr(
"Text editor\n\nStarts the Qucs text editor"));
514 tr(
"Filter synthesis"), CTRL+Key_2,
this);
515 callFilter->setStatusTip(tr(
"Starts QucsFilter"));
516 callFilter->setWhatsThis(tr(
"Filter synthesis\n\nStarts QucsFilter"));
519 callLine =
new QAction(
"Line calculation",
520 tr(
"Line calculation"), CTRL+Key_3,
this);
521 callLine->setStatusTip(tr(
"Starts QucsTrans"));
523 tr(
"Line calculation\n\nStarts transmission line calculator"));
526 callLib =
new QAction(
"Component Library",
527 tr(
"Component Library"), CTRL+Key_4,
this);
528 callLib->setStatusTip(tr(
"Starts QucsLib"));
530 tr(
"Component Library\n\nStarts component library program"));
533 callMatch =
new QAction(
"Matching Circuit",
534 tr(
"Matching Circuit"), CTRL+Key_5,
this);
535 callMatch->setStatusTip(tr(
"Creates Matching Circuit"));
537 tr(
"Matching Circuit\n\nDialog for Creating Matching Circuit"));
540 callAtt =
new QAction(
"Attenuator synthesis",
541 tr(
"Attenuator synthesis"), CTRL+Key_6,
this);
542 callAtt->setStatusTip(tr(
"Starts QucsAttenuator"));
544 tr(
"Attenuator synthesis\n\nStarts attenuator calculation program"));
547 simulate =
new QAction(tr(
"Simulate"),
549 tr(
"Simulate"), Key_F2,
this);
550 simulate->setStatusTip(tr(
"Simulates the current schematic"));
551 simulate->setWhatsThis(tr(
"Simulate\n\nSimulates the current schematic"));
552 connect(
simulate, SIGNAL(activated()), SLOT(slotSimulate()));
554 dpl_sch =
new QAction(tr(
"View Data Display/Schematic"),
556 tr(
"View Data Display/Schematic"), Key_F4,
this);
557 dpl_sch->setStatusTip(tr(
"Changes to data display or schematic page"));
559 tr(
"View Data Display/Schematic\n\n")+
560 tr(
"Changes to data display or schematic page"));
563 dcbias =
new QAction(
"Calculate DC bias",
564 tr(
"Calculate DC bias"), Key_F8,
this);
565 dcbias->setStatusTip(tr(
"Calculates DC bias and shows it"));
567 tr(
"Calculate DC bias\n\nCalculates DC bias and shows it"));
568 connect(
dcbias, SIGNAL(activated()), SLOT(slotDCbias()));
570 setMarker =
new QAction(tr(
"Set Marker on Graph"),
572 tr(
"Set Marker on Graph"), CTRL+Key_B,
this);
573 setMarker->setStatusTip(tr(
"Sets a marker on a diagram's graph"));
575 tr(
"Set Marker\n\nSets a marker on a diagram's graph"));
579 showMsg =
new QAction(
"Show Last Messages",
580 tr(
"Show Last Messages"), Key_F5,
this);
581 showMsg->setStatusTip(tr(
"Shows last simulation messages"));
583 tr(
"Show Last Messages\n\nShows the messages of the last simulation"));
586 showNet =
new QAction(
"Show Last Netlist",
587 tr(
"Show Last Netlist"), Key_F6,
this);
588 showNet->setStatusTip(tr(
"Shows last simulation netlist"));
590 tr(
"Show Last Netlist\n\nShows the netlist of the last simulation"));
593 viewToolBar =
new QAction(
"Toolbar", tr(
"Tool&bar"), 0,
this);
594 viewToolBar->setToggleAction(
true);
595 viewToolBar->setStatusTip(tr(
"Enables/disables the toolbar"));
596 viewToolBar->setWhatsThis(tr(
"Toolbar\n\nEnables/disables the toolbar"));
597 connect(viewToolBar, SIGNAL(toggled(
bool)), SLOT(slotViewToolBar(
bool)));
599 viewStatusBar =
new QAction(
"Statusbar", tr(
"&Statusbar"), 0,
this);
600 viewStatusBar->setToggleAction(
true);
601 viewStatusBar->setStatusTip(tr(
"Enables/disables the statusbar"));
602 viewStatusBar->setWhatsThis(
603 tr(
"Statusbar\n\nEnables/disables the statusbar"));
604 connect(viewStatusBar, SIGNAL(toggled(
bool)), SLOT(slotViewStatusBar(
bool)));
606 viewBrowseDock =
new QAction(
"Dock Window", tr(
"&Dock Window"), 0,
this);
607 viewBrowseDock->setToggleAction(
true);
608 viewBrowseDock->setStatusTip(tr(
"Enables/disables the browse dock window"));
609 viewBrowseDock->setWhatsThis(
610 tr(
"Browse Window\n\nEnables/disables the browse dock window"));
611 connect(viewBrowseDock, SIGNAL(toggled(
bool)), SLOT(slotViewBrowseDock(
bool)));
613 viewOctaveDock =
new QAction(tr(
"&Octave Window"), 0,
this, 0);
614 viewOctaveDock->setToggleAction(
true);
615 viewOctaveDock->setStatusTip(tr(
"Shows/hides the Octave dock window"));
616 viewOctaveDock->setWhatsThis(
617 tr(
"Octave Window\n\nShows/hides the Octave dock window"));
618 connect(viewOctaveDock, SIGNAL(toggled(
bool)), SLOT(slotViewOctaveDock(
bool)));
620 helpIndex =
new QAction(
"Help Index...", tr(
"Help Index..."), Key_F1,
this);
621 helpIndex->setStatusTip(tr(
"Index of Qucs Help"));
622 helpIndex->setWhatsThis(tr(
"Help Index\n\nIndex of intern Qucs help"));
626 tr(
"Getting Started..."), 0,
this);
627 helpGetStart->setStatusTip(tr(
"Getting Started with Qucs"));
629 tr(
"Getting Started\n\nShort introduction into Qucs"));
632 helpAboutApp =
new QAction(
"About Qucs...", tr(
"&About Qucs..."), 0,
this);
633 helpAboutApp->setStatusTip(tr(
"About the application"));
634 helpAboutApp->setWhatsThis(tr(
"About\n\nAbout the application"));
635 connect(helpAboutApp, SIGNAL(activated()), SLOT(slotHelpAbout()));
637 helpAboutQt =
new QAction(
"About Qt...", tr(
"About Qt..."), 0,
this);
638 helpAboutQt->setStatusTip(tr(
"About Qt"));
639 helpAboutQt->setWhatsThis(tr(
"About Qt\n\nAbout Qt by Trolltech"));
640 connect(helpAboutQt, SIGNAL(activated()), SLOT(slotHelpAboutQt()));
644 void QucsApp::initMenuBar()
646 fileMenu =
new QPopupMenu();
651 fileMenu->insertSeparator();
657 fileMenu->insertSeparator();
660 fileMenu->insertSeparator();
662 fileMenu->insertSeparator();
665 editMenu =
new QPopupMenu();
666 undo->addTo(editMenu);
667 redo->addTo(editMenu);
668 editMenu->insertSeparator();
673 editMenu->insertSeparator();
684 editMenu->insertSeparator();
685 intoH->addTo(editMenu);
686 popH->addTo(editMenu);
688 alignMenu =
new QPopupMenu();
691 alignMenu->insertSeparator();
694 alignMenu->insertSeparator();
699 alignMenu->insertSeparator();
703 insMenu =
new QPopupMenu();
712 projMenu =
new QPopupMenu();
718 projMenu->insertSeparator();
722 projMenu->insertSeparator();
726 toolMenu =
new QPopupMenu();
734 simMenu =
new QPopupMenu();
741 viewMenu =
new QPopupMenu();
746 viewMenu->insertSeparator();
747 viewMenu->setCheckable(
true);
748 viewToolBar->addTo(viewMenu);
749 viewStatusBar->addTo(viewMenu);
750 viewBrowseDock->addTo(viewMenu);
751 viewOctaveDock->addTo(viewMenu);
753 helpMenu =
new QPopupMenu();
756 helpMenu->insertSeparator();
757 helpAboutApp->addTo(helpMenu);
758 helpAboutQt->addTo(helpMenu);
760 menuBar()->insertItem(tr(
"&File"), fileMenu);
761 menuBar()->insertItem(tr(
"&Edit"), editMenu);
762 menuBar()->insertItem(tr(
"P&ositioning"), alignMenu);
763 menuBar()->insertItem(tr(
"&Insert"), insMenu);
764 menuBar()->insertItem(tr(
"&Project"), projMenu);
765 menuBar()->insertItem(tr(
"&Tools"), toolMenu);
766 menuBar()->insertItem(tr(
"&Simulation"), simMenu);
767 menuBar()->insertItem(tr(
"&View"), viewMenu);
768 menuBar()->insertSeparator();
769 menuBar()->insertItem(tr(
"&Help"), helpMenu);
774 void QucsApp::initToolBar()
776 fileToolbar =
new QToolBar(
this);
785 editToolbar =
new QToolBar(
this);
790 undo->addTo(editToolbar);
791 redo->addTo(editToolbar);
793 viewToolbar =
new QToolBar(
this);
794 magAll->addTo(viewToolbar);
795 magOne->addTo(viewToolbar);
799 workToolbar =
new QToolBar(
this);
800 select->addTo(workToolbar);
805 intoH->addTo(workToolbar);
806 popH->addTo(workToolbar);
815 workToolbar->addSeparator();
816 QWhatsThis::whatsThisButton(workToolbar);
821 void QucsApp::initStatusBar()
824 WarningLabel =
new QLabel(tr(
"no warnings"), statusBar());
825 statusBar()->addWidget(WarningLabel, 0,
true);
827 PositionLabel =
new QLabel(
"0 : 0", statusBar());
828 PositionLabel->setAlignment(Qt::AlignRight);
829 statusBar()->addWidget(PositionLabel, 0,
true);
831 statusBar()->message(tr(
"Ready."), 2000);
837 static int ResultState = 0;
839 if(ResultState == 0) {
840 QFont f = WarningLabel->font();
841 f.setWeight(QFont::DemiBold);
842 WarningLabel->setFont(f);
843 WarningLabel->setText(tr(
"Warnings in last simulation! Press F5"));
848 WarningLabel->setPaletteForegroundColor(Qt::red);
850 WarningLabel->setPaletteForegroundColor(Qt::black);
861 QFont f = WarningLabel->font();
862 f.setWeight(QFont::Normal);
863 WarningLabel->setFont(f);
864 WarningLabel->setPaletteForegroundColor(Qt::black);
865 WarningLabel->setText(tr(
"no warnings"));
871 PositionLabel->setText(QString::number(x)+
" : "+QString::number(y));
872 PositionLabel->setMinimumWidth(PositionLabel->width());
877 void QucsApp::slotViewToolBar(
bool toggle)
879 if (toggle==
false) {
895 void QucsApp::slotViewStatusBar(
bool toggle)
905 void QucsApp::slotViewBrowseDock(
bool toggle)
914 void QucsApp::slotToggleDock(
bool on)
916 viewBrowseDock->blockSignals(
true);
917 viewBrowseDock->setOn(on);
918 viewBrowseDock->blockSignals(
false);
923 void QucsApp::slotViewOctaveDock(
bool toggle)
934 void QucsApp::slotToggleOctave(
bool on)
936 viewOctaveDock->blockSignals(
true);
937 viewOctaveDock->setOn(on);
938 viewOctaveDock->blockSignals(
false);
942 void QucsApp::slotHelpAbout()
944 QMessageBox::about(
this, tr(
"About..."),
945 tr(
"Qucs Version")+
" "+PACKAGE_VERSION+
"\n"+
946 tr(
"Quite Universal Circuit Simulator")+
"\n"+
947 tr(
"Copyright (C)")+
" 2003-2009 "+
948 tr(
"by Michael Margraf")+
"\n"+
949 "\nThis is free software; see the source for copying conditions."
950 "\nThere is NO warranty; not even for MERCHANTABILITY or "
951 "\nFITNESS FOR A PARTICULAR PURPOSE.\n\n"+
952 tr(
"Simulator by Stefan Jahn")+
"\n"+
953 tr(
"VHDL simulator 'FreeHDL' by Edwin Naroska and Marius Vollmer")+
"\n"+
954 tr(
"Special thanks to Jens Flucke and Raimund Jacob")+
"\n"+
955 tr(
"Many thanks to Mike Brinson for correcting the VHDL output")+
"\n"+
956 tr(
"GUI improvements by Gopala Krishna A")+
"\n"+
957 tr(
"Verilog-AMS interface by Helene Parruitte")+
"\n\n"+
958 tr(
"Translations:")+
"\n"+
959 tr(
"German by Stefan Jahn")+
"\n"+
960 tr(
"Polish by Dariusz Pienkowski")+
"\n"+
961 tr(
"Romanian by Radu Circa")+
"\n"+
962 tr(
"French by Vincent Habchi, F5RCS")+
"\n"+
963 tr(
"Portuguese by Luciano Franca and Helio de Sousa")+
"\n"+
964 tr(
"Spanish by Jose L. Redrejo Rodriguez")+
"\n"+
965 tr(
"Japanese by Toyoyuki Ishikawa")+
"\n"+
966 tr(
"Italian by Giorgio Luparia and Claudio Girardi")+
"\n"+
967 tr(
"Hebrew by Dotan Nahum")+
"\n"+
968 tr(
"Swedish by Peter Landgren")+
"\n"+
969 tr(
"Turkish by Onur and Ozgur Cobanoglu")+
"\n"+
970 tr(
"Hungarian by Jozsef Bus")+
"\n"+
971 tr(
"Russian by Igor Gorbounov")+
"\n"+
972 tr(
"Czech by Marek Straka")+
"\n"+
973 tr(
"Catalan by Antoni Subirats")+
"\n"+
974 tr(
"Arabic by Chabane Noureddine")+
"\n"+
975 tr(
"Kazakh by Erbol Keshubaev"));
979 void QucsApp::slotHelpAboutQt()
981 QMessageBox::aboutQt(
this, tr(
"About Qt"));