-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMainWindowMenu.cpp
1216 lines (1021 loc) · 58.8 KB
/
MainWindowMenu.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
#include "MainWindow.h"
#include "ui_mainwindow.h"
#include "BKMessageBox.h"
#include "Board_10_FDD.h"
#include "Board_11.h"
#include "Board_11M.h"
#include "Board_11M_FDD.h"
#include "Board_11_FDD.h"
#include "Board_EXT32.h"
#include "Board_MSTD.h"
#include <QWidgetAction>
inline static QIcon makeIcon(int i, QPixmap &pm)
{
return QIcon(pm.copy(i * 16, 0, 16, 16));
}
using updateFuncRef = void (CMainFrame::*)(QAction *);
using updateFuncArg1Ref = void (CMainFrame::*)(QAction *, UINT);
struct UpdateFunc
{
UpdateFunc() : fn(nullptr), fnArg1(nullptr), arg(0) {}
UpdateFunc(updateFuncRef f) : fn(f), fnArg1(nullptr), arg(0) {};
UpdateFunc(updateFuncArg1Ref f, int a) : fn(nullptr), fnArg1(f), arg(a) {};
updateFuncRef fn;
updateFuncArg1Ref fnArg1;
UINT arg;
};
Q_DECLARE_METATYPE(UpdateFunc);
void CMainFrame::OnMenuAboutToShow()
{
QMenu *menu = static_cast<QMenu *>(sender());
if (menu == nullptr)
return;
UpdateActions(menu->actions());
}
void CMainFrame::OnToolbarActionTriggered()
{
QToolBar *menu = static_cast<QToolBar *>(sender());
if (menu == nullptr)
return;
UpdateActions(menu->actions());
}
void CMainFrame::UpdateActions(QList<QAction *>menu)
{
foreach (QAction *action, menu) {
if (action->isSeparator()) {
// Nothing to update
} else if (action->menu()) {
// This action is associated with a submenu, iterating it recursively...
UpdateActions(action->menu()->actions());
} else {
UpdateFunc func = qvariant_cast<UpdateFunc>(action->data());
if (func.fn) {
(this->*func.fn)(action);
} else if (func.fnArg1){
(this->*func.fnArg1)(action, func.arg);
}
}
}
}
/*
Как оказалось, единственно возможный способ заменить текст в выпадающем меню -
перехватить событие, и подменять строку при вызове меню.
*/
void CMainFrame::OnShowFddPopupMenu()
{
QMenu *menu = static_cast<QMenu *>(sender());
if (menu == nullptr)
return;
QList<QAction *>acts = menu->actions();
UpdateFunc func = qvariant_cast<UpdateFunc>(acts[0]->data());
UINT id = func.arg;
FDD_DRIVE eDrive = FDD_DRIVE::NONE;
switch (id)
{
case ID_FILE_LOADDRIVE_A:
eDrive = FDD_DRIVE::A;
break;
case ID_FILE_LOADDRIVE_B:
eDrive = FDD_DRIVE::B;
break;
case ID_FILE_LOADDRIVE_C:
eDrive = FDD_DRIVE::C;
break;
case ID_FILE_LOADDRIVE_D:
eDrive = FDD_DRIVE::D;
break;
default:
return;
}
if (m_pBoard && eDrive != FDD_DRIVE::NONE)
{
int nDrive = g_Config.GetDriveNum(eDrive);
if (m_pBoard->GetFDD()->IsAttached(eDrive)) {
acts[0]->setText(tr("Unload Drive ") + CString('A' + id) + ":");
dynamic_cast<QLabel *>(dynamic_cast<QWidgetAction *>(acts[1])->defaultWidget())->
setText(g_Config.GetShortDriveImgName( g_Config.m_strFDDrives[nDrive]));
disconnect(acts[0],&QAction::triggered, this, nullptr);
connect(acts[0],&QAction::triggered, this, [=](){ CMainFrame::OnFileUnmount(id); });
} else {
acts[0]->setText(tr("Load Drive ") + CString('A' + id) + ":");
dynamic_cast<QLabel *>(dynamic_cast<QWidgetAction *>(acts[1])->defaultWidget())->setText(g_strEmptyUnit);
disconnect(acts[0],&QAction::triggered, this, nullptr);
connect(acts[0],&QAction::triggered, this, [=](){ CMainFrame::OnFileLoadDrive(id); });
}
}
}
void CMainFrame::CreateMenu()
{
QMenu *menu;
QMenu *menu1;
QAction *act;
QPixmap tbMainImg(":toolBar/main");
QPixmap tbMenu1Img(":toolBar/menu1");
QPixmap tbDbgImg(":toolBar/dbg");
QPixmap tbSndImg(":toolBar/snd");
QPixmap tbFDDImg(":toolBar/FDD");
QToolBar *tb;
QVariant UpdateAction;
menuBar()->clear();
QList<QToolBar *> allToolBars = findChildren<QToolBar *>();
foreach(QToolBar *_tb, allToolBars) {
if(_tb == &m_paneTapeCtrlView)
continue;
// This does not delete the tool bar.
removeToolBar(_tb);
_tb->clear();
}
tb = addToolBar(tr("Main"));
connect(tb, &QToolBar::actionTriggered, this, &CMainFrame::OnToolbarActionTriggered);
// POPUP "&Файл"
menu = menuBar()->addMenu(tr("File"));
connect(menu, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
// MENUITEM "&Загрузить состояние...", ID_FILE_LOADSTATE
act = new QAction(makeIcon(0, tbMainImg), QString(tr("Load state...")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnFileLoadstate);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "&Сохранить состояние...", ID_FILE_SAVESTATE
act = new QAction(makeIcon(1, tbMainImg), QString(tr("Save state...")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnFileSavestate);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "Загрузить &ленту...", ID_FILE_LOADTAPE
act = new QAction(makeIcon(2, tbMainImg), QString(tr("Load tape...")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateFileLoadtape)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnFileLoadtape);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "С&криншот", ID_FILE_SCREENSHOT
QAction *aScrshot = act = new QAction(makeIcon(16, tbMainImg), QString(tr("Screenshot")), this);
// connect(act, &QAction::triggered, this, &CMainFrame::OnFileScreenshot);
menu->addAction(act);
// MENUITEM SEPARATOR
menu->addSeparator();
// MENUITEM "&Печать...", ID_FILE_CUSTOM_PRINT
QAction * aPrint = act = new QAction(makeIcon(15, tbMainImg), QString(tr("Print...")), this);
// connect(act, &QAction::triggered, this, &CMainFrame::OnFile);
menu->addAction(act);
// MENUITEM "Нас&тройка печати...", ID_FILE_PRINT_SETUP
act = new QAction(QString(tr("Print setup...")), this);
// connect(act, &QAction::triggered, this, &CMainFrame::OnFileScreenshot);
menu->addAction(act);
menu1 = menu->addMenu(tr("Language"));
act = new QAction(QString(tr("English")));
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateFileSetLanguage, LANG_EN)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=]() {OnFileSetLanguage(LANG_EN);});
act->setCheckable(true);
menu1->addAction(act);
act = new QAction(QString(tr("Russian (русский)")));
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateFileSetLanguage, LANG_RU)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=]() {OnFileSetLanguage(LANG_RU);});
act->setCheckable(true);
menu1->addAction(act);
// MENUITEM SEPARATOR
menu->addSeparator();
// MENUITEM "В&ыход", ID_APP_EXIT
act = new QAction(QString(tr("Exit")), this);
connect(act, &QAction::triggered, this, &CMainFrame::close);
menu->addAction(act);
// ===================================================================================
// POPUP "&Конфигурация"
menu = menuBar()->addMenu(tr("Configuration"));
connect(menu, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
tb->addSeparator();
// MENUITEM "&Рестарт БК", ID_CPU_RESETCPU
act = new QAction(makeIcon(3, tbMainImg), QString("Restart"), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuResetCpu);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "СУ+Рестарт БК", ID_CPU_SURESETCPU
act = new QAction(QString(tr("SU+Restart")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuSuResetCpu);
menu->addAction(act);
// MENUITEM "&Длинный рестарт БК", ID_CPU_LONGRESET
act = new QAction(QString(tr("Long restart")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuLongReset);
menu->addAction(act);
act = new QAction(QString(tr("Power cycle")), this);
connect(act, &QAction::triggered, this, [=]{ SetupConfiguration(g_Config.GetBKModel()); });
menu->addAction(act);
// MENUITEM SEPARATOR
menu->addSeparator();
QActionGroup *ag = new QActionGroup(this);
// MENUITEM "Старт БК0010-01", ID_CPU_RUNBK001001
act = new QAction(QString(tr("Start BK0010-01")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk001001)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0010-01 + блок Фокал-МСТД", ID_CPU_RUNBK001001_FOCAL
act = new QAction(QString(tr("Start BK0010-01 + Focal-MSTD block")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk001001Focal)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001Focal);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0010-01 + доп. 32кб ОЗУ", ID_CPU_RUNBK001001_32K
act = new QAction(QString(tr("Start BK0010-01 + 32K extra RAM")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk00100132k)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk00100132k);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0010-01 + стандартный КНГМД", ID_CPU_RUNBK001001_FDD
act = new QAction(QString(tr("Start BK0010-01 + Standard FDD")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk001001Fdd)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001Fdd);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0010-01 + контроллер A16M", ID_CPU_RUNBK001001_FDD16K
act = new QAction(QString(tr("Start BK0010-01 + A16M controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk001001Fdd16k)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001Fdd16k);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0010-01 + контроллер СМК-512", ID_CPU_RUNBK001001_FDD_SMK512
act = new QAction(QString(tr("Start BK0010-01 + СМК-512 controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk001001FddSmk512)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001FddSmk512);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0010-01 + контроллер Samara", ID_CPU_RUNBK001001_FDD_SAMARA
act = new QAction(QString(tr("Start BK0010-01 + Samara controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk001001FddSamara)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001FddSamara);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011 + МСТД", ID_CPU_RUNBK0011
act = new QAction(QString(tr("Start БК0011 + MSTD")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011 + стандартный КНГМД", ID_CPU_RUNBK0011_FDD
act = new QAction(QString(tr("Start BK0011 + standard FDD")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011Fdd)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011Fdd);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011 + контроллер А16М", ID_CPU_RUNBK0011_FDD_A16M
act = new QAction(QString(tr("Start BK0011 + А16М controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011FddA16m)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011FddA16m);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011 + контроллер СМК-512", ID_CPU_RUNBK0011_FDD_SMK512
act = new QAction(QString(tr("Start BK0011 + СМК-512 controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011FddSmk512)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011FddSmk512);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011 + контроллер Samara", ID_CPU_RUNBK0011_FDD_SAMARA
act = new QAction(QString(tr("Start BK0011 + Samara controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011FddSamara)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011FddSamara);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011М + МСТД", ID_CPU_RUNBK0011M
act = new QAction(QString(tr("Start BK0011М + MSTD")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011m)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011m);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011М + стандартный КНГМД", ID_CPU_RUNBK0011M_FDD
act = new QAction(QString(tr("Start BK0011М + Standard FDD")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011mFDD)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011mFDD);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011М + контроллер A16M", ID_CPU_RUNBK0011M_FDD_A16M
act = new QAction(QString(tr("Start BK0011М + A16M controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011mFddA16m)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011mFddA16m);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011М + контроллер СМК-512", ID_CPU_RUNBK0011M_FDD_SMK512
act = new QAction(QString(tr("Start BK0011М + CMK-512 controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011mFddSmk512)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011mFddSmk512);
ag->addAction(act);
menu->addAction(act);
// MENUITEM "Старт БК0011М + контроллер Samara", ID_CPU_RUNBK0011M_FDD_SAMARA
act = new QAction(QString(tr("Start BK0011M + Samara controller")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateCpuRunbk0011mFddSamara)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk0011mFddSamara);
ag->addAction(act);
menu->addAction(act);
// MENUITEM SEPARATOR
menu->addSeparator();
act = new QAction(QString(tr("Pause CPU after start")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugPauseCpuAfterStart)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugPauseCpuAfterStart);
menu->addAction(act);
// MENUITEM "&Ускорить", ID_CPU_ACCELERATE
act = new QAction(makeIcon(4, tbMainImg), QString(tr("Speed Up")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuAccelerate);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "&Замедлить", ID_CPU_SLOWDOWN
act = new QAction(makeIcon(5, tbMainImg), QString(tr("Speed Down")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuSlowdown);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "&Стандартная скорость", ID_CPU_NORMALSPEED
act = new QAction(makeIcon(6, tbMainImg), QString(tr("Normal speed")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuNormalspeed);
menu->addAction(act);
tb->addAction(act);
// ==============================================================================================
// POPUP "&Вид"
menu = menuBar()->addMenu(tr("View"));
connect(menu, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
tb->addSeparator();
// MENUITEM "&Строка состояния", ID_VIEW_STATUS_BAR
act = new QAction(QString(tr("Status bar")), this);
act->setCheckable(true);
act->setChecked(!statusBar()->isHidden());
connect(act, &QAction::triggered, this, &CMainFrame::ToggleStatusBar);
menu->addAction(act);
// POPUP "Виртуальная &клавиатура"
menu1 = menu->addMenu(tr("Virtual keyboard"));
// connect(menu1, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
ag = new QActionGroup(this);
// MENUITEM "&Кнопочная", ID_VKBDTYPE_KEYS
// m_pActions_Keybd_type[IDB_BITMAP_SOFT] =
act = new QAction(QString(tr("Buttons")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateVkbdtypeKeys, IDB_BITMAP_SOFT)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ m_paneBKVKBDView->SetKeyboardView(IDB_BITMAP_SOFT); m_paneBKVKBDView->show(); } );
ag->addAction(act);
menu1->addAction(act);
// MENUITEM "&Плёночная", ID_VKBDTYPE_MEMBRANE
// m_pActions_Keybd_type[IDB_BITMAP_PLEN] =
act = new QAction(QString(tr("Membrane")), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, [=](){ m_paneBKVKBDView->SetKeyboardView(IDB_BITMAP_PLEN); m_paneBKVKBDView->show(); } );
ag->addAction(act);
menu1->addAction(act);
#if 0
// POPUP "Установить размер экрана"
menu1 = menu->addMenu(tr("Установить размер экрана"));
ag = new QActionGroup(this);
// MENUITEM "256 x 192 (x0.5)", ID_VIEW_SCREENSIZE_256X192
// m_pActions_ScreenSize[static_cast<int>(ScreenSizeNumber::SCREENSIZE_256X192)] =
act = new QAction(QString("256 x 192 (x0.5)"), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu1->addAction(act);
// MENUITEM "324 x 243", ID_VIEW_SCREENSIZE_324X243
// m_pActions_ScreenSize[static_cast<int>(ScreenSizeNumber::SCREENSIZE_324X243)] =
act = new QAction(QString("324 x 243"), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu1->addAction(act);
// MENUITEM "432 x 324", ID_VIEW_SCREENSIZE_432X324
// m_pActions_ScreenSize[static_cast<int>(ScreenSizeNumber::SCREENSIZE_432X324)] =
act = new QAction(QString("432 x 324"), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu1->addAction(act);
// MENUITEM "512 х 384 (x1)", ID_VIEW_SCREENSIZE_512X384
// m_pActions_ScreenSize[static_cast<int>(ScreenSizeNumber::SCREENSIZE_512X384)] =
act = new QAction(QString("512 х 384 (x1)"), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu1->addAction(act);
// MENUITEM "576 x 432", ID_VIEW_SCREENSIZE_576X432
// m_pActions_ScreenSize[static_cast<int>(ScreenSizeNumber::SCREENSIZE_576X432)] =
act = new QAction(QString("576 x 432"), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu1->addAction(act);
// MENUITEM "768 x 576 (x1.5)", ID_VIEW_SCREENSIZE_768X576
// m_pActions_ScreenSize[static_cast<int>(ScreenSizeNumber::SCREENSIZE_768X576)] =
act = new QAction(QString("768 x 576 (x1.5)"), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu1->addAction(act);
// MENUITEM "1024 x 768 (x2)", ID_VIEW_SCREENSIZE_1024X768
// m_pActions_ScreenSize[static_cast<int>(ScreenSizeNumber::SCREENSIZE_1024X768)] =
act = new QAction(QString("1024 x 768 (x2)"), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu1->addAction(act);
// MENUITEM "Свой", ID_VIEW_SCREENSIZE_CUSTOM
// m_pActions_ScreenSize[static_cast<int>(ScreenSizeNumber::SCREENSIZE_CUSTOM)] =
act = new QAction(QString("Свой"), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnCpuRunbk001001);
ag->addAction(act);
menu1->addAction(act);
#endif
// MENUITEM SEPARATOR
menu->addSeparator();
// MENUITEM "Сг&лаживание", ID_VIEW_SMOOTHING
act = new QAction(makeIcon(10, tbMainImg), QString(tr("Smoothing")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateViewSmoothing)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnViewSmoothing);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "Во весь &экран", ID_VIEW_FULLSCREENMODE
act = new QAction(makeIcon(7, tbMainImg), QString(tr("Full screen")), this);
act->setCheckable(true);
connect(act, &QAction::triggered, this, &CMainFrame::OnViewFullscreenmode);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "&Цветной режим", ID_VIEW_COLORMODE
// m_Action_ViewColormode =
act = new QAction(makeIcon(8, tbMainImg), QString(tr("Color mode")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateViewColormode)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnViewColormode);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "&Адаптивный Ч/Б режим", ID_VIEW_ADAPTIVEBWMODE
// m_Action_ViewAdaptivebwmode =
act = new QAction(makeIcon(9, tbMainImg), QString(tr("Adaptive B/W mode")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateViewAdaptivebwmode)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnViewAdaptivebwmode);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "&Эмуляция затухания люминофора", ID_VIEW_LUMINOFOREMODE
// m_Action_ViewLuminoforemode =
act = new QAction(QString(tr("Luminofor fade emulation")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateViewLuminoforemode)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnViewLuminoforemode);
menu->addAction(act);
tb->addSeparator();
// act = new QAction(makeIcon(11, tbMainImg), QString("&Load Drive A:"), this);
// UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateFileLoadDrive, 0)); act->setData(UpdateAction);
// connect(act,&QAction::triggered, this, [=](){ CMainFrame::OnFileLoadDrive(0); });
// tb->addAction(act);
for(int i=0; i<4; i++) {
QToolButton *FDDButton;
QMenu *FddDropDownMenu;
QWidgetAction *wact;
QLabel *lact;
FDDButton = m_ToolbarFDDButton[i] = new QToolButton(this);
FDDButton->setIcon(makeIcon(4 + i, tbFDDImg));
FDDButton->setPopupMode(QToolButton::InstantPopup);
FddDropDownMenu = new QMenu(FDDButton);
connect(FddDropDownMenu, &QMenu::aboutToShow, this, &CMainFrame::OnShowFddPopupMenu);
act = new QAction(FddDropDownMenu);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateFileLoadDrive, i)); act->setData(UpdateAction);
FddDropDownMenu->addAction(act);
wact = new QWidgetAction(FddDropDownMenu);
lact = new QLabel("", FddDropDownMenu);
lact->setAlignment(Qt::AlignCenter);
lact->setMinimumHeight(FddDropDownMenu->height()-1);
wact->setDefaultWidget(lact);
FddDropDownMenu->addAction(wact);
FDDButton->setMenu(FddDropDownMenu);
act = tb->addWidget(FDDButton);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateFileLoadDrive, i)); act->setData(UpdateAction);
}
act = new QAction(makeIcon(20, tbMainImg), QString(tr("Load HDD Master")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateFileLoadDrive, 4)); act->setData(UpdateAction);
connect(act,&QAction::triggered, this, [=](){ CMainFrame::OnFileLoadDrive(4); });
tb->addAction(act);
act = new QAction(makeIcon(20, tbMainImg), QString(tr("Load HDD Slave")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateFileLoadDrive, 5)); act->setData(UpdateAction);
connect(act,&QAction::triggered, this, [=](){ CMainFrame::OnFileLoadDrive(5); });
tb->addAction(act);
tb->addSeparator();
act = new QAction(makeIcon(19, tbMainImg), QString(tr("Load Bin")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnLoadBinFile);
tb->addAction(act);
tb->addSeparator();
tb->addAction(aScrshot);
tb->addAction(aPrint);
tb = addToolBar(tr("Debug"));
connect(tb, &QToolBar::actionTriggered, this, &CMainFrame::OnToolbarActionTriggered);
m_Action_DebugStop_Stop = makeIcon(0, tbDbgImg);
m_Action_DebugStop_Start = makeIcon(0, tbMenu1Img);
menu = menuBar()->addMenu(tr("Debug"));
connect(menu, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
m_Action_DebugStop = act = new QAction(m_Action_DebugStop_Stop, QString(tr("Stop")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugBreak)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugBreak);
tb->addAction(act);
menu->addAction(act);
menu->addSeparator();
act = new QAction(makeIcon(1, tbDbgImg), QString(tr("Step In")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugStepinto);
tb->addAction(act);
menu->addAction(act);
act = new QAction(makeIcon(2, tbDbgImg), QString(tr("Step Over")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugStepover);
tb->addAction(act);
menu->addAction(act);
act = new QAction(makeIcon(3, tbDbgImg), QString(tr("Step Out")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugStepout);
tb->addAction(act);
menu->addAction(act);
// act = new QAction(makeIcon(4, tbDbgImg), QString(tr("Выполнить до с&троки")), this);
// connect(act, &QAction::triggered, this, &CMainFrame::OnDebugRuntocursor);
// tb->addAction(act);
// menu->addAction(act);
// "Карта памяти"
act = new QAction(makeIcon(6, tbDbgImg), QString(tr("Memory map")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugMemmap);
// tb->addAction(act);
menu->addAction(act);
act = new QAction(QString(tr("Stop on System Interrupt")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateBreakOnSysInterrupt)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnBreakOnSysInterrupt);
menu->addAction(act);
act = new QAction(QString(tr("Stop on User Interrupt")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateBreakOnUserInterrupt)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnBreakOnUserInterrupt);
menu->addAction(act);
menu->addSeparator();
// POPUP "Интервал обновления дампа регистров"
menu1 = menu->addMenu(tr("Registry Dump Update Interval"));
connect(menu1, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
ag = new QActionGroup(this);
// MENUITEM "Нет", ID_DEBUG_DUMPREGS_INTERVAL_0
act = new QAction(QString(tr("No autoupdate")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 0)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(0); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("1"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 1)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(1); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("2"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 2)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(2); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("3"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 3)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(3); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("4"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 4)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(4); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("5"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 5)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(5); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("10"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 10)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(10); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("15"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 15)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(15); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("20"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 20)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(20); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("25"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 25)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(25); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString("50"), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateDebugDumpregsInterval, 50)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnDebugDumpregsInterval(50); } );
ag->addAction(act);
menu1->addAction(act);
act = new QAction(QString(tr("Auto Screen Update")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateScreenUpdateInterval)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ OnSetScreenUpdateInterval( g_Config.m_nScreenAutoUpdateInterval ? 0 : 20); } );
menu->addAction(act);
// act = new QAction(makeIcon(5, tbDbgImg), QString("Set Breakpoint"), this);
// connect(act, &QAction::triggered, this, &CMainFrame::OnCpuResetCpu);
// tb->addAction(act);
// "Инструменты"
menu = menuBar()->addMenu(tr("Tools"));
connect(menu, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
// "Дамп регистров"
act = new QAction(QString(tr("Registry dump")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnMenuUpdateRegistryDumpView)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ m_paneRegistryDumpViewCPU->Toggle(); } );
menu->addAction(act);
// "Дамп памяти"
act = new QAction(QString(tr("Memory dump")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnMenuUpdateMemDumpView)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ m_paneMemoryDumpView->Toggle(); } );
menu->addAction(act);
// "Дизассемблер"
act = new QAction(QString(tr("Disassembler")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnMenuUpdateDisasmView)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ m_paneDisassembleView->Toggle(); } );
menu->addAction(act);
// "Дамп стека"
act = new QAction(QString(tr("Stack dump")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnMenuUpdateStackView)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ m_paneStackView->Toggle(); } );
menu->addAction(act);
act = new QAction(QString(tr("Breakpoints")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnMenuUpdateBreakPointView)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ m_paneBreakPointView->Toggle(); } );
menu->addAction(act);
act = new QAction(QString(tr("Symbol Table")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnMenuUpdateSymbolTableView)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ m_paneSymbolTableView->Toggle(); } );
menu->addAction(act);
act = new QAction(QString(tr("Watchpoint Table")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnMenuUpdateWatchpointView)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, [=](){ m_paneWatchPointView->Toggle(); } );
menu->addAction(act);
menu->addSeparator();
act = new QAction(QString(tr("Save Disassembled Area")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnSaveDisasm);
menu->addAction(act);
menu1 = menu->addMenu(tr("Load tools"));
act = new QAction(QString(tr("Load Symbol Table")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnLoadSymbolTable);
menu1->addAction(act);
act = new QAction(QString(tr("Load Breakpoints")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnLoadBreakpoints);
menu1->addAction(act);
act = new QAction(QString(tr("Load Watchpoints")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnLoadWatchpoints);
menu1->addAction(act);
act = new QAction(QString(tr("Load Memory Region")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnLoadMemoryRegion);
menu1->addAction(act);
menu1 = menu->addMenu(tr("Save tools"));
act = new QAction(QString(tr("Save Symbol Table")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnSaveSymbolTable);
menu1->addAction(act);
act = new QAction(QString(tr("Save Breakpoints")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnSaveBreakpoints);
menu1->addAction(act);
act = new QAction(QString(tr("Save Watchpoints")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnSaveWatchpoints);
menu1->addAction(act);
act = new QAction(QString(tr("Save Memory Region")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnSaveMemoryRegion);
menu1->addAction(act);
act = new QAction(QString(tr("Run Lua Script")), this);
connect(act,&QAction::triggered, this, &CMainFrame::OnRunLuaScript);
menu->addAction(act);
act = new QAction(QString(tr("Stop Lua Script")), this);
connect(act,&QAction::triggered, this, [=](){ m_LuaScript.StopThread(); });
menu->addAction(act);
// POPUP "&Опции"
menu = menuBar()->addMenu(tr("Options"));
connect(menu, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
tb = addToolBar(tr("Options"));
connect(tb, &QToolBar::actionTriggered, this, &CMainFrame::OnToolbarActionTriggered);
// MENUITEM "&Настройки эмулятора", ID_APP_SETTINGS
act = new QAction(QString(tr("Emulator settings")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugRuntocursor);
menu->addAction(act);
// MENUITEM "&Редактор Палитр", ID_OPTIONS_PALETTE
act = new QAction(QString(tr("Palitre editor")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugRuntocursor);
menu->addAction(act);
// MENUITEM "Редактор Джойстика", ID_OPTIONS_JOYEDIT
act = new QAction(QString(tr("Joystick editor")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnDebugRuntocursor);
menu->addAction(act);
// MENUITEM SEPARATOR
menu->addSeparator();
// MENUITEM "Включить Speaker", ID_OPTIONS_ENABLE_SPEAKER
act = new QAction(makeIcon(0,tbSndImg), QString(tr("Speaker On")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsEnableSpeaker)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsEnableSpeaker);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "Включить Covox", ID_OPTIONS_ENABLE_COVOX
act = new QAction(makeIcon(1,tbSndImg), QString(tr("Covox On")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsEnableCovox)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsEnableCovox);
act->setCheckable(true);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "Стерео Covox", ID_OPTIONS_STEREO_COVOX
act = new QAction(makeIcon(4,tbSndImg), QString(tr("Stereo Covox")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsStereoCovox)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsStereoCovox);
act->setCheckable(true);
menu->addAction(act);
// MENUITEM "Включить AY8910", ID_OPTIONS_ENABLE_AY8910
act = new QAction(makeIcon(2,tbSndImg), QString(tr("AY8910 On")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsEnableAy8910)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsEnableAy8910);
act->setCheckable(true);
menu->addAction(act);
tb->addAction(act);
// MENUITEM "Включить Менестрель", ID_OPTIONS_ENABLE_AY8910
act = new QAction(makeIcon(3,tbSndImg), QString(tr("Menestrel On")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsEnableMenestrel)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsEnableMenestrel);
act->setCheckable(true);
menu->addAction(act);
tb->addAction(act);
m_pVolumeSlider = new QSlider(Qt::Horizontal,this);
// "Громкость"
m_pVolumeSlider->setToolTip(tr("Volume"));
m_pVolumeSlider->setRange(0, 65535);
m_pVolumeSlider->setMaximumWidth(100);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsVolumeSlider)); act->setData(UpdateAction);
connect(m_pVolumeSlider, &QSlider::valueChanged, this, &CMainFrame::OnLVolumeSlider);
act = tb->addWidget(m_pVolumeSlider);
// MENUITEM tr("Дамп регистров A&Y8910"), ID_OPTIONS_LOG_AY8910
act = new QAction(makeIcon(10,tbSndImg), QString(tr("AY8910 registry dump")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsLogAy8910);
menu->addAction(act);
// MENUITEM "Параметры AY8910", ID_OPTIONS_AYVOLPAN
act = new QAction(makeIcon(9,tbSndImg), QString(tr("AY8910 options")), this);
connect(act, &QAction::triggered, this, &CMainFrame::OnSettAyvolpan);
menu->addAction(act);
// POPUP "Фильтры"
menu1 = menu->addMenu(tr("Filters"));
// connect(menu1, &QMenu::aboutToShow, this, &CMainFrame::OnMenuAboutToShow);
// MENUITEM "Speaker", ID_OPTIONS_SPEAKER_FILTER
act = new QAction(makeIcon(5,tbSndImg), QString(tr("Speaker")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsSpeakerFilter)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsSpeakerFilter);
menu1->addAction(act);
// MENUITEM "Covox", ID_OPTIONS_COVOX_FILTER
act = new QAction(makeIcon(6,tbSndImg), QString(tr("Covox")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsCovoxFilter)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsCovoxFilter);
menu1->addAction(act);
// MENUITEM "AY8910", ID_OPTIONS_AY8910_FILTER
act = new QAction(makeIcon(7,tbSndImg), QString(tr("AY8910")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsAy8910Filter)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsAy8910Filter);
menu1->addAction(act);
// MENUITEM "Menestrel", ID_OPTIONS_AY8910_FILTER
act = new QAction(makeIcon(8,tbSndImg), QString(tr("Menestrel")), this);
act->setCheckable(true);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsMenestrelFilter)); act->setData(UpdateAction);
connect(act, &QAction::triggered, this, &CMainFrame::OnOptionsMenestrelFilter);
menu1->addAction(act);
// MENUITEM SEPARATOR
menu->addSeparator();
// MENUITEM "Эмулировать клавиатуру БК", ID_OPTIONS_EMULATE_BKKEYBOARD
act = new QAction(QString(tr("Emulate BK keyboard")), this);
UpdateAction.setValue(UpdateFunc(&CMainFrame::OnUpdateOptionsEmulateBkkeyboard)); act->setData(UpdateAction);