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();
86 config_sound_device_type = config.sound_device_type;
88 this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
90 actionCapture_Screen->setText(QApplication::translate("MainWindow", "Capture Screen", 0));
92 actionAbout->setText(QApplication::translate("MainWindow", "About...", 0));
95 // actionStart_Record_Movie->setText(QApplication::translate("MainWindow", "Start Record Movie", 0));
96 // actionStop_Record_Movie->setText(QApplication::translate("MainWindow", "Stop Record Movie", 0));
98 menuScreen->setTitle(QApplication::translate("MainWindow", "Screen", 0));
99 menuStretch_Mode->setTitle(QApplication::translate("MainWindow", "Stretch Mode", 0));
101 #if defined(_PC8801MA)
102 menuCpuType->setTitle("CPU Frequency");
103 actionCpuType[0]->setText(QString::fromUtf8("8MHz"));
104 actionCpuType[1]->setText(QString::fromUtf8("4MHz"));
105 actionCpuType[2]->setText(QString::fromUtf8("8MHz (FE2/MC)"));
107 menuCpuType->setTitle("CPU Frequency");
108 actionCpuType[0]->setText(QString::fromUtf8("4MHz"));
109 //menuCpuType->setVisible(false);
110 //actionCpuType[0]->setVisible(false);
113 #if defined(_PC8801MA)
114 menuBootMode->setTitle("Machine Mode");
115 actionBootMode[0]->setText(QString::fromUtf8("N88-V1(S) Mode"));
116 actionBootMode[1]->setText(QString::fromUtf8("N88-V1(H) Mode"));
117 actionBootMode[2]->setText(QString::fromUtf8("N88-V2 Mode"));
118 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
119 #elif defined(_PC8001SR)
120 menuBootMode->setTitle("Machine Mode");
121 actionBootMode[0]->setText(QString::fromUtf8("N80-V1 Mode"));
122 actionBootMode[1]->setText(QString::fromUtf8("N80-V2(SR) Mode"));
123 actionBootMode[2]->setText(QString::fromUtf8("N Mode"));
126 #if defined(SUPPORT_PC88_SB2)
127 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Board", 0));
128 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
129 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
130 actionSoundDevice[2]->setText(QString::fromUtf8("Sound Board 2 (OPN + OPNA)"));
131 #elif defined(SUPPORT_PC88_OPNA)
132 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Board", 0));
133 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
134 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
137 actionDebugger_1->setText(QApplication::translate("MainWindow", "Main CPU", 0));
138 actionDebugger_2->setText(QApplication::translate("MainWindow", "Sub CPU", 0));
139 actionDebugger_3->setVisible(false);
141 #if defined(USE_DEVICE_TYPE)
142 actionDeviceType[0]->setText(QApplication::translate("MainWindow", "Joystick", 0));
143 actionDeviceType[1]->setText(QApplication::translate("MainWindow", "Bus Mouse", 0));
144 menuDeviceType->setTitle(QApplication::translate("MainWindow", "Joy Port", 0));
146 actionMemoryWait->setText(QApplication::translate("MainWindow", "Wait Memory", 0));
149 // menuRecord->setTitle(QApplication::translate("MainWindow", "Record", 0));
150 // menuRecoad_as_movie->setTitle(QApplication::translate("MainWindow", "Recoad as movie", 0));
152 menuEmulator->setTitle(QApplication::translate("MainWindow", "Emulator", 0));
153 menuMachine->setTitle(QApplication::translate("MainWindow", "Machine", 0));
155 menuHELP->setTitle(QApplication::translate("MainWindow", "HELP", 0));
156 actionHelp_AboutQt->setText(QApplication::translate("MainWindow", "About Qt", 0));
162 void META_MainWindow::setupUI_Emu(void)
164 menuCpuType = new QMenu(menuMachine);
165 menuCpuType->setObjectName(QString::fromUtf8("menuControl_CpuType"));
166 #if defined(_PC8801MA)
171 menuMachine->addAction(menuCpuType->menuAction());
173 menuBootMode = new QMenu(menuMachine);
174 menuBootMode->setObjectName(QString::fromUtf8("menuControl_BootMode"));
175 menuMachine->addAction(menuBootMode->menuAction());
176 #if defined(_PC8801MA)
177 ConfigCPUBootMode(4);
178 #elif defined(_PC8001SR)
179 ConfigCPUBootMode(3);
181 actionMemoryWait = new Action_Control_88(this);
182 actionMemoryWait->setCheckable(true);
183 actionMemoryWait->setVisible(true);
184 actionMemoryWait->setChecked(false);
186 menuMachine->addAction(actionMemoryWait);
187 if((config.dipswitch & 0x0001) != 0) actionMemoryWait->setChecked(true);
188 connect(actionMemoryWait, SIGNAL(toggled(bool)),
189 actionMemoryWait->pc88_binds, SLOT(do_set_memory_wait(bool)));
190 connect(actionMemoryWait->pc88_binds, SIGNAL(sig_set_dipsw(int, bool)),
191 this, SLOT(set_dipsw(int, bool)));
194 #if defined(SUPPORT_PC88_OPNA) || defined(SUPPORT_PC88_SB2)
199 META_MainWindow::META_MainWindow(QWidget *parent) : Ui_MainWindow(parent)
201 config_sound_device_type = 0;
207 META_MainWindow::~META_MainWindow()