-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathqucs_init.cpp
1082 lines (910 loc) · 46.4 KB
/
qucs_init.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/***************************************************************************
qucs_init.cpp
---------------
begin : Sat May 1 2004
copyright : (C) 2004 by Michael Margraf
email : michael.margraf@alumni.tu-berlin.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "main.h"
#include "misc.h"
#include "qucs.h"
#include "extsimkernels/spicecompat.h"
#include "octave_window.h"
#include <QAction>
#include <QShortcut>
#include <QMenu>
#include <QMenuBar>
#include <QToolBar>
#include <QLabel>
#include <QTimer>
#include <QStatusBar>
#include <QDockWidget>
#include <QMessageBox>
#include <QApplication>
/**
* @brief QucsApp::initActions Initializes all QActions of the application
*/
void QucsApp::initActions()
{
activeAction = nullptr; // no active action
// note: first argument of QAction() for backward compatibility Qt < 3.2
fileNew = new QAction(QIcon((":/bitmaps/svg/filenew.svg")), tr("&New"), this);
fileNew->setShortcut(QKeySequence::New);
fileNew->setStatusTip(tr("Creates a new document"));
fileNew->setWhatsThis(
tr("New\n\nCreates a new schematic or data display document"));
connect(fileNew, SIGNAL(triggered()), SLOT(slotFileNew()));
textNew = new QAction(QIcon((":/bitmaps/svg/textnew.svg")), tr("New &Text"), this);
textNew->setShortcut(tr("Ctrl+Shift+V"));
textNew->setStatusTip(tr("Creates a new text document"));
textNew->setWhatsThis(tr("New Text\n\nCreates a new text document"));
connect(textNew, SIGNAL(triggered()), SLOT(slotTextNew()));
symNew = new QAction(QIcon((":/bitmaps/svg/symnew.svg")), tr("New symbol"), this);
symNew->setStatusTip(tr("Creates a new symbol"));
symNew->setWhatsThis(tr("New\n\nCreates a new schematic symbol document"));
connect(symNew, SIGNAL(triggered()), SLOT(slotSymbolNew()));
fileOpen = new QAction(QIcon((":/bitmaps/fileopen.png")), tr("&Open..."), this);
fileOpen->setShortcut(QKeySequence::Open);
fileOpen->setStatusTip(tr("Opens an existing document"));
fileOpen->setWhatsThis(tr("Open File\n\nOpens an existing document"));
connect(fileOpen, SIGNAL(triggered()), SLOT(slotFileOpen()));
fileSave = new QAction(QIcon((":/bitmaps/svg/filesave.svg")), tr("&Save"), this);
fileSave->setShortcut(QKeySequence::Save);
fileSave->setStatusTip(tr("Saves the current document"));
fileSave->setWhatsThis(tr("Save File\n\nSaves the current document"));
connect(fileSave, SIGNAL(triggered()), SLOT(slotFileSave()));
fileSaveAs = new QAction(tr("Save as..."), this);
//fileSaveAs->setShortcut(QKeySequence::SaveAs);
fileSaveAs->setStatusTip( tr("Saves the current document under a new filename"));
fileSaveAs->setWhatsThis( tr("Save As\n\nSaves the current document under a new filename"));
connect(fileSaveAs, SIGNAL(triggered()), SLOT(slotFileSaveAs()));
fileSaveAll = new QAction(QIcon((":/bitmaps/svg/filesaveall.svg")), tr("Save &All"), this);
fileSaveAll->setShortcut(tr("Ctrl+Shift+S"));
fileSaveAll->setStatusTip(tr("Saves all open documents"));
fileSaveAll->setWhatsThis(tr("Save All Files\n\nSaves all open documents"));
connect(fileSaveAll, SIGNAL(triggered()), SLOT(slotFileSaveAll()));
fileClose = new QAction(QIcon((":/bitmaps/svg/fileclose.svg")), tr("&Close"), this);
fileClose->setShortcut(Qt::CTRL|Qt::Key_E);
fileClose->setStatusTip(tr("Closes the current document"));
fileClose->setWhatsThis(tr("Close File\n\nCloses the current document"));
connect(fileClose, SIGNAL(triggered()), SLOT(slotFileClose()));
for (auto & i : fileRecentAction) {
i = new QAction(this);
i->setVisible(false);
connect(i, SIGNAL(triggered()), SLOT(slotOpenRecent()));
}
fileClearRecent = new QAction(tr("Clear Recent"), this);
connect(fileClearRecent, SIGNAL(triggered()), SLOT(slotClearRecentFiles()));
fileExamples = new QAction(tr("&Examples"), this);
fileExamples->setStatusTip(tr("Starts file chooser dialog to open one of example schematics"));
fileExamples->setWhatsThis(
tr("Examples\n\nStart file chooser dialog and open one of example schematics"));
connect(fileExamples, SIGNAL(triggered()), SLOT(slotFileExamples()));
symEdit = new QAction(tr("&Edit Circuit Symbol"), this);
symEdit->setShortcut(Qt::Key_F9);
symEdit->setStatusTip(tr("Edits the symbol for this schematic"));
symEdit->setWhatsThis(
tr("Edit Circuit Symbol\n\nEdits the symbol for this schematic"));
connect(symEdit, SIGNAL(triggered()), SLOT(slotSymbolEdit()));
fileSettings = new QAction(tr("&Document Settings..."), this);
fileSettings->setShortcut(tr("Ctrl+."));
fileSettings->setStatusTip(tr("Document Settings"));
fileSettings->setWhatsThis(tr("Settings\n\nSets properties of the file"));
connect(fileSettings, SIGNAL(triggered()), SLOT(slotFileSettings()));
filePrint = new QAction(QIcon((":/bitmaps/svg/fileprint.svg")), tr("&Print..."), this);
filePrint->setShortcut(QKeySequence::Print);
filePrint->setStatusTip(tr("Prints the current document"));
filePrint->setWhatsThis(tr("Print File\n\nPrints the current document"));
connect(filePrint, SIGNAL(triggered()), SLOT(slotFilePrint()));
filePrintFit = new QAction(tr("Print Fit to Page..."), this);
filePrintFit->setShortcut(tr("Ctrl+Shift+P"));
filePrintFit->setStatusTip(tr("Print Fit to Page"));
filePrintFit->setWhatsThis(
tr("Print Fit to Page\n\n"
"Print and fit content to the page size"));
connect(filePrintFit, SIGNAL(triggered()), SLOT(slotFilePrintFit()));
fileQuit = new QAction(tr("E&xit"), this);
fileQuit->setShortcut(QKeySequence::Quit);
fileQuit->setStatusTip(tr("Quits the application"));
fileQuit->setWhatsThis(tr("Exit\n\nQuits the application"));
connect(fileQuit, SIGNAL(triggered()), SLOT(slotFileQuit()));
applSettings = new QAction(tr("Application Settings..."), this);
applSettings->setShortcut(tr("Ctrl+,"));
applSettings->setStatusTip(tr("Application Settings"));
applSettings->setWhatsThis(
tr("Qucs Settings\n\nSets properties of the application"));
connect(applSettings, SIGNAL(triggered()), SLOT(slotApplSettings()));
refreshSchPath = new QAction(tr("Refresh Search Path..."), this);
//refreshSchPath->setShortcut(Qt::CTRL+Qt::Key_Comma);
refreshSchPath->setStatusTip(tr("Refresh Search Path"));
refreshSchPath->setWhatsThis(
tr("Refresh Path\n\nRechecks the list of paths for subcircuit files."));
connect(refreshSchPath, SIGNAL(triggered()), SLOT(slotRefreshSchPath()));
alignTop = new QAction(tr("Align top"), this);
alignTop->setShortcut(tr("Ctrl+T"));
alignTop->setStatusTip(tr("Align top selected elements"));
alignTop->setWhatsThis(
tr("Align top\n\nAlign selected elements to their upper edge"));
connect(alignTop, SIGNAL(triggered()), SLOT(slotAlignTop()));
alignBottom = new QAction(tr("Align bottom"), this);
alignBottom->setStatusTip(tr("Align bottom selected elements"));
alignBottom->setWhatsThis(tr("Align bottom\n\nAlign selected elements to their lower edge"));
connect(alignBottom, SIGNAL(triggered()), SLOT(slotAlignBottom()));
alignLeft = new QAction(tr("Align left"), this);
alignLeft->setStatusTip(tr("Align left selected elements"));
alignLeft->setWhatsThis(tr("Align left\n\nAlign selected elements to their left edge"));
connect(alignLeft, SIGNAL(triggered()), SLOT(slotAlignLeft()));
alignRight = new QAction(tr("Align right"), this);
alignRight->setStatusTip(tr("Align right selected elements"));
alignRight->setWhatsThis(tr("Align right\n\n"
"Align selected elements to their right edge"));
connect(alignRight, SIGNAL(triggered()), SLOT(slotAlignRight()));
distrHor = new QAction(tr("Distribute horizontally"), this);
distrHor->setStatusTip(tr("Distribute equally horizontally"));
distrHor->setWhatsThis(tr("Distribute horizontally\n\n"
"Distribute horizontally selected elements"));
connect(distrHor, SIGNAL(triggered()), SLOT(slotDistribHoriz()));
distrVert = new QAction(tr("Distribute vertically"), this);
distrVert->setStatusTip(tr("Distribute equally vertically"));
distrVert->setWhatsThis(tr("Distribute vertically\n\n"
"Distribute vertically selected elements"));
connect(distrVert, SIGNAL(triggered()), SLOT(slotDistribVert()));
centerHor = new QAction(tr("Center horizontally"), this);
centerHor->setStatusTip(tr("Center horizontally selected elements"));
centerHor->setWhatsThis(tr("Center horizontally\n\n"
"Center horizontally selected elements"));
connect(centerHor, SIGNAL(triggered()), SLOT(slotCenterHorizontal()));
centerVert = new QAction(tr("Center vertically"), this);
centerVert->setStatusTip(tr("Center vertically selected elements"));
centerVert->setWhatsThis( tr("Center vertically\n\n"
"Center vertically selected elements"));
connect(centerVert, SIGNAL(triggered()), SLOT(slotCenterVertical()));
onGrid = new QAction(tr("Set on Grid"), this);
onGrid->setShortcut(tr("Ctrl+U"));
onGrid->setStatusTip(tr("Sets selected elements on grid"));
onGrid->setWhatsThis(tr("Set on Grid\n\nSets selected elements on grid"));
onGrid->setCheckable(true);
connect(onGrid, SIGNAL(toggled(bool)), SLOT(slotOnGrid(bool)));
moveText = new QAction(tr("Move Component Text"), this);
moveText->setShortcut(tr("Ctrl+K"));
moveText->setStatusTip(tr("Moves the property text of components"));
moveText->setWhatsThis(
tr("Move Component Text\n\nMoves the property text of components"));
moveText->setCheckable(true);
connect(moveText, SIGNAL(toggled(bool)), SLOT(slotMoveText(bool)));
changeProps = new QAction(tr("Replace..."), this);
changeProps->setShortcut(Qt::Key_F7);
changeProps->setStatusTip(tr("Replace component properties or VHDL code"));
changeProps->setWhatsThis(
tr("Replace\n\nChange component properties\nor\ntext in VHDL code"));
connect(changeProps, SIGNAL(triggered()), SLOT(slotChangeProps()));
editCut = new QAction(QIcon((":/bitmaps/svg/editcut.svg")), tr("Cu&t"), this);
editCut->setShortcut(tr("Ctrl+X"));
editCut->setStatusTip(tr("Cuts out the selection and puts it into the clipboard"));
editCut->setWhatsThis(tr("Cut\n\nCuts out the selection and puts it into the clipboard"));
connect(editCut, SIGNAL(triggered()), SLOT(slotEditCut()));
editCopy = new QAction(QIcon((":/bitmaps/svg/editcopy.svg")), tr("&Copy"), this);
editCopy->setShortcut(QKeySequence::Copy);
editCopy->setStatusTip(tr("Copies the selection into the clipboard"));
editCopy->setWhatsThis(tr("Copy\n\nCopies the selection into the clipboard"));
connect(editCopy, SIGNAL(triggered()), SLOT(slotEditCopy()));
editPaste = new QAction(QIcon((":/bitmaps/svg/editpaste.svg")), tr("&Paste"), this);
editPaste->setShortcut(QKeySequence::Paste);
editPaste->setStatusTip(tr("Pastes the clipboard contents to the cursor position"));
editPaste->setWhatsThis(tr("Paste\n\nPastes the clipboard contents to the cursor position"));
editPaste->setCheckable(true);
connect(editPaste, SIGNAL(toggled(bool)), SLOT(slotEditPaste(bool)));
editDelete = new QAction(QIcon((":/bitmaps/svg/editdelete.svg")), tr("&Delete"), this);
#ifdef __APPLE__
editDelete->setShortcuts({QKeySequence(Qt::Key_Backspace), QKeySequence(Qt::Key_Delete)});
#else
editDelete->setShortcut(QKeySequence::Delete);
#endif
editDelete->setStatusTip(tr("Deletes the selected components"));
editDelete->setWhatsThis(tr("Delete\n\nDeletes the selected components"));
editDelete->setCheckable(true);
connect(editDelete, SIGNAL(toggled(bool)), SLOT(slotEditDelete(bool)));
editFind = new QAction(tr("Find..."), this);
editFind->setShortcut(QKeySequence::Find);
editFind->setStatusTip(tr("Find a piece of text"));
editFind->setWhatsThis(tr("Find\n\nSearches for a piece of text"));
connect(editFind, SIGNAL(triggered()), SLOT(slotEditFind()));
// to ease usage with notebooks, backspace can also be used to delete
// currently not supported
//mainAccel->connectItem(mainAccel->insertItem(Qt::Key_Backspace),
// editDelete, SLOT(toggle()) );
exportAsImage = new QAction(tr("Export as image..."),this);
connect(exportAsImage,SIGNAL(triggered()),SLOT(slotSaveSchematicToGraphicsFile()));
exportAsImage->setStatusTip(tr("Exports the current document to an image file"));
exportAsImage->setWhatsThis(tr("Export as image\n\nExports the current document to an image file"));
// cursor left/right/up/down to move marker on a graph
cursorLeft = new QShortcut(QKeySequence(Qt::Key_Left), this);
connect(cursorLeft, SIGNAL(activated()), SLOT(slotCursorLeft()));
cursorRight = new QShortcut(QKeySequence(Qt::Key_Right), this);
connect(cursorRight, SIGNAL(activated()), SLOT(slotCursorRight()));
cursorUp = new QShortcut(QKeySequence(Qt::Key_Up), this);
connect(cursorUp, SIGNAL(activated()), SLOT(slotCursorUp()));
cursorDown = new QShortcut(QKeySequence(Qt::Key_Down), this);
connect(cursorDown, SIGNAL(activated()), SLOT(slotCursorDown()));
undo = new QAction(QIcon((":/bitmaps/svg/editundo.svg")), tr("&Undo"), this);
undo->setShortcut(QKeySequence::Undo);
undo->setStatusTip(tr("Undoes the last command"));
undo->setWhatsThis(tr("Undo\n\nMakes the last action undone"));
connect(undo, SIGNAL(triggered()), SLOT(slotEditUndo()));
redo = new QAction(QIcon((":/bitmaps/svg/editredo.svg")), tr("&Redo"), this);
redo->setShortcut(QKeySequence::Redo);
redo->setStatusTip(tr("Redoes the last command"));
redo->setWhatsThis(tr("Redo\n\nRepeats the last action once more"));
connect(redo, SIGNAL(triggered()), SLOT(slotEditRedo()));
projNew = new QAction(tr("&New Project..."), this);
projNew->setShortcut(tr("Ctrl+Shift+N"));
projNew->setStatusTip(tr("Creates a new project"));
projNew->setWhatsThis(tr("New Project\n\nCreates a new project"));
connect(projNew, SIGNAL(triggered()), SLOT(slotButtonProjNew()));
projOpen = new QAction(tr("&Open Project..."), this);
projOpen->setShortcut(tr("Ctrl+Shift+O"));
projOpen->setStatusTip(tr("Opens an existing project"));
projOpen->setWhatsThis(tr("Open Project\n\nOpens an existing project"));
connect(projOpen, SIGNAL(triggered()), SLOT(slotMenuProjOpen()));
projDel = new QAction(tr("&Delete Project..."), this);
projDel->setShortcut(tr("Ctrl+Shift+D"));
projDel->setStatusTip(tr("Deletes an existing project"));
projDel->setWhatsThis(tr("Delete Project\n\nDeletes an existing project"));
connect(projDel, SIGNAL(triggered()), SLOT(slotMenuProjDel()));
projClose = new QAction(tr("&Close Project"), this);
projClose->setShortcut(tr("Ctrl+Shift+W"));
projClose->setStatusTip(tr("Closes the current project"));
projClose->setWhatsThis(tr("Close Project\n\nCloses the current project"));
connect(projClose, SIGNAL(triggered()), SLOT(slotMenuProjClose()));
addToProj = new QAction(tr("&Add Files to Project..."), this);
addToProj->setShortcut(tr("Ctrl+Shift+A"));
addToProj->setStatusTip(tr("Copies files to project directory"));
addToProj->setWhatsThis(tr("Add Files to Project\n\nCopies files to project directory"));
connect(addToProj, SIGNAL(triggered()), SLOT(slotAddToProject()));
createLib = new QAction(tr("Create &Library..."), this);
createLib->setShortcut(tr("Ctrl+Shift+L"));
createLib->setStatusTip(tr("Create Library from Subcircuits"));
createLib->setWhatsThis(
tr("Create Library\n\nCreate Library from Subcircuits"));
connect(createLib, SIGNAL(triggered()), SLOT(slotCreateLib()));
graph2csv = new QAction(tr("Export to &CSV..."), this);
graph2csv->setShortcut(tr("Ctrl+Shift+C"));
graph2csv->setStatusTip(tr("Convert graph data to CSV file"));
graph2csv->setWhatsThis(tr("Export to CSV\n\nConvert graph data to CSV file"));
connect(graph2csv, SIGNAL(triggered()), SLOT(slotExportGraphAsCsv()));
buildModule = new QAction(tr("Build Verilog-A module..."), this);
buildModule->setStatusTip(tr("Run admsXml and C++ compiler"));
buildModule->setWhatsThis(tr("Build Verilog-A module\nRuns amdsXml and C++ compiler"));
connect(buildModule, SIGNAL(triggered()), SLOT(slotBuildModule()));
loadModule = new QAction(tr("Load Verilog-A module..."), this);
loadModule->setStatusTip(tr("Select Verilog-A symbols to be loaded"));
loadModule->setWhatsThis(tr("Load Verilog-A module\nLet the user select and load symbols"));
connect(loadModule, SIGNAL(triggered()), SLOT(slotLoadModule()));
magAll = new QAction(QIcon((":/bitmaps/svg/viewmagfit.svg")), tr("View All"), this);
magAll->setShortcut(Qt::Key_0);
magAll->setStatusTip(tr("Show the whole page"));
magAll->setWhatsThis(tr("View All\n\nShows the whole page content"));
connect(magAll, SIGNAL(triggered()), SLOT(slotShowAll()));
magSel = new QAction(QIcon((":/bitmaps/svg/viewmagsel.svg")), tr("Zoom to selection"), this);
magSel->setShortcut(tr("Z"));
magSel->setStatusTip(tr("Zoom to selected components"));
magSel->setWhatsThis(tr("Zoom to selection\n\nZoom to selected components"));
connect(magSel, SIGNAL(triggered()), SLOT(slotZoomToSelection()));
magOne = new QAction(QIcon((":/bitmaps/svg/viewmag1.svg")), tr("View 1:1"), this);
magOne->setShortcut(Qt::Key_1);
magOne->setStatusTip(tr("Views without magnification"));
magOne->setWhatsThis(tr("View 1:1\n\nShows the page content without magnification"));
connect(magOne, SIGNAL(triggered()), SLOT(slotShowOne()));
magPlus = new QAction(QIcon((":/bitmaps/svg/viewmag+.svg")), tr("Zoom in"), this);
magPlus->setShortcut(QKeySequence::ZoomIn);
magPlus->setStatusTip(tr("Zooms into the current view"));
magPlus->setWhatsThis(tr("Zoom in\n\nZooms the current view"));
magPlus->setCheckable(true);
connect(magPlus, SIGNAL(toggled(bool)), SLOT(slotZoomIn(bool)));
magMinus = new QAction(QIcon((":/bitmaps/svg/viewmag-.svg")), tr("Zoom out"), this);
magMinus->setShortcut(QKeySequence::ZoomOut);
magMinus->setStatusTip(tr("Zooms out the current view"));
magMinus->setWhatsThis(tr("Zoom out\n\nZooms out the current view"));
connect(magMinus, SIGNAL(triggered()), SLOT(slotZoomOut()));
QAction *escape = new QAction(this);
escape->setShortcut(Qt::Key_Escape);
connect(escape, SIGNAL(triggered()), SLOT(slotEscape()));
this->addAction(escape);
select = new QAction(QIcon((":/bitmaps/svg/pointer.svg")), tr("Select"), this);
select->setStatusTip(tr("Activate select mode"));
select->setWhatsThis(tr("Select\n\nActivates select mode"));
select->setCheckable(true);
connect(select, SIGNAL(toggled(bool)), SLOT(slotSelect(bool)));
selectAll = new QAction(tr("Select All"), this);
selectAll->setShortcut(tr("Ctrl+A"));
selectAll->setStatusTip(tr("Selects all elements"));
selectAll->setWhatsThis(tr("Select All\n\nSelects all elements of the document"));
connect(selectAll, SIGNAL(triggered()), SLOT(slotSelectAll()));
selectMarker = new QAction(tr("Select Markers"), this);
selectMarker->setShortcut(tr("Ctrl+Shift+M"));
selectMarker->setStatusTip(tr("Selects all markers"));
selectMarker->setWhatsThis(tr("Select Markers\n\nSelects all diagram markers of the document"));
connect(selectMarker, SIGNAL(triggered()), SLOT(slotSelectMarker()));
editRotate = new QAction(QIcon(":/bitmaps/svg/rotate_ccw.svg"), tr("Rotate"), this);
editRotate->setShortcut(tr("Ctrl+R"));
editRotate->setStatusTip(tr("Rotates the selected component by 90\x00B0"));
editRotate->setWhatsThis(tr("Rotate\n\nRotates the selected component by 90\x00B0 counter-clockwise"));
editRotate->setCheckable(true);
connect(editRotate, SIGNAL(toggled(bool)), SLOT(slotEditRotate(bool)));
editMirror = new QAction(QIcon(":/bitmaps/svg/mirror.svg"), tr("Mirror about X Axis"), this);
editMirror->setShortcut(tr("Ctrl+J"));
editMirror->setStatusTip(tr("Mirrors the selected item about X Axis"));
editMirror->setWhatsThis(tr("Mirror about X Axis\n\nMirrors the selected item about X Axis"));
editMirror->setCheckable(true);
connect(editMirror, SIGNAL(toggled(bool)), SLOT(slotEditMirrorX(bool)));
editMirrorY = new QAction(QIcon(":/bitmaps/svg/mirrory.svg"), tr("Mirror about Y Axis"), this);
editMirrorY->setShortcut(tr("Ctrl+M"));
editMirrorY->setStatusTip(tr("Mirrors the selected item about Y Axis"));
editMirrorY->setWhatsThis(tr("Mirror about Y Axis\n\nMirrors the selected item about Y Axis"));
editMirrorY->setCheckable(true);
connect(editMirrorY, SIGNAL(toggled(bool)), SLOT(slotEditMirrorY(bool)));
intoH = new QAction(QIcon((":/bitmaps/svg/bottom.svg")), tr("Go into Subcircuit"), this);
intoH->setShortcut(tr("Ctrl+I"));
intoH->setStatusTip(tr("Goes inside the selected subcircuit"));
intoH->setWhatsThis(
tr("Go into Subcircuit\n\nGoes inside the selected subcircuit"));
connect(intoH, SIGNAL(triggered()), SLOT(slotIntoHierarchy()));
popH = new QAction(QIcon((":/bitmaps/svg/top.svg")), tr("Pop out"), this);
popH->setShortcut(tr("Ctrl+H"));
popH->setStatusTip(tr("Pop outside subcircuit"));
popH->setWhatsThis(tr("Pop out\n\nGoes up one hierarchy level, i.e. leaves subcircuit"));
connect(popH, SIGNAL(triggered()), SLOT(slotPopHierarchy()));
popH->setEnabled(false); // only enabled if useful !!!!
editActivate = new QAction(QIcon(":bitmaps/svg/deactiv.svg"), tr("Deactivate/Activate"), this);
editActivate->setShortcut(tr("Ctrl+D"));
editActivate->setStatusTip(tr("Deactivate/Activate selected components"));
editActivate->setWhatsThis(tr("Deactivate/Activate\n\nDeactivate/Activate the selected components"));
editActivate->setCheckable(true);
connect(editActivate, SIGNAL(toggled(bool)), SLOT(slotEditActivate(bool)));
insEquation = new QAction(QIcon(":bitmaps/svg/equation.svg"), tr("Insert Equation"), this);
insEquation->setShortcut(tr("Ctrl+<"));
insEquation->setStatusTip(tr("Inserts an equation"));
insEquation->setWhatsThis(tr("Insert Equation\n\nInserts a user defined equation"));
insEquation->setCheckable(true);
connect(insEquation, SIGNAL(toggled(bool)), SLOT(slotInsertEquation(bool)));
insGround = new QAction(QIcon(":/bitmaps/svg/ground.svg"), tr("Insert Ground"), this);
insGround->setShortcut(tr("Ctrl+G"));
insGround->setStatusTip(tr("Inserts a ground symbol"));
insGround->setWhatsThis(tr("Insert Ground\n\nInserts a ground symbol"));
insGround->setCheckable(true);
connect(insGround, SIGNAL(toggled(bool)), SLOT(slotInsertGround(bool)));
insPort = new QAction(QIcon(":/bitmaps/svg/port.svg"), tr("Insert Port"), this);
insPort->setStatusTip(tr("Inserts a port symbol"));
insPort->setWhatsThis(tr("Insert Port\n\nInserts a port symbol"));
insPort->setCheckable(true);
connect(insPort, SIGNAL(toggled(bool)), SLOT(slotInsertPort(bool)));
insWire = new QAction(QIcon(":bitmaps/svg/wire.svg"), tr("Wire"), this);
insWire->setShortcut(tr("Ctrl+W"));
insWire->setStatusTip(tr("Inserts a wire"));
insWire->setWhatsThis(tr("Wire\n\nInserts a wire"));
insWire->setCheckable(true);
connect(insWire, SIGNAL(toggled(bool)), SLOT(slotSetWire(bool)));
insLabel = new QAction(QIcon(":/bitmaps/svg/nodename.svg"), tr("Wire Label"), this);
insLabel->setShortcut(tr("Ctrl+L"));
insLabel->setStatusTip(tr("Inserts a wire or pin label"));
insLabel->setWhatsThis(tr("Wire Label\n\nInserts a wire or pin label"));
insLabel->setCheckable(true);
connect(insLabel, SIGNAL(toggled(bool)), SLOT(slotInsertLabel(bool)));
insEntity = new QAction(tr("VHDL entity"), this);
insEntity->setShortcut(tr("Ctrl+Space"));
insEntity->setStatusTip(tr("Inserts skeleton of VHDL entity"));
insEntity->setWhatsThis(
tr("VHDL entity\n\nInserts the skeleton of a VHDL entity"));
connect(insEntity, SIGNAL(triggered()), SLOT(slotInsertEntity()));
callEditor = new QAction(tr("Text Editor"), this);
callEditor->setShortcut(tr("Ctrl+1"));
callEditor->setStatusTip(tr("Starts the Qucs text editor"));
callEditor->setWhatsThis(tr("Text editor\n\nStarts the Qucs text editor"));
connect(callEditor, SIGNAL(triggered()), SLOT(slotCallEditor()));
callFilter = new QAction(tr("Filter synthesis"), this);
callFilter->setShortcut(tr("Ctrl+2"));
callFilter->setStatusTip(tr("Starts QucsFilter"));
callFilter->setWhatsThis(tr("Filter synthesis\n\nStarts QucsFilter"));
connect(callFilter, SIGNAL(triggered()), SLOT(slotCallFilter()));
callActiveFilter = new QAction(tr("Active filter synthesis"),this);
callActiveFilter->setShortcut(tr("Ctrl+3"));
callActiveFilter->setStatusTip(tr("Starts QucsActiveFilter"));
callActiveFilter->setWhatsThis(tr("Active filter synthesis\n\nStarts QucsActiveFilter"));
connect(callActiveFilter, SIGNAL(triggered()), SLOT(slotCallActiveFilter()));
callLine = new QAction(tr("Line calculation"), this);
callLine->setShortcut(tr("Ctrl+4"));
callLine->setStatusTip(tr("Starts QucsTrans"));
callLine->setWhatsThis(tr("Line calculation\n\nStarts transmission line calculator"));
connect(callLine, SIGNAL(triggered()), SLOT(slotCallLine()));
callMatch = new QAction(tr("Matching Circuit"), this);
callMatch->setShortcut(tr("Ctrl+5"));
callMatch->setStatusTip(tr("Creates Matching Circuit"));
callMatch->setWhatsThis(tr("Matching Circuit\n\nDialog for Creating Matching Circuit"));
connect(callMatch, SIGNAL(triggered()), SLOT(slotCallMatch()));
callAtt = new QAction(tr("Attenuator synthesis"), this);
callAtt->setShortcut(tr("Ctrl+6"));
callAtt->setStatusTip(tr("Starts QucsAttenuator"));
callAtt->setWhatsThis(tr("Attenuator synthesis\n\nStarts attenuator calculation program"));
connect(callAtt, SIGNAL(triggered()), SLOT(slotCallAtt()));
callPwrComb = new QAction(tr("Power combining"), this);
callPwrComb->setShortcut(tr("Ctrl+7"));
callPwrComb->setStatusTip(tr("Starts QucsPowerCombining"));
callPwrComb->setWhatsThis(tr("Power combining\n\nStarts power combining calculation program"));
connect(callPwrComb, SIGNAL(triggered()), SLOT(slotCallPwrComb()));
callSPAR_Viewer = new QAction(tr("S-parameter Viewer"), this);
callSPAR_Viewer->setStatusTip(tr("Starts S-parameter viewer"));
callSPAR_Viewer->setWhatsThis(tr("S-parameter Viewer\n\nStarts S-parameter viewer"));
connect(callSPAR_Viewer, SIGNAL(triggered()), SLOT(slotCallSPAR_Viewer()));
callConverter = new QAction(tr("Data files converter"), this);
callConverter->setShortcut(tr("Ctrl+8"));
callConverter->setStatusTip(tr("Convert data file"));
callConverter->setWhatsThis(tr("Import/Export Data\n\nConvert data file to various file formats"));
connect(callConverter, SIGNAL(triggered()), SLOT(slotImportData()));
callRFLayout = new QAction(tr("RF Layout"), this);
callRFLayout->setShortcut(tr("Ctrl+9"));
callRFLayout->setStatusTip(tr("Starts Qucs-RFLayout"));
callRFLayout->setWhatsThis(tr("Power combining\n\nStarts power combining calculation program"));
connect(callRFLayout, SIGNAL(triggered()), SLOT(slotCallRFLayout()));
simulate = new QAction(QIcon((":/bitmaps/svg/gear.svg")), tr("Simulate"), this);
simulate->setShortcut(Qt::Key_F2);
simulate->setStatusTip(tr("Simulates the current schematic"));
simulate->setWhatsThis(tr("Simulate\n\nSimulates the current schematic"));
connect(simulate, SIGNAL(triggered()), SLOT(slotSimulate()));
tune = new QAction(QIcon((":/bitmaps/svg/tune.svg")),tr("Tune"), this);
tune->setShortcut(Qt::Key_F3);
tune->setStatusTip(tr("Tuner"));
tune->setWhatsThis(tr("Allows to live tune variables and show the result in the dataview"));
tune->setCheckable(true);
connect(tune, SIGNAL(toggled(bool)), SLOT(slotTune(bool)));
dpl_sch = new QAction(QIcon((":/bitmaps/svg/rebuild.svg")), tr("View Data Display/Schematic"), this);
dpl_sch->setShortcut(Qt::Key_F4);
dpl_sch->setStatusTip(tr("Changes to data display or schematic page"));
dpl_sch->setWhatsThis(tr("View Data Display/Schematic\n\nChanges to data display or schematic page"));
connect(dpl_sch, SIGNAL(triggered()), SLOT(slotToPage()));
dcbias = new QAction(tr("Calculate DC bias"), this);
dcbias->setShortcut(Qt::Key_F8);
dcbias->setStatusTip(tr("Calculates DC bias and shows it"));
dcbias->setWhatsThis(tr("Calculate DC bias\n\nCalculates DC bias and shows it"));
connect(dcbias, SIGNAL(triggered()), SLOT(slotDCbias()));
save_netlist = new QAction(tr("Save netlist"), this);
save_netlist->setStatusTip(tr("Save netlist"));
save_netlist->setWhatsThis(tr(QString::fromUtf8("Save netlist to %1").arg(a_netlist2Console ? "console" : "file").toLatin1().constData()));
connect(save_netlist, SIGNAL(triggered()), SLOT(slotSaveNetlist()));
saveCdlNetlist = new QAction(tr("Save CDL netlist"), this);
saveCdlNetlist->setStatusTip(tr("Save CDL netlist"));
saveCdlNetlist->setWhatsThis(tr(QString::fromUtf8("Save CDL netlist to %1").arg(a_netlist2Console ? "console" : "file").toLatin1().constData()));
connect(saveCdlNetlist, SIGNAL(triggered()), SLOT(slotSaveCdlNetlist()));
setMarker = new QAction(QIcon((":/bitmaps/svg/marker.svg")), tr("Set Marker on Graph"), this);
setMarker->setShortcut(Qt::CTRL|Qt::Key_B);
setMarker->setStatusTip(tr("Sets a marker on a diagram's graph"));
setMarker->setWhatsThis(tr("Set Marker\n\nSets a marker on a diagram's graph"));
setMarker->setCheckable(true);
connect(setMarker, SIGNAL(toggled(bool)), SLOT(slotSetMarker(bool)));
setDiagramLimits = new QAction(QIcon((":/bitmaps/svg/viewwave.svg")), tr("Set Diagram Limits"), this);
//setDiagramLimits->setShortcut(tr("Ctrl+E"));
setDiagramLimits->setStatusTip(tr("Pick the diagram limits using the mouse. Right click for default."));
setDiagramLimits->setWhatsThis(tr("Set Diagram Limits\n\nPick the diagram limits using the mouse. Right click for default."));
setDiagramLimits->setCheckable(true);
connect(setDiagramLimits, SIGNAL(toggled(bool)), SLOT(slotSetDiagramLimits(bool)));
resetDiagramLimits = new QAction(tr("Reset Diagram Limits"), this);
resetDiagramLimits->setShortcut(tr("Ctrl+Shift+E"));
resetDiagramLimits->setStatusTip(tr("Resets the limits for all axis to auto."));
resetDiagramLimits->setWhatsThis(tr("Reset Diagram Limits\n\nResets the limits for all axis to auto."));
connect(resetDiagramLimits, SIGNAL(triggered()), SLOT(slotResetDiagramLimits()));
showGrid = new QAction(tr("Show Grid (current document)"), this);
showGrid->setCheckable(true);
showGrid->setShortcut(tr("Alt+G"));
showGrid->setStatusTip(tr("Show or hide the grid for the current document."));
showGrid->setWhatsThis(tr("Show / Hide Grid\n\nShow or hide the grid for the current document."));
connect(showGrid, SIGNAL(triggered()), SLOT(slotShowGrid()));
showMsg = new QAction(tr("Show Last Messages"), this);
showMsg->setShortcut(Qt::Key_F5);
showMsg->setStatusTip(tr("Shows last simulation messages"));
showMsg->setWhatsThis(tr("Show Last Messages\n\nShows the messages of the last simulation"));
connect(showMsg, SIGNAL(triggered()), SLOT(slotShowLastMsg()));
showNet = new QAction(tr("Show Last Netlist"), this);
showNet->setShortcut(Qt::Key_F6);
showNet->setStatusTip(tr("Shows last simulation netlist"));
showNet->setWhatsThis(tr("Show Last Netlist\n\nShows the netlist of the last simulation"));
connect(showNet, SIGNAL(triggered()), SLOT(slotShowLastNetlist()));
simSettings = new QAction(tr("Simulators Settings..."),this);
connect(simSettings,SIGNAL(triggered()),SLOT(slotSimSettings()));
buildVAModule = new QAction(tr("Build Verilog-A module from subcircuit"),this);
connect(buildVAModule,SIGNAL(triggered()),SLOT(slotBuildVAModule()));
//buildIFS = new QAction(tr("Build XSPICE IFS file from subcircuit"),this);
//connect(buildIFS,SIGNAL(triggered()),SLOT(slotBuildXSPICEIfs()));
viewBrowseDock = new QAction(tr("&Dock Window"), this);
viewBrowseDock->setCheckable(true);
viewBrowseDock->setStatusTip(tr("Enables/disables the browse dock window"));
viewBrowseDock->setWhatsThis(tr("Browse Window\n\nEnables/disables the browse dock window"));
connect(viewBrowseDock, SIGNAL(toggled(bool)), SLOT(slotViewBrowseDock(bool)));
viewOctaveDock = new QAction(tr("&Octave Window"), this);
viewOctaveDock->setCheckable(true);
viewOctaveDock->setStatusTip(tr("Shows/hides the Octave dock window"));
viewOctaveDock->setWhatsThis(tr("Octave Window\n\nShows/hides the Octave dock window"));
connect(viewOctaveDock, SIGNAL(toggled(bool)), SLOT(slotViewOctaveDock(bool)));
helpIndex = new QAction(tr("Help Index..."), this);
helpIndex->setShortcut(Qt::Key_F1);
helpIndex->setStatusTip(tr("Index of Qucs Help"));
helpIndex->setWhatsThis(tr("Help Index\n\nIndex of intern Qucs help"));
connect(helpIndex, SIGNAL(triggered()), SLOT(slotHelpIndex()));
/*helpQucsIndex = new QAction(tr("Help Index (basic Qucs version)"), this);
helpQucsIndex->setStatusTip(tr("Index of basic Qucs Help"));
helpQucsIndex->setWhatsThis(tr("Help Index\n\nIndex of basic Qucs help"));
connect(helpQucsIndex, SIGNAL(triggered()), SLOT(slotHelpQucsIndex()));*/
helpGetStart = new QAction(tr("Getting Started..."), this);
helpGetStart->setStatusTip(tr("Getting Started with Qucs"));
helpGetStart->setWhatsThis(tr("Getting Started\n\nShort introduction into Qucs"));
connect(helpGetStart, SIGNAL(triggered()), SLOT(slotGettingStarted()));
helpAboutApp = new QAction(tr("&About Qucs-S"), this);
helpAboutApp->setStatusTip(tr("About the application"));
helpAboutApp->setWhatsThis(tr("About\n\nAbout the application"));
connect(helpAboutApp, SIGNAL(triggered()),this, SLOT(slotHelpAbout()));
helpAboutQt = new QAction(tr("&About Qt"), this);
helpAboutQt->setStatusTip(tr("About Qt"));
helpAboutQt->setWhatsThis(tr("About Qt\n\nAbout Qt by Trolltech"));
connect(helpAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
}
// ----------------------------------------------------------
void QucsApp::initMenuBar()
{
fileMenu = new QMenu(tr("&File")); // menuBar entry fileMenu
fileMenu->addAction(fileNew);
fileMenu->addAction(textNew);
fileMenu->addAction(symNew);
fileMenu->addAction(fileOpen);
fileMenu->addAction(fileClose);
recentFilesMenu = new QMenu(tr("Open Recent"),fileMenu);
fileMenu->addMenu(recentFilesMenu);
for (auto & i : fileRecentAction) {
recentFilesMenu->addAction(i);
}
recentFilesMenu->addSeparator();
recentFilesMenu->addAction(fileClearRecent);
fileMenu->addSeparator();
fileMenu->addAction(fileSave);
fileMenu->addAction(fileSaveAll);
fileMenu->addAction(fileSaveAs);
fileMenu->addAction(exportAsImage);
fileMenu->addAction(filePrint);
fileMenu->addAction(filePrintFit);
fileMenu->addSeparator();
fileMenu->addAction(fileExamples);
fileMenu->addSeparator();
fileMenu->addAction(fileSettings);
fileMenu->addAction(symEdit);
fileMenu->addSeparator();
fileMenu->addAction(applSettings);
fileMenu->addAction(refreshSchPath);
fileMenu->addSeparator();
fileMenu->addAction(fileQuit);
editMenu = new QMenu(tr("&Edit")); // menuBar entry editMenu
editMenu->addAction(undo);
editMenu->addAction(redo);
editMenu->addSeparator();
editMenu->addAction(editCut);
editMenu->addAction(editCopy);
editMenu->addAction(editPaste);
editMenu->addAction(editDelete);
editMenu->addSeparator();
editMenu->addAction(select);
editMenu->addAction(selectAll);
editMenu->addAction(selectMarker);
editMenu->addAction(editFind);
editMenu->addAction(changeProps);
editMenu->addAction(editRotate);
editMenu->addAction(editMirror);
editMenu->addAction(editMirrorY);
editMenu->addAction(editActivate);
editMenu->addSeparator();
editMenu->addAction(intoH);
editMenu->addAction(popH);
alignMenu = new QMenu(tr("P&ositioning")); // menuBar entry alignMenu
alignMenu->addAction(moveText);
alignMenu->addAction(onGrid);
alignMenu->addSeparator();
alignMenu->addAction(centerHor);
alignMenu->addAction(centerVert);
alignMenu->addSeparator();
alignMenu->addAction(alignTop);
alignMenu->addAction(alignBottom);
alignMenu->addAction(alignLeft);
alignMenu->addAction(alignRight);
alignMenu->addSeparator();
alignMenu->addAction(distrHor);
alignMenu->addAction(distrVert);
insMenu = new QMenu(tr("&Insert")); // menuBar entry insMenu
insMenu->addAction(insWire);
insMenu->addAction(insLabel);
insMenu->addAction(insEquation);
insMenu->addAction(insGround);
insMenu->addAction(insPort);
insMenu->addAction(setMarker);
insMenu->addAction(insEntity);
projMenu = new QMenu(tr("&Project")); // menuBar entry projMenu
projMenu->addAction(projNew);
projMenu->addAction(projOpen);
projMenu->addAction(addToProj);
projMenu->addAction(projClose);
projMenu->addAction(projDel);
projMenu->addSeparator();
projMenu->addAction(createLib);
projMenu->addSeparator();
projMenu->addAction(graph2csv);
// TODO only enable if document is VA file
if (QucsSettings.DefaultSimulator == spicecompat::simQucsator ||
QucsSettings.DefaultSimulator == spicecompat::simNgspice) {
// There is no VA-modules builder available for Ngspice etc.
projMenu->addSeparator();
projMenu->addAction(buildModule);
projMenu->addAction(loadModule);
}
toolMenu = new QMenu(tr("&Tools")); // menuBar entry toolMenu
toolMenu->addAction(callEditor);
toolMenu->addAction(callFilter);
toolMenu->addAction(callActiveFilter);
toolMenu->addAction(callLine);
toolMenu->addAction(callMatch);
toolMenu->addAction(callAtt);
toolMenu->addAction(callPwrComb);
toolMenu->addAction(callConverter);
toolMenu->addAction(callRFLayout);
toolMenu->addAction(callSPAR_Viewer);
toolMenu->addSeparator();
cmMenu = new QMenu(tr("Compact modelling"));
cmMenu->addAction(buildVAModule);
//cmMenu->addAction(buildIFS);
toolMenu->addMenu(cmMenu);
simMenu = new QMenu(tr("&Simulation")); // menuBar entry simMenu
simMenu->addAction(simulate);
simMenu->addAction(tune);
simMenu->addAction(dpl_sch);
simMenu->addAction(dcbias);
simMenu->addAction(showMsg);
simMenu->addAction(showNet);
simMenu->addAction(save_netlist);
simMenu->addAction(saveCdlNetlist);
simMenu->addAction(simSettings);
viewMenu = new QMenu(tr("&View")); // menuBar entry viewMenu
viewMenu->addAction(magAll);
viewMenu->addAction(magSel);
viewMenu->addAction(magOne);
viewMenu->addAction(magPlus);
viewMenu->addAction(magMinus);
viewMenu->addAction(setDiagramLimits);
viewMenu->addSeparator();
viewMenu->addAction(showGrid);
viewMenu->addSeparator();
//viewMenu->setCheckable(true);
viewMenu->addAction(viewBrowseDock);
viewMenu->addAction(viewOctaveDock);
helpMenu = new QMenu(tr("&Help")); // menuBar entry helpMenu
helpMenu->addAction(helpIndex);
//helpMenu->addAction(helpQucsIndex);
helpMenu->addAction(helpGetStart);
helpMenu->addSeparator();
//Fill submenu's with filenames of PDF documents
QDir TechnicalDir = QDir(QucsSettings.DocDir.replace('\\','/'));
if(TechnicalDir.cd("technical"))
{
helpTechnical = new QMenu(tr("&Technical Papers"));
helpMenu->addMenu(helpTechnical);
TechnicalDir.setFilter(QDir::Files);
QStringList entries = TechnicalDir.entryList();
for(int i=0;i<entries.size();i++)
{
QAction* helpTechnicalActions = new QAction(entries[i], this);
helpTechnicalActions->setObjectName ( entries[i] );
helpTechnicalActions->setStatusTip(tr("Open ")+entries[i]);
helpTechnicalActions->setWhatsThis(entries[i]+tr("\n\nOpen ")+entries[i]);
connect(helpTechnicalActions, SIGNAL(triggered()), SLOT(slotHelpTechnical()));
helpTechnical->addAction(helpTechnicalActions);
}
}
//Fill submenu's with filenames of PDF documents
QDir ReportDir = QDir(QucsSettings.DocDir.replace('\\','/'));
if(ReportDir.cd("report"))
{
helpReport = new QMenu(tr("Technical &Reports"));
helpMenu->addMenu(helpReport);
ReportDir.setFilter(QDir::Files);
QStringList entries = ReportDir.entryList();
for(int i=0;i<entries.size();i++)
{
QAction* helpReportActions = new QAction(entries[i], this);
helpReportActions->setObjectName ( entries[i] );
helpReportActions->setStatusTip(tr("Open ")+entries[i]);
helpReportActions->setWhatsThis(entries[i]+tr("\n\nOpen ")+entries[i]);
connect(helpReportActions, SIGNAL(triggered()), SLOT(slotHelpReport()));
helpReport->addAction(helpReportActions);
}
}
//Fill submenu's with filenames of PDF documents
QDir TutorialDir = QDir(QucsSettings.DocDir.replace('\\','/'));
if(TutorialDir.cd("tutorial"))
{
helpTutorial = new QMenu(tr("T&utorials"));
helpMenu->addMenu(helpTutorial);
TutorialDir.setFilter(QDir::Files);
QStringList entries = TutorialDir.entryList();
for(int i=0;i<entries.size();i++)
{
QAction* helpTutorialActions = new QAction(entries[i], this);
helpTutorialActions->setObjectName ( entries[i] );
helpTutorialActions->setStatusTip(tr("Open ")+entries[i]);
helpTutorialActions->setWhatsThis(entries[i]+tr("\n\nOpen ")+entries[i]);
connect(helpTutorialActions, SIGNAL(triggered()), SLOT(slotHelpTutorial()));
helpTutorial->addAction(helpTutorialActions);
}
}
helpMenu->addSeparator();
helpMenu->addAction(helpAboutApp);
helpMenu->addAction(helpAboutQt);
menuBar()->addMenu(fileMenu);
menuBar()->addMenu(editMenu);
menuBar()->addMenu(alignMenu);
menuBar()->addMenu(insMenu);
menuBar()->addMenu(projMenu);
menuBar()->addMenu(toolMenu);
menuBar()->addMenu(simMenu);
menuBar()->addMenu(viewMenu);
menuBar()->addSeparator();
menuBar()->addMenu(helpMenu);
}
// ----------------------------------------------------------
void QucsApp::initToolBar()
{
fileToolbar = new QToolBar(tr("File"));
this->addToolBar(fileToolbar);
fileToolbar->addAction(fileNew);
fileToolbar->addAction(textNew);
fileToolbar->addAction(symNew);
fileToolbar->addAction(fileOpen);
fileToolbar->addAction(fileSave);
fileToolbar->addAction(fileSaveAll);
fileToolbar->addAction(fileClose);
fileToolbar->addAction(filePrint);
editToolbar = new QToolBar(tr("Edit"));
this->addToolBar(editToolbar);
editToolbar->addAction(editCut);
editToolbar->addAction(editCopy);
editToolbar->addAction(editPaste);
editToolbar->addAction(editDelete);
editToolbar->addAction(undo);
editToolbar->addAction(redo);
viewToolbar = new QToolBar(tr("View"));
this->addToolBar(viewToolbar);
viewToolbar->addAction(magAll);
viewToolbar->addAction(magSel);
viewToolbar->addAction(magOne);
viewToolbar->addAction(magPlus);
viewToolbar->addAction(magMinus);
workToolbar = new QToolBar(tr("Work"));
this->addToolBar(workToolbar);
workToolbar->addAction(select);
workToolbar->addAction(editActivate);
workToolbar->addAction(editMirror);
workToolbar->addAction(editMirrorY);
workToolbar->addAction(editRotate);
workToolbar->addAction(intoH);
workToolbar->addAction(popH);
workToolbar->addAction(insWire);
workToolbar->addAction(insLabel);
workToolbar->addAction(insEquation);
workToolbar->addAction(insGround);
workToolbar->addAction(insPort);
//workToolbar->addSeparator(); // <<<=======================
simulateToolbar = new QToolBar(tr("Simulate"));
this->addToolBar(simulateToolbar);
simulateToolbar->addWidget(reinterpret_cast<QWidget *>(simulatorsCombobox));
simulateToolbar->addAction(simulate);
simulateToolbar->addAction(tune);
simulateToolbar->addAction(dpl_sch);
simulateToolbar->addAction(setMarker);
simulateToolbar->addAction(setDiagramLimits);
}
// ----------------------------------------------------------
void QucsApp::initStatusBar()
{
DiagramValuesLabel = new QLabel("", statusBar());
statusBar()->addPermanentWidget(DiagramValuesLabel, 0);
// To reserve enough space, insert the longest text and rewrite it afterwards.
//SimulatorLabel = new QLabel(spicecompat::getDefaultSimulatorName(QucsSettings.DefaultSimulator));
//statusBar()->addPermanentWidget(SimulatorLabel, 0);
WarningLabel = new QLabel(tr("no warnings"), statusBar());
statusBar()->addWidget(WarningLabel, 0);
PositionLabel = new QLabel("0 : 0", statusBar());
#ifndef __APPLE__
PositionLabel->setAlignment(Qt::AlignRight);
#endif
statusBar()->addPermanentWidget(PositionLabel, 0);
statusBar()->showMessage(tr("Ready."), 2000);
}
// ----------------------------------------------------------
void QucsApp::slotShowWarnings()
{
static int ResultState = 0;
if(ResultState == 0) {
QFont f = WarningLabel->font();
f.setWeight(QFont::DemiBold);