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"
20 extern config_t config;
22 Object_Menu_Control_88::Object_Menu_Control_88(QObject *parent, USING_FLAGS *p) : Object_Menu_Control(parent, p)
26 Object_Menu_Control_88::~Object_Menu_Control_88()
32 void Object_Menu_Control_88::do_set_memory_wait(bool flag)
34 emit sig_set_dipsw(0, flag);
38 Action_Control_88::Action_Control_88(QObject *parent, USING_FLAGS *p) : Action_Control(parent, p)
40 pc88_binds = new Object_Menu_Control_88(parent, p);
41 pc88_binds->setValue1(0);
44 Action_Control_88::~Action_Control_88()
49 void META_MainWindow::retranslateVolumeLabels(Ui_SoundDialog *p)
52 p->setDeviceLabel(1, QApplication::translate("MainWindow", "CMT", 0));
53 switch(config_sound_device_type) {
55 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPNA", 0));
56 p->setSliderVisible(2, true);
57 p->setSliderVisible(3, false);
60 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPN", 0));
61 p->setSliderVisible(2, true);
62 p->setSliderVisible(3, false);
64 #ifdef SUPPORT_PC88_SB2
66 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPN", 0));
67 p->setDeviceLabel(3, QApplication::translate("MainWindow", "OPNA", 0));
68 p->setSliderVisible(2, true);
69 p->setSliderVisible(3, true);
72 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPN-1", 0));
73 p->setDeviceLabel(3, QApplication::translate("MainWindow", "OPN-2", 0));
74 p->setSliderVisible(2, true);
75 p->setSliderVisible(3, true);
78 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPNA-1", 0));
79 p->setDeviceLabel(3, QApplication::translate("MainWindow", "OPNA-2", 0));
80 p->setSliderVisible(2, true);
81 p->setSliderVisible(3, true);
84 p->setDeviceLabel(2, QApplication::translate("MainWindow", "OPNA", 0));
85 p->setDeviceLabel(3, QApplication::translate("MainWindow", "OPN", 0));
86 p->setSliderVisible(2, true);
87 p->setSliderVisible(3, true);
95 void META_MainWindow::retranslateUi(void)
98 retranslateControlMenu(title, false);
99 retranslateFloppyMenu(0, 1);
100 retranslateFloppyMenu(1, 2);
101 retranslateCMTMenu(0);
102 retranslateSoundMenu();
103 retranslateScreenMenu();
104 retranslateMachineMenu();
105 retranslateEmulatorMenu();
106 retranslateUI_Help();
107 config_sound_device_type = config.sound_type;
109 this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
112 #if defined(_PC8801MA)
113 menuCpuType->setTitle("CPU Frequency");
114 actionCpuType[0]->setText(QString::fromUtf8("8MHz"));
115 actionCpuType[1]->setText(QString::fromUtf8("4MHz"));
116 actionCpuType[2]->setText(QString::fromUtf8("8MHz (FE2/MC)"));
118 menuCpuType->setTitle("CPU Frequency");
119 actionCpuType[0]->setText(QString::fromUtf8("4MHz"));
120 //menuCpuType->setVisible(false);
121 //actionCpuType[0]->setVisible(false);
124 #if defined(_PC8801MA)
125 menuBootMode->setTitle("Machine Mode");
126 menuBootMode->setToolTipsVisible(true);
127 actionBootMode[0]->setText(QString::fromUtf8("N88-V1(S) Mode"));
128 actionBootMode[1]->setText(QString::fromUtf8("N88-V1(H) Mode"));
129 actionBootMode[2]->setText(QString::fromUtf8("N88-V2 Mode"));
130 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
131 actionBootMode[0]->setToolTip(QApplication::translate("MainWindow", "V1(Standard) Mode.\nYou can run softwares of PC-8801/mk2.", 0));
132 actionBootMode[1]->setToolTip(QApplication::translate("MainWindow", "V1(High Speed) Mode.\nYou can run softwares of PC-8801/mk2 faster.", 0));
133 actionBootMode[2]->setToolTip(QApplication::translate("MainWindow", "V2 Mode.\nYou can run only softwares for PC-8801SR or later.", 0));
134 actionBootMode[3]->setToolTip(QApplication::translate("MainWindow", "N Mode.\nYou can run softwares of PC-8001/mk2.", 0));
135 #elif defined(_PC8001SR)
136 menuBootMode->setTitle("Machine Mode");
137 menuBootMode->setToolTipsVisible(true);
138 actionBootMode[0]->setText(QString::fromUtf8("N80-V1 Mode"));
139 actionBootMode[1]->setText(QString::fromUtf8("N80-V2(SR) Mode"));
140 actionBootMode[2]->setText(QString::fromUtf8("N Mode"));
141 actionBootMode[0]->setToolTip(QApplication::translate("MainWindow", "V1 Mode.\nYou can run softwares of PC-8001/mk2.", 0));
142 actionBootMode[1]->setToolTip(QApplication::translate("MainWindow", "V2 Mode.\nYou can run only softwares for PC-8001mk2SR or later.", 0));
143 actionBootMode[2]->setToolTip(QApplication::translate("MainWindow", "N Mode.\nYou can run only softwares for PC-8001.", 0));
146 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Boards", 0));
147 #if defined(SUPPORT_PC88_SB2)
148 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Board", 0));
149 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
150 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
151 actionSoundDevice[2]->setText(QString::fromUtf8("Sound Board 2 (OPN + OPNA)"));
152 actionSoundDevice[3]->setText(QString::fromUtf8("Sound Board 2(OPN + OPN)"));
153 actionSoundDevice[4]->setText(QString::fromUtf8("Sound Board 2 (OPNA + OPNA)"));
154 actionSoundDevice[5]->setText(QString::fromUtf8("Sound Board 2 (OPNA + OPN)"));
155 actionSoundDevice[0]->setToolTip(QApplication::translate("MainWindow", "PC-8801-23 (OPNA).", 0));
156 actionSoundDevice[1]->setToolTip(QApplication::translate("MainWindow", "PC-8801-11 (OPN).", 0));
157 actionSoundDevice[2]->setToolTip(QApplication::translate("MainWindow", "Sound Board 2 (OPN + OPNA).", 0));
158 actionSoundDevice[3]->setToolTip(QApplication::translate("MainWindow", "Sound Board 2 (OPN + OPN).", 0));
159 actionSoundDevice[4]->setToolTip(QApplication::translate("MainWindow", "Sound Board 2 (OPNA + OPNA).", 0));
160 actionSoundDevice[5]->setToolTip(QApplication::translate("MainWindow", "Sound Board 2 (OPNA + OPN).", 0));
161 #elif defined(SUPPORT_PC88_OPNA)
162 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Board", 0));
163 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
164 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
165 actionSoundDevice[0]->setToolTip(QApplication::translate("MainWindow", "PC-8801-23 (OPNA).", 0));
166 actionSoundDevice[1]->setToolTip(QApplication::translate("MainWindow", "PC-8801-11 (OPN).", 0));
169 actionDebugger[0]->setText(QApplication::translate("MainWindow", "Main CPU", 0));
170 #if defined(_PC8001SR)
171 actionDebugger[1]->setText(QApplication::translate("MainWindow", "PC-80S31K CPU", 0));
173 actionDebugger[1]->setText(QApplication::translate("MainWindow", "Sub CPU", 0));
175 actionDebugger[0]->setVisible(true);
176 actionDebugger[1]->setVisible(true);
178 actionDebugger[2]->setVisible(false);
179 actionDebugger[3]->setVisible(false);
181 #if defined(USE_JOYSTICK_TYPE)
182 actionJoystickType[0]->setText(QApplication::translate("MainWindow", "Joystick", 0));
183 actionJoystickType[1]->setText(QApplication::translate("MainWindow", "Bus Mouse", 0));
184 actionJoystickType[0]->setToolTip(QApplication::translate("MainWindow", "Connect joystick to JOY PORT.", 0));
185 actionJoystickType[1]->setToolTip(QApplication::translate("MainWindow", "Connect bus-mouse to JOY PORT.", 0));
186 menuJoystickType->setTitle(QApplication::translate("MainWindow", "Joy Port", 0));
188 #if defined(USE_PRINTER)
189 actionPrintDevice[1]->setText(QString::fromUtf8("PC-PR201"));
190 actionPrintDevice[1]->setToolTip(QApplication::translate("MainWindow", "NEC PC-PR201 kanji serial printer.", 0));
192 actionMemoryWait->setText(QApplication::translate("MainWindow", "Wait Memory", 0));
193 actionMemoryWait->setToolTip(QApplication::translate("MainWindow", "Simulate waiting memory.", 0));
200 void META_MainWindow::setupUI_Emu(void)
202 menuCpuType = new QMenu(menuMachine);
203 menuCpuType->setObjectName(QString::fromUtf8("menuControl_CpuType"));
204 #if defined(_PC8801MA)
209 menuMachine->addAction(menuCpuType->menuAction());
211 menuBootMode = new QMenu(menuMachine);
212 menuBootMode->setObjectName(QString::fromUtf8("menuControl_BootMode"));
213 menuMachine->addAction(menuBootMode->menuAction());
214 #if defined(_PC8801MA)
215 ConfigCPUBootMode(4);
216 #elif defined(_PC8001SR)
217 ConfigCPUBootMode(3);
219 actionMemoryWait = new Action_Control_88(this, using_flags);
220 actionMemoryWait->setCheckable(true);
221 actionMemoryWait->setVisible(true);
222 actionMemoryWait->setChecked(false);
224 menuMachine->addAction(actionMemoryWait);
225 if((config.dipswitch & 0x0001) != 0) actionMemoryWait->setChecked(true);
226 connect(actionMemoryWait, SIGNAL(toggled(bool)),
227 actionMemoryWait->pc88_binds, SLOT(do_set_memory_wait(bool)));
228 connect(actionMemoryWait->pc88_binds, SIGNAL(sig_set_dipsw(int, bool)),
229 this, SLOT(set_dipsw(int, bool)));
233 META_MainWindow::META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent) : Ui_MainWindow(p, logger, parent)
235 config_sound_device_type = 0;
241 META_MainWindow::~META_MainWindow()