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", "OPNA", 0));
67 p->setDeviceLabel(3, QApplication::translate("MainWindow", "OPN", 0));
68 p->setSliderVisible(2, true);
69 p->setSliderVisible(3, true);
77 void META_MainWindow::retranslateUi(void)
80 retranslateControlMenu(title, false);
81 retranslateFloppyMenu(0, 1);
82 retranslateFloppyMenu(1, 2);
84 retranslateSoundMenu();
85 retranslateScreenMenu();
86 retranslateMachineMenu();
87 retranslateEmulatorMenu();
89 config_sound_device_type = config.sound_device_type;
91 this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
94 #if defined(_PC8801MA)
95 menuCpuType->setTitle("CPU Frequency");
96 actionCpuType[0]->setText(QString::fromUtf8("8MHz"));
97 actionCpuType[1]->setText(QString::fromUtf8("4MHz"));
98 actionCpuType[2]->setText(QString::fromUtf8("8MHz (FE2/MC)"));
100 menuCpuType->setTitle("CPU Frequency");
101 actionCpuType[0]->setText(QString::fromUtf8("4MHz"));
102 //menuCpuType->setVisible(false);
103 //actionCpuType[0]->setVisible(false);
106 #if defined(_PC8801MA)
107 menuBootMode->setTitle("Machine Mode");
108 actionBootMode[0]->setText(QString::fromUtf8("N88-V1(S) Mode"));
109 actionBootMode[1]->setText(QString::fromUtf8("N88-V1(H) Mode"));
110 actionBootMode[2]->setText(QString::fromUtf8("N88-V2 Mode"));
111 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
112 #elif defined(_PC8001SR)
113 menuBootMode->setTitle("Machine Mode");
114 actionBootMode[0]->setText(QString::fromUtf8("N80-V1 Mode"));
115 actionBootMode[1]->setText(QString::fromUtf8("N80-V2(SR) Mode"));
116 actionBootMode[2]->setText(QString::fromUtf8("N Mode"));
119 #if defined(SUPPORT_PC88_SB2)
120 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Board", 0));
121 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
122 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
123 actionSoundDevice[2]->setText(QString::fromUtf8("Sound Board 2 (OPN + OPNA)"));
124 #elif defined(SUPPORT_PC88_OPNA)
125 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Board", 0));
126 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
127 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
130 actionDebugger[0]->setText(QApplication::translate("MainWindow", "Main CPU", 0));
131 #if defined(_PC8001SR)
132 actionDebugger[1]->setText(QApplication::translate("MainWindow", "PC-80S31K CPU", 0));
134 actionDebugger[1]->setText(QApplication::translate("MainWindow", "Sub CPU", 0));
136 actionDebugger[0]->setVisible(true);
137 actionDebugger[1]->setVisible(true);
139 actionDebugger[2]->setVisible(false);
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 #if defined(USE_PRINTER)
148 actionPrintDevice[1]->setText(QString::fromUtf8("PC-PR201"));
150 actionMemoryWait->setText(QApplication::translate("MainWindow", "Wait Memory", 0));
157 void META_MainWindow::setupUI_Emu(void)
159 menuCpuType = new QMenu(menuMachine);
160 menuCpuType->setObjectName(QString::fromUtf8("menuControl_CpuType"));
161 #if defined(_PC8801MA)
166 menuMachine->addAction(menuCpuType->menuAction());
168 menuBootMode = new QMenu(menuMachine);
169 menuBootMode->setObjectName(QString::fromUtf8("menuControl_BootMode"));
170 menuMachine->addAction(menuBootMode->menuAction());
171 #if defined(_PC8801MA)
172 ConfigCPUBootMode(4);
173 #elif defined(_PC8001SR)
174 ConfigCPUBootMode(3);
176 actionMemoryWait = new Action_Control_88(this, using_flags);
177 actionMemoryWait->setCheckable(true);
178 actionMemoryWait->setVisible(true);
179 actionMemoryWait->setChecked(false);
181 menuMachine->addAction(actionMemoryWait);
182 if((config.dipswitch & 0x0001) != 0) actionMemoryWait->setChecked(true);
183 connect(actionMemoryWait, SIGNAL(toggled(bool)),
184 actionMemoryWait->pc88_binds, SLOT(do_set_memory_wait(bool)));
185 connect(actionMemoryWait->pc88_binds, SIGNAL(sig_set_dipsw(int, bool)),
186 this, SLOT(set_dipsw(int, bool)));
190 META_MainWindow::META_MainWindow(USING_FLAGS *p, QWidget *parent) : Ui_MainWindow(p, parent)
192 config_sound_device_type = 0;
198 META_MainWindow::~META_MainWindow()