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 <QApplication>
15 #include "commonclasses.h"
16 #include "menuclasses.h"
19 #include "sound_dialog.h"
23 extern config_t config;
25 Object_Menu_Control_88::Object_Menu_Control_88(QObject *parent, USING_FLAGS *p) : Object_Menu_Control(parent, p)
29 Object_Menu_Control_88::~Object_Menu_Control_88()
33 void Object_Menu_Control_88::do_set_display_mode(void)
35 emit sig_display_mode(getValue1());
39 void Object_Menu_Control_88::do_set_memory_wait(bool flag)
41 emit sig_set_dipsw(0, flag);
45 Action_Control_88::Action_Control_88(QObject *parent, USING_FLAGS *p) : Action_Control(parent, p)
47 pc88_binds = new Object_Menu_Control_88(parent, p);
48 pc88_binds->setValue1(0);
51 Action_Control_88::~Action_Control_88()
56 void META_MainWindow::retranslateVolumeLabels(Ui_SoundDialog *p)
59 p->setDeviceLabel(1, QApplication::translate("MenuPC88", "CMT", 0));
60 switch(config_sound_device_type) {
62 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA", 0));
63 p->setSliderVisible(2, true);
64 p->setSliderVisible(3, false);
67 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN", 0));
68 p->setSliderVisible(2, true);
69 p->setSliderVisible(3, false);
71 #ifdef SUPPORT_PC88_SB2
73 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN", 0));
74 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPNA", 0));
75 p->setSliderVisible(2, true);
76 p->setSliderVisible(3, true);
79 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN-1", 0));
80 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPN-2", 0));
81 p->setSliderVisible(2, true);
82 p->setSliderVisible(3, true);
85 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA-1", 0));
86 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPNA-2", 0));
87 p->setSliderVisible(2, true);
88 p->setSliderVisible(3, true);
91 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA", 0));
92 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPN", 0));
93 p->setSliderVisible(2, true);
94 p->setSliderVisible(3, true);
102 void META_MainWindow::retranslateUi(void)
104 const char *title="";
105 Ui_MainWindowBase::retranslateUi();
106 retranslateControlMenu(title, false);
107 config_sound_device_type = config.sound_type;
109 this->setWindowTitle(QApplication::translate("MenuPC88", "MainWindow", 0));
112 menuCpuType->setTitle(QApplication::translate("MenuPC88", "CPU Frequency", 0));
113 #if defined(_PC8801MA)
114 actionCpuType[0]->setText(QString::fromUtf8("8MHz"));
115 actionCpuType[1]->setText(QString::fromUtf8("4MHz"));
116 actionCpuType[2]->setText(QString::fromUtf8("8MHz (FE2/MC)"));
118 actionCpuType[0]->setText(QString::fromUtf8("4MHz"));
119 //menuCpuType->setVisible(false);
120 //actionCpuType[0]->setVisible(false);
123 #if defined(_PC8801MA)
124 menuBootMode->setTitle(QApplication::translate("MenuPC88", "Machine Mode", 0));
125 menuBootMode->setToolTipsVisible(true);
126 actionBootMode[0]->setText(QString::fromUtf8("N88-V1(S) Mode"));
127 actionBootMode[1]->setText(QString::fromUtf8("N88-V1(H) Mode"));
128 actionBootMode[2]->setText(QString::fromUtf8("N88-V2 Mode"));
129 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
130 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "V1(Standard) Mode.\nYou can run softwares of PC-8801/mk2.", 0));
131 actionBootMode[1]->setToolTip(QApplication::translate("MenuPC88", "V1(High Speed) Mode.\nYou can run softwares of PC-8801/mk2 faster.", 0));
132 actionBootMode[2]->setToolTip(QApplication::translate("MenuPC88", "V2 Mode.\nYou can run only softwares for PC-8801SR or later.", 0));
133 actionBootMode[3]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run softwares of PC-8001/mk2.", 0));
134 #elif defined(_PC8001SR)
135 menuBootMode->setTitle("Machine Mode");
136 menuBootMode->setToolTipsVisible(true);
137 actionBootMode[0]->setText(QString::fromUtf8("N80-V1 Mode"));
138 actionBootMode[1]->setText(QString::fromUtf8("N80-V2(SR) Mode"));
139 actionBootMode[2]->setText(QString::fromUtf8("N Mode"));
140 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "V1 Mode.\nYou can run softwares of PC-8001/mk2.", 0));
141 actionBootMode[1]->setToolTip(QApplication::translate("MenuPC88", "V2 Mode.\nYou can run only softwares for PC-8001mk2SR or later.", 0));
142 actionBootMode[2]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run only softwares for PC-8001.", 0));
145 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Boards", 0));
146 #if defined(SUPPORT_PC88_SB2)
147 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Board", 0));
148 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
149 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
150 actionSoundDevice[2]->setText(QString::fromUtf8("Sound Board 2 (OPN + OPNA)"));
151 actionSoundDevice[3]->setText(QString::fromUtf8("Sound Board 2(OPN + OPN)"));
152 actionSoundDevice[4]->setText(QString::fromUtf8("Sound Board 2 (OPNA + OPNA)"));
153 actionSoundDevice[5]->setText(QString::fromUtf8("Sound Board 2 (OPNA + OPN)"));
154 actionSoundDevice[0]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-23 (OPNA).", 0));
155 actionSoundDevice[1]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-11 (OPN).", 0));
156 actionSoundDevice[2]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPN + OPNA).", 0));
157 actionSoundDevice[3]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPN + OPN).", 0));
158 actionSoundDevice[4]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPNA + OPNA).", 0));
159 actionSoundDevice[5]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPNA + OPN).", 0));
160 #elif defined(SUPPORT_PC88_OPNA)
161 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Board", 0));
162 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
163 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
164 actionSoundDevice[0]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-23 (OPNA).", 0));
165 actionSoundDevice[1]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-11 (OPN).", 0));
168 actionDebugger[0]->setText(QApplication::translate("MenuPC88", "Main CPU", 0));
169 #if defined(_PC8001SR)
170 actionDebugger[1]->setText(QApplication::translate("MenuPC88", "PC-80S31K CPU", 0));
172 actionDebugger[1]->setText(QApplication::translate("MenuPC88", "Sub CPU", 0));
174 actionDebugger[0]->setVisible(true);
175 actionDebugger[1]->setVisible(true);
177 actionDebugger[2]->setVisible(false);
178 actionDebugger[3]->setVisible(false);
180 #if defined(USE_JOYSTICK_TYPE)
181 actionJoystickType[0]->setText(QApplication::translate("MenuPC88", "Joystick", 0));
182 actionJoystickType[1]->setText(QApplication::translate("MenuPC88", "Bus Mouse", 0));
183 actionJoystickType[0]->setToolTip(QApplication::translate("MenuPC88", "Connect joystick to JOY PORT.", 0));
184 actionJoystickType[1]->setToolTip(QApplication::translate("MenuPC88", "Connect bus-mouse to JOY PORT.", 0));
185 menuJoystickType->setTitle(QApplication::translate("MenuPC88", "Joy Port", 0));
187 #if defined(USE_PRINTER)
188 actionPrintDevice[1]->setText(QString::fromUtf8("PC-PR201"));
189 actionPrintDevice[1]->setToolTip(QApplication::translate("MenuPC88", "NEC PC-PR201 kanji serial printer.", 0));
190 actionPrintDevice[1]->setEnabled(false);
192 if(actionSoundPlayTape != NULL) actionSoundPlayTape->setEnabled(false);
193 if(action_SoundFilesRelay != NULL) action_SoundFilesRelay->setEnabled(false);
195 actionMemoryWait->setText(QApplication::translate("MenuPC88", "Wait Memory", 0));
196 actionMemoryWait->setToolTip(QApplication::translate("MenuPC88", "Simulate waiting memory.", 0));
197 #if defined(USE_MONITOR_TYPE)
198 menu_Emu_DisplayMode->setTitle(QApplication::translate("MenuPC88", "Display Mode", 0));
199 action_Emu_DisplayMode[0]->setText(QApplication::translate("MenuPC88", "High Resolution", 0));
200 action_Emu_DisplayMode[1]->setText(QApplication::translate("MenuPC88", "Standard", 0));
208 void META_MainWindow::setupUI_Emu(void)
210 #if defined(USE_CPU_TYPE)
211 ConfigCPUTypes(USE_CPU_TYPE);
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)));
230 #if defined(USE_MONITOR_TYPE)
231 menu_Emu_DisplayMode = new QMenu(menuMachine);
232 menu_Emu_DisplayMode->setObjectName(QString::fromUtf8("menu_DisplayMode"));
234 actionGroup_DisplayMode = new QActionGroup(this);
235 actionGroup_DisplayMode->setObjectName(QString::fromUtf8("actionGroup_DisplayMode"));
236 actionGroup_DisplayMode->setExclusive(true);
237 menuMachine->addAction(menu_Emu_DisplayMode->menuAction());
238 for(int i = 0; i < USE_MONITOR_TYPE; i++) {
239 action_Emu_DisplayMode[i] = new Action_Control_88(this, using_flags);
240 action_Emu_DisplayMode[i]->setCheckable(true);
241 action_Emu_DisplayMode[i]->pc88_binds->setValue1(i);
242 if(i == config.monitor_type) action_Emu_DisplayMode[i]->setChecked(true); // Need to write configure
244 action_Emu_DisplayMode[0]->setObjectName(QString::fromUtf8("action_Emu_DisplayMode_High"));
245 action_Emu_DisplayMode[1]->setObjectName(QString::fromUtf8("action_Emu_DisplayMode_Standard"));
246 for(int i = 0; i < 2; i++) {
247 menu_Emu_DisplayMode->addAction(action_Emu_DisplayMode[i]);
248 actionGroup_DisplayMode->addAction(action_Emu_DisplayMode[i]);
249 connect(action_Emu_DisplayMode[i], SIGNAL(triggered()),
250 action_Emu_DisplayMode[i]->pc88_binds, SLOT(do_set_display_mode()));
251 connect(action_Emu_DisplayMode[i]->pc88_binds, SIGNAL(sig_display_mode(int)),
252 this, SLOT(set_monitor_type(int)));
259 META_MainWindow::META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent) : Ui_MainWindow(p, logger, parent)
261 config_sound_device_type = 0;
267 META_MainWindow::~META_MainWindow()