2 * Common Source code Project:
3 * Ui->Qt->MainWindow for X1TurboZ .
4 * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
7 * Jan 14, 2015 : Initial, many of constructors were moved to qt/gui/menu_main.cpp.
12 #include "commonclasses.h"
13 #include "menuclasses.h"
16 #include "sound_dialog.h"
21 Object_Menu_Control_88::Object_Menu_Control_88(QObject *parent) : Object_Menu_Control(parent)
25 Object_Menu_Control_88::~Object_Menu_Control_88()
31 void Object_Menu_Control_88::do_set_memory_wait(bool flag)
33 emit sig_set_dipsw(0, flag);
37 Action_Control_88::Action_Control_88(QObject *parent) : Action_Control(parent)
39 pc88_binds = new Object_Menu_Control_88(parent);
40 pc88_binds->setValue1(0);
43 Action_Control_88::~Action_Control_88()
48 void META_MainWindow::retranslateVolumeLabels(Ui_SoundDialog *p)
51 p->setDeviceLabel(1, QApplication::translate("MainWindow", "CMT", 0));
52 switch(config_sound_device_type) {
54 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPNA", 0));
55 p->setSliderVisible(2, true);
56 p->setSliderVisible(3, false);
59 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPN", 0));
60 p->setSliderVisible(2, true);
61 p->setSliderVisible(3, false);
63 #ifdef SUPPORT_PC88_SB2
65 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPNA", 0));
66 p->setDeviceLabel(3, QApplication::translate("MainWindow", "OPN", 0));
67 p->setSliderVisible(2, true);
68 p->setSliderVisible(3, true);
76 void META_MainWindow::retranslateUi(void)
79 retranslateControlMenu(title, false);
80 retranslateFloppyMenu(0, 1);
81 retranslateFloppyMenu(1, 2);
83 retranslateSoundMenu();
84 retranslateScreenMenu();
85 retranslateMachineMenu();
87 config_sound_device_type = config.sound_device_type;
89 this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
91 actionCapture_Screen->setText(QApplication::translate("MainWindow", "Capture Screen", 0));
93 actionAbout->setText(QApplication::translate("MainWindow", "About...", 0));
96 // actionStart_Record_Movie->setText(QApplication::translate("MainWindow", "Start Record Movie", 0));
97 // actionStop_Record_Movie->setText(QApplication::translate("MainWindow", "Stop Record Movie", 0));
99 menuScreen->setTitle(QApplication::translate("MainWindow", "Screen", 0));
100 menuStretch_Mode->setTitle(QApplication::translate("MainWindow", "Stretch Mode", 0));
102 #if defined(_PC8801MA)
103 menuCpuType->setTitle("CPU Frequency");
104 actionCpuType[0]->setText(QString::fromUtf8("8MHz"));
105 actionCpuType[1]->setText(QString::fromUtf8("4MHz"));
106 actionCpuType[2]->setText(QString::fromUtf8("8MHz (FE2/MC)"));
108 menuCpuType->setTitle("CPU Frequency");
109 actionCpuType[0]->setText(QString::fromUtf8("4MHz"));
110 //menuCpuType->setVisible(false);
111 //actionCpuType[0]->setVisible(false);
114 #if defined(_PC8801MA)
115 menuBootMode->setTitle("Machine Mode");
116 actionBootMode[0]->setText(QString::fromUtf8("N88-V1(S) Mode"));
117 actionBootMode[1]->setText(QString::fromUtf8("N88-V1(H) Mode"));
118 actionBootMode[2]->setText(QString::fromUtf8("N88-V2 Mode"));
119 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
120 #elif defined(_PC8001SR)
121 menuBootMode->setTitle("Machine Mode");
122 actionBootMode[0]->setText(QString::fromUtf8("N80-V1 Mode"));
123 actionBootMode[1]->setText(QString::fromUtf8("N80-V2(SR) Mode"));
124 actionBootMode[2]->setText(QString::fromUtf8("N Mode"));
127 #if defined(SUPPORT_PC88_SB2)
128 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Board", 0));
129 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
130 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
131 actionSoundDevice[2]->setText(QString::fromUtf8("Sound Board 2 (OPN + OPNA)"));
132 #elif defined(SUPPORT_PC88_OPNA)
133 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Board", 0));
134 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
135 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
138 actionDebugger_1->setText(QApplication::translate("MainWindow", "Main CPU", 0));
139 actionDebugger_2->setText(QApplication::translate("MainWindow", "Sub CPU", 0));
140 actionDebugger_3->setVisible(false);
142 #if defined(USE_DEVICE_TYPE)
143 actionDeviceType[0]->setText(QApplication::translate("MainWindow", "Joystick", 0));
144 actionDeviceType[1]->setText(QApplication::translate("MainWindow", "Bus Mouse", 0));
145 menuDeviceType->setTitle(QApplication::translate("MainWindow", "Joy Port", 0));
147 actionMemoryWait->setText(QApplication::translate("MainWindow", "Wait Memory", 0));
150 // menuRecord->setTitle(QApplication::translate("MainWindow", "Record", 0));
151 // menuRecoad_as_movie->setTitle(QApplication::translate("MainWindow", "Recoad as movie", 0));
153 menuEmulator->setTitle(QApplication::translate("MainWindow", "Emulator", 0));
154 menuMachine->setTitle(QApplication::translate("MainWindow", "Machine", 0));
156 menuHELP->setTitle(QApplication::translate("MainWindow", "HELP", 0));
157 actionHelp_AboutQt->setText(QApplication::translate("MainWindow", "About Qt", 0));
163 void META_MainWindow::setupUI_Emu(void)
165 menuCpuType = new QMenu(menuMachine);
166 menuCpuType->setObjectName(QString::fromUtf8("menuControl_CpuType"));
167 #if defined(_PC8801MA)
172 menuMachine->addAction(menuCpuType->menuAction());
174 menuBootMode = new QMenu(menuMachine);
175 menuBootMode->setObjectName(QString::fromUtf8("menuControl_BootMode"));
176 menuMachine->addAction(menuBootMode->menuAction());
177 #if defined(_PC8801MA)
178 ConfigCPUBootMode(4);
179 #elif defined(_PC8001SR)
180 ConfigCPUBootMode(3);
182 actionMemoryWait = new Action_Control_88(this);
183 actionMemoryWait->setCheckable(true);
184 actionMemoryWait->setVisible(true);
185 actionMemoryWait->setChecked(false);
187 menuMachine->addAction(actionMemoryWait);
188 if((config.dipswitch & 0x0001) != 0) actionMemoryWait->setChecked(true);
189 connect(actionMemoryWait, SIGNAL(toggled(bool)),
190 actionMemoryWait->pc88_binds, SLOT(do_set_memory_wait(bool)));
191 connect(actionMemoryWait->pc88_binds, SIGNAL(sig_set_dipsw(int, bool)),
192 this, SLOT(set_dipsw(int, bool)));
196 META_MainWindow::META_MainWindow(QWidget *parent) : Ui_MainWindow(parent)
198 config_sound_device_type = 0;
204 META_MainWindow::~META_MainWindow()