2 * Common Source code Project:
3 * Ui->Qt->gui->menu_main for generic.
4 * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
7 * Jan 14, 2015 : Initial, moved from qt/x1turboz/MainWindow.cpp .
10 #include <QtCore/QVariant>
14 #include <QImageReader>
17 #include "commonclasses.h"
18 #include "display_about.h"
19 #include "display_text_document.h"
20 #include "mainwidget.h"
21 #include "menuclasses.h"
22 #include "menu_disk.h"
24 #include "menu_cart.h"
25 #include "menu_quickdisk.h"
26 #include "menu_binary.h"
27 #include "menu_compactdisc.h"
28 #include "menu_bubble.h"
30 #include "qt_gldraw.h"
39 Ui_MainWindow::Ui_MainWindow(QWidget *parent) : QMainWindow(parent)
45 Ui_MainWindow::~Ui_MainWindow()
47 graphicsView->releaseKeyboard();
51 void Action_Control::do_check_grab_mouse(bool flag)
56 void Action_Control::do_send_string(void)
58 emit sig_send_string(bindString);
61 void Action_Control::do_set_string(QString s)
67 void Ui_MainWindow::do_show_about(void)
69 Dlg_AboutCSP *dlg = new Dlg_AboutCSP;
73 void Ui_MainWindow::do_browse_document(QString fname)
75 Dlg_BrowseText *dlg = new Dlg_BrowseText(fname);
80 void Ui_MainWindow::setupUi(void)
83 // QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
84 MainWindow = new QMainWindow();
85 if (MainWindow->objectName().isEmpty())
86 MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
87 //MainWindow->resize(1288, 862);
92 #if !defined(WITHOUT_SOUND)
95 #if defined(USE_BINARY_FILE1)
99 #if defined(USE_QD1) || defined(USE_QD2)
100 ConfigQuickDiskMenu();
104 #if defined(USE_CART1) || defined(USE_CART2)
107 #if defined(USE_COMPACT_DISC)
110 #if defined(USE_BUBBLE1) || defined(USE_BUBBLE2)
113 ConfigEmulatorMenu();
114 actionAbout = new Action_Control(this);
115 actionAbout->setObjectName(QString::fromUtf8("actionAbout"));
117 graphicsView = new GLDrawClass(this);
118 graphicsView->setObjectName(QString::fromUtf8("graphicsView"));
119 graphicsView->setMaximumSize(2560, 2560); // ?
120 graphicsView->setMinimumSize(240, 192); // ?
121 //graphicsView->grabKeyboard();
122 graphicsView->setAttribute(Qt::WA_InputMethodEnabled, false); // Disable [Zenkaku / Hankaku] with IM.
123 graphicsView->setAttribute(Qt::WA_KeyboardFocusChange, false);
124 //graphicsView->setFocusPolicy(Qt::StrongFocus);
125 //this->setFocusPolicy(Qt::ClickFocus);
127 #if defined(USE_BITMAP)
130 MainWindow->setCentralWidget(graphicsView);
131 MainWindow->setFocusProxy(graphicsView);
133 MainWindow->centralWidget()->adjustSize();
134 MainWindow->adjustSize();
136 statusbar = new QStatusBar(this);
137 statusbar->setObjectName(QString::fromUtf8("statusbar"));
138 MainWindow->setStatusBar(statusbar);
141 menubar = new QMenuBar(this);
142 menubar->setObjectName(QString::fromUtf8("menubar"));
143 menubar->setGeometry(QRect(0, 0, 1288, 27));
144 menuControl = new QMenu(menubar);
145 menuControl->setObjectName(QString::fromUtf8("menuControl"));
146 menuState = new QMenu(menuControl);
147 menuState->setObjectName(QString::fromUtf8("menuState"));
149 menuCopy_Paste = new QMenu(menuControl);
150 menuCopy_Paste->setObjectName(QString::fromUtf8("menuCopy_Paste"));
152 menuCpu_Speed = new QMenu(menuControl);
153 menuCpu_Speed->setObjectName(QString::fromUtf8("menuCpu_Speed"));
154 menuDebugger = new QMenu(menuControl);
155 menuDebugger->setObjectName(QString::fromUtf8("menuDebugger"));
157 CreateFloppyMenu(0, 1);
160 CreateFloppyMenu(1, 2);
163 CreateFloppyMenu(2, 3);
166 CreateFloppyMenu(3, 4);
169 CreateFloppyMenu(4, 5);
172 CreateFloppyMenu(5, 6);
175 CreateFloppyMenu(6, 7);
178 CreateFloppyMenu(7, 8);
182 CreateQuickDiskMenu(0, 1);
185 CreateQuickDiskMenu(1, 2);
192 #if defined(USE_CART1)
193 CreateCartMenu(0, 1);
195 #if defined(USE_CART2)
196 CreateCartMenu(1, 2);
198 #if defined(USE_BINARY_FILE1)
199 CreateBinaryMenu(0, 1);
201 #if defined(USE_BINARY_FILE2)
202 CreateBinaryMenu(1, 2);
204 #if defined(USE_COMPACT_DISC)
207 #if defined(USE_BUBBLE1)
208 CreateBubbleMenu(0, 1);
210 #if defined(USE_BUBBLE2)
211 CreateBubbleMenu(1, 2);
213 #if defined(USE_BUBBLE3)
214 CreateBubbleMenu(2, 3);
216 #if defined(USE_BUBBLE4)
217 CreateBubbleMenu(3, 4);
219 #if defined(USE_BUBBLE5)
220 CreateBubbleMenu(4, 5);
222 #if defined(USE_BUBBLE6)
223 CreateBubbleMenu(5, 6);
225 #if defined(USE_BUBBLE7)
226 CreateBubbleMenu(6, 7);
228 #if defined(USE_BUBBLE8)
229 CreateBubbleMenu(7, 8);
231 connect(this, SIGNAL(sig_update_screen(void)), graphicsView, SLOT(update(void)));
232 //connect(this, SIGNAL(sig_update_screen(void)), graphicsView, SLOT(updateGL(void)));
234 menuMachine = new QMenu(menubar);
235 menuMachine->setObjectName(QString::fromUtf8("menuMachine"));
237 actionMouseEnable = new Action_Control(this);
238 actionMouseEnable->setCheckable(true);
239 actionMouseEnable->setVisible(true);
240 actionMouseEnable->setChecked(false);
241 menuMachine->addAction(actionMouseEnable);
242 connect(actionMouseEnable, SIGNAL(toggled(bool)),
243 this, SLOT(do_set_mouse_enable(bool)));
244 connect(graphicsView, SIGNAL(sig_check_grab_mouse(bool)),
245 actionMouseEnable, SLOT(do_check_grab_mouse(bool)));
249 ConfigSoundDeviceType();
252 #if !defined(WITHOUT_SOUND)
253 menuSound = new QMenu(menubar);
254 menuSound->setObjectName(QString::fromUtf8("menuSound"));
256 menuEmulator = new QMenu(menubar);
257 menuEmulator->setObjectName(QString::fromUtf8("menuEmulator"));
259 menuHELP = new QMenu(menubar);
260 menuHELP->setObjectName(QString::fromUtf8("menuHELP"));
261 MainWindow->setMenuBar(menubar);
263 menubar->addAction(menuControl->menuAction());
264 connectActions_ControlMenu();
266 menubar->addAction(menu_fds[0]->menuAction());
269 menubar->addAction(menu_fds[1]->menuAction());
272 menubar->addAction(menu_fds[2]->menuAction());
275 menubar->addAction(menu_fds[3]->menuAction());
278 menubar->addAction(menu_fds[4]->menuAction());
281 menubar->addAction(menu_fds[5]->menuAction());
284 menubar->addAction(menu_fds[6]->menuAction());
287 menubar->addAction(menu_fds[7]->menuAction());
290 menubar->addAction(menu_QDs[0]->menuAction());
293 menubar->addAction(menu_QDs[1]->menuAction());
295 #if defined(USE_TAPE)
296 menubar->addAction(menu_CMT->menuAction());
298 #if defined(USE_CART1)
299 menubar->addAction(menu_Cart[0]->menuAction());
301 #if defined(USE_CART2)
302 menubar->addAction(menu_Cart[1]->menuAction());
304 #if defined(USE_BINARY_FILE1)
305 menubar->addAction(menu_BINs[0]->menuAction());
307 #if defined(USE_BINARY_FILE2)
308 menubar->addAction(menu_BINs[1]->menuAction());
310 #if defined(USE_COMPACT_DISC)
311 menubar->addAction(menu_CDROM->menuAction());
313 #if defined(USE_LASER_DISC)
314 menubar->addAction(menu_LaserDisc->menuAction());
316 menubar->addAction(menuMachine->menuAction());
318 #if !defined(WITHOUT_SOUND)
319 menubar->addAction(menuSound->menuAction());
321 #if defined(USE_BUBBLE1)
322 menubar->addAction(menu_bubbles[0]->menuAction());
324 #if defined(USE_BUBBLE2)
325 menubar->addAction(menu_bubbles[1]->menuAction());
327 #if defined(USE_BUBBLE3)
328 menubar->addAction(menu_bubbles[2]->menuAction());
330 #if defined(USE_BUBBLE4)
331 menubar->addAction(menu_bubbles[3]->menuAction());
333 #if defined(USE_BUBBLE5)
334 menubar->addAction(menu_bubbles[4]->menuAction());
336 #if defined(USE_BUBBLE6)
337 menubar->addAction(menu_bubbles[5]->menuAction());
339 #if defined(USE_BUBBLE7)
340 menubar->addAction(menu_bubbles[6]->menuAction());
342 #if defined(USE_BUBBLE8)
343 menubar->addAction(menu_bubbles[7]->menuAction());
346 menubar->addAction(menuScreen->menuAction());
347 // menubar->addAction(menuRecord->menuAction());
348 menubar->addAction(menuEmulator->menuAction());
349 menubar->addAction(menuHELP->menuAction());
351 CreateQuickDiskPulldownMenu(0);
354 CreateQuickDiskPulldownMenu(1);
356 #if defined(USE_BINARY_FILE1)
357 CreateBinaryPulldownMenu(0);
359 #if defined(USE_BINARY_FILE2)
360 CreateBinaryPulldownMenu(1);
362 #if !defined(WITHOUT_SOUND)
365 CreateEmulatorMenu();
367 menuHELP->addAction(actionAbout);
368 connect(actionAbout, SIGNAL(triggered()), this, SLOT(do_show_about()));
369 menuHELP->addSeparator();
371 actionHelp_AboutQt = new Action_Control(this);
372 actionHelp_AboutQt->setObjectName(QString::fromUtf8("menuHelp_AboutQt"));
373 menuHELP->addAction(actionHelp_AboutQt);
374 menuHELP->addSeparator();
375 menuHelp_Readme = new QMenu(menuHELP);
376 menuHelp_Readme->setObjectName(QString::fromUtf8("menuHelp_Readme_menu"));;
377 menuHELP->addAction(menuHelp_Readme->menuAction());
379 actionHelp_README = new Action_Control(this);
380 actionHelp_README->setObjectName(QString::fromUtf8("menuHelp_README"));
381 actionHelp_README->do_set_string(QString::fromUtf8("readme.txt"));
382 connect(actionHelp_README, SIGNAL(triggered()), actionHelp_README, SLOT(do_send_string()));
383 connect(actionHelp_README, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
384 menuHelp_Readme->addAction(actionHelp_README);
386 actionHelp_README_QT = new Action_Control(this);
387 actionHelp_README_QT->setObjectName(QString::fromUtf8("menuHelp_README_QT"));
388 actionHelp_README_QT->do_set_string(QString::fromUtf8("readme.qt.txt"));
389 menuHelp_Readme->addAction(actionHelp_README_QT);
390 connect(actionHelp_README_QT, SIGNAL(triggered()), actionHelp_README_QT, SLOT(do_send_string()));
391 connect(actionHelp_README_QT, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
392 actionHelp_README_Artane = new Action_Control(this);
393 actionHelp_README_Artane->setObjectName(QString::fromUtf8("menuHelp_README_Artane"));
394 actionHelp_README_Artane->do_set_string(QString::fromUtf8("readme_by_artane.txt"));
395 connect(actionHelp_README_Artane, SIGNAL(triggered()), actionHelp_README_Artane, SLOT(do_send_string()));
396 connect(actionHelp_README_Artane, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
397 menuHelp_Readme->addAction(actionHelp_README_Artane);
398 menuHelp_Readme->addSeparator();
400 actionHelp_README_BIOS = new Action_Control(this);
401 actionHelp_README_BIOS->setObjectName(QString::fromUtf8("menuHelp_README_BIOS"));
402 actionHelp_README_BIOS->do_set_string(QString::fromUtf8("bios_and_keys.txt"));
403 connect(actionHelp_README_BIOS, SIGNAL(triggered()), actionHelp_README_BIOS, SLOT(do_send_string()));
404 connect(actionHelp_README_BIOS, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
405 menuHelp_Readme->addAction(actionHelp_README_BIOS);
406 menuHelp_Readme->addSeparator();
408 actionHelp_README_MR_TANAM = new Action_Control(this);
409 actionHelp_README_MR_TANAM->setObjectName(QString::fromUtf8("menuHelp_README_MR_TANAM"));
410 actionHelp_README_MR_TANAM->do_set_string(QString::fromUtf8("readme_by_mr_tanam.txt"));
411 connect(actionHelp_README_MR_TANAM, SIGNAL(triggered()), actionHelp_README_MR_TANAM, SLOT(do_send_string()));
412 connect(actionHelp_README_MR_TANAM, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
413 menuHelp_Readme->addAction(actionHelp_README_MR_TANAM);
415 menuHelp_Readme->addSeparator();
417 actionHelp_README_FAQ = new Action_Control(this);
418 actionHelp_README_FAQ->setObjectName(QString::fromUtf8("menuHelp_README_FAQ"));
419 actionHelp_README_FAQ->do_set_string(QString::fromUtf8("FAQ.html"));
420 connect(actionHelp_README_FAQ, SIGNAL(triggered()), actionHelp_README_FAQ, SLOT(do_send_string()));
421 connect(actionHelp_README_FAQ, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
422 menuHelp_Readme->addAction(actionHelp_README_FAQ);
424 actionHelp_README_FAQ_JP = new Action_Control(this);
425 actionHelp_README_FAQ_JP->setObjectName(QString::fromUtf8("menuHelp_README_FAQ_JP"));
426 actionHelp_README_FAQ_JP->do_set_string(QString::fromUtf8("FAQ.ja.html"));
427 connect(actionHelp_README_FAQ_JP, SIGNAL(triggered()), actionHelp_README_FAQ_JP, SLOT(do_send_string()));
428 connect(actionHelp_README_FAQ_JP, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
429 menuHelp_Readme->addAction(actionHelp_README_FAQ_JP);
430 menuHelp_Readme->addSeparator();
432 actionHelp_README_FM7 = new Action_Control(this);
433 actionHelp_README_FM7->setObjectName(QString::fromUtf8("menuHelp_README_FM7"));
434 actionHelp_README_FM7->do_set_string(QString::fromUtf8("readme_fm7.txt"));
435 connect(actionHelp_README_FM7, SIGNAL(triggered()), actionHelp_README_FM7, SLOT(do_send_string()));
436 connect(actionHelp_README_FM7, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
437 menuHelp_Readme->addAction(actionHelp_README_FM7);
439 actionHelp_README_FM7_JP = new Action_Control(this);
440 actionHelp_README_FM7_JP->setObjectName(QString::fromUtf8("menuHelp_README_FM7_JP"));
441 actionHelp_README_FM7_JP->do_set_string(QString::fromUtf8("readme_fm7.jp.txt"));
442 connect(actionHelp_README_FM7_JP, SIGNAL(triggered()), actionHelp_README_FM7_JP, SLOT(do_send_string()));
443 connect(actionHelp_README_FM7_JP, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
444 menuHelp_Readme->addAction(actionHelp_README_FM7_JP);
446 menuHelp_Histories = new QMenu(menuHELP);
447 menuHelp_Histories->setObjectName(QString::fromUtf8("menuHelp_Histories"));;
448 menuHELP->addAction(menuHelp_Histories->menuAction());
450 actionHelp_History = new Action_Control(this);
451 actionHelp_History->setObjectName(QString::fromUtf8("menuHelp_History"));
452 actionHelp_History->do_set_string(QString::fromUtf8("history.txt"));
453 connect(actionHelp_History, SIGNAL(triggered()), actionHelp_History, SLOT(do_send_string()));
454 connect(actionHelp_History, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
455 menuHelp_Histories->addAction(actionHelp_History);
457 actionHelp_History_Relnote = new Action_Control(this);
458 actionHelp_History_Relnote->setObjectName(QString::fromUtf8("menuHelp_History_Relnote"));
459 actionHelp_History_Relnote->do_set_string(QString::fromUtf8("RELEASENOTE.txt"));
460 connect(actionHelp_History_Relnote, SIGNAL(triggered()), actionHelp_History_Relnote, SLOT(do_send_string()));
461 connect(actionHelp_History_Relnote, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
462 menuHelp_Histories->addAction(actionHelp_History_Relnote);
464 actionHelp_History_ChangeLog = new Action_Control(this);
465 actionHelp_History_ChangeLog->setObjectName(QString::fromUtf8("menuHelp_History_ChangeLog"));
466 actionHelp_History_ChangeLog->do_set_string(QString::fromUtf8("ChangeLog.txt"));
467 connect(actionHelp_History_ChangeLog, SIGNAL(triggered()), actionHelp_History_ChangeLog, SLOT(do_send_string()));
468 connect(actionHelp_History_ChangeLog, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
469 menuHelp_Histories->addAction(actionHelp_History_ChangeLog);
471 actionHelp_History_MR_TANAM = new Action_Control(this);
472 actionHelp_History_MR_TANAM->setObjectName(QString::fromUtf8("menuHelp_History_MR_TANAM"));
473 actionHelp_History_MR_TANAM->do_set_string(QString::fromUtf8("history_by_mr_tanam.txt"));
474 connect(actionHelp_History_MR_TANAM, SIGNAL(triggered()), actionHelp_History_MR_TANAM, SLOT(do_send_string()));
475 connect(actionHelp_History_MR_TANAM, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
476 menuHelp_Histories->addAction(actionHelp_History_MR_TANAM);
478 actionHelp_License = new Action_Control(this);
479 actionHelp_License->setObjectName(QString::fromUtf8("menuHelp_License"));
480 actionHelp_License->do_set_string(QString::fromUtf8("LICENSE.txt"));
481 connect(actionHelp_License, SIGNAL(triggered()), actionHelp_License, SLOT(do_send_string()));
482 connect(actionHelp_License, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
483 menuHELP->addAction(actionHelp_License);
485 actionHelp_License_JP = new Action_Control(this);
486 actionHelp_License_JP->setObjectName(QString::fromUtf8("menuHelp_License_JP"));
487 actionHelp_License_JP->do_set_string(QString::fromUtf8("LICENSE.ja.txt"));
488 connect(actionHelp_License_JP, SIGNAL(triggered()), actionHelp_License_JP, SLOT(do_send_string()));
489 connect(actionHelp_License_JP, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
490 menuHELP->addAction(actionHelp_License_JP);
492 if(config.window_mode <= 0) config.window_mode = 0;
493 if(config.window_mode >= _SCREEN_MODE_NUM) config.window_mode = _SCREEN_MODE_NUM - 1;
496 if(actionScreenSize[config.window_mode] != NULL) {
497 double nd = actionScreenSize[config.window_mode]->binds->getDoubleValue();
498 w = (int)(nd * (double)w);
499 h = (int)(nd * (double)h);
500 #if defined(USE_SCREEN_ROTATE)
501 if(config.rotate_type) {
508 #if defined(USE_SCREEN_ROTATE)
509 if(config.rotate_type) {
519 graphicsView->setFixedSize(w, h);
520 for(int i = 0; i < _SCREEN_MODE_NUM; i++) {
521 if(actionScreenSize[i] != NULL) {
522 connect(actionScreenSize[i]->binds, SIGNAL(sig_screen_multiply(float)),
523 graphicsView, SLOT(do_set_screen_multiply(float)));
526 this->set_screen_size(w, h);
527 this->set_screen_aspect(config.window_stretch_type);
528 if(actionScreenSize[config.window_mode] != NULL) {
529 double nd = actionScreenSize[config.window_mode]->binds->getDoubleValue();
530 graphicsView->do_set_screen_multiply(nd);
532 #if defined(USE_JOYSTICK)
533 connect(action_SetupJoystick, SIGNAL(triggered()), this, SLOT(rise_joystick_dialog()));
535 connect(action_SetupKeyboard, SIGNAL(triggered()), this, SLOT(rise_keyboard_dialog()));
537 QImageReader reader(":/default.ico");
538 QImage result = reader.read();
540 MainWindow->setWindowIcon(QPixmap::fromImage(result));
542 tmps = QString::fromUtf8("emu");
543 tmps = tmps + QString::fromUtf8(CONFIG_NAME);
544 tmps = tmps + QString::fromUtf8(" (");
545 tmps = tmps + QString::fromUtf8(DEVICE_NAME);
546 tmps = tmps + QString::fromUtf8(")");
547 MainWindow->setWindowTitle(tmps);
550 InsertIcon = QApplication::style()->standardIcon(QStyle::SP_FileDialogStart);
551 EjectIcon = QIcon(":/icon_eject.png");
552 StopIcon = QIcon(":/icon_process_stop.png");
553 RecordSoundIcon = QIcon(":/icon_record_to_wav.png");
554 ResetIcon = QApplication::style()->standardIcon(QStyle::SP_BrowserReload);
556 VolumeMutedIcon = QIcon(":/icon_volume_muted.png");
557 VolumeLowIcon = QIcon(":/icon_volume_low.png");
558 VolumeMidIcon = QIcon(":/icon_volume_mid.png");
559 VolumeHighIcon = QIcon(":/icon_volume_high.png");
561 ExitIcon = QIcon(":/icon_exit.png");
563 QMetaObject::connectSlotsByName(MainWindow);
566 void Ui_MainWindow::do_set_window_title(QString s)
569 tmps = QString::fromUtf8("emu");
570 tmps = tmps + QString::fromUtf8(CONFIG_NAME);
571 tmps = tmps + QString::fromUtf8(" (");
575 tmps = tmps + QString::fromUtf8(")");
576 MainWindow->setWindowTitle(tmps);
580 #include "dropdown_joystick.h"
581 #include "dialog_set_key.h"
583 void Ui_MainWindow::retranslateEmulatorMenu(void)
586 menuEmulator->setTitle(QApplication::translate("MainWindow", "Emulator", 0));
587 #if defined(USE_JOYSTICK)
588 action_SetupJoystick->setText(QApplication::translate("MainWindow", "Configure Joysticks", 0));
589 action_SetupJoystick->setIcon(QIcon(":/icon_gamepad.png"));
591 action_SetupKeyboard->setText(QApplication::translate("MainWindow", "Configure Keyboard", 0));
592 action_SetupKeyboard->setIcon(QIcon(":/icon_keyboard.png"));
594 void Ui_MainWindow::CreateEmulatorMenu(void)
596 #if defined(USE_JOYSTICK)
597 menuEmulator->addAction(action_SetupJoystick);
599 menuEmulator->addAction(action_SetupKeyboard);
602 void Ui_MainWindow::ConfigEmulatorMenu(void)
604 #if defined(USE_JOYSTICK)
605 action_SetupJoystick = new Action_Control(this);
607 action_SetupKeyboard = new Action_Control(this);
610 #if defined(USE_JOYSTICK)
611 void Ui_MainWindow::rise_joystick_dialog(void)
613 if(graphicsView != NULL) {
614 QStringList *lst = graphicsView->getVKNames();
615 CSP_DropDownJoysticks *dlg = new CSP_DropDownJoysticks(NULL, lst);
616 dlg->setWindowTitle(QApplication::translate("CSP_DropDownJoysticks", "Configure Joysticks", 0));
622 void Ui_MainWindow::rise_keyboard_dialog(void)
624 if(graphicsView != NULL) {
625 CSP_KeySetDialog *dlg = new CSP_KeySetDialog(NULL, graphicsView);
626 dlg->setWindowTitle(QApplication::translate("KeySetDialog", "Configure Keyboard", 0));
631 void Ui_MainWindow::retranslateUI_Help(void)
633 menuHELP->setTitle(QApplication::translate("MainWindow", "Help", 0));
634 actionHelp_AboutQt->setText(QApplication::translate("MainWindow", "About Qt", 0));
635 actionHelp_AboutQt->setIcon(QApplication::style()->standardIcon(QStyle::SP_TitleBarMenuButton));
637 actionAbout->setText(QApplication::translate("MainWindow", "About...", 0));
638 actionAbout->setIcon(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion));
640 menuHelp_Readme->setTitle(QApplication::translate("MainWindow", "READMEs", 0));
642 actionHelp_README->setText(QApplication::translate("MainWindow", "General Document", 0));
643 actionHelp_README_QT->setText(QApplication::translate("MainWindow", "About Qt ports", 0));
644 actionHelp_README_Artane->setText(QApplication::translate("MainWindow", "About Qt ports (Japanese).", 0));
645 actionHelp_README_MR_TANAM->setText(QApplication::translate("MainWindow", "By Mr. tanam", 0));
646 actionHelp_README_FM7->setText(QApplication::translate("MainWindow", "About eFM-7/8/77/AV.", 0));
647 actionHelp_README_FM7_JP->setText(QApplication::translate("MainWindow", "About eFM-7/8/77/AV (Japanese).", 0));
648 actionHelp_README_FAQ->setText(QApplication::translate("MainWindow", "FAQs(English)", 0));
649 actionHelp_README_FAQ_JP->setText(QApplication::translate("MainWindow", "FAQs(Japanese)", 0));
650 actionHelp_README_BIOS->setText(QApplication::translate("MainWindow", "BIOS and Key assigns", 0));
652 menuHelp_Histories->setTitle(QApplication::translate("MainWindow", "Histories", 0));
653 actionHelp_History->setText(QApplication::translate("MainWindow", "General History", 0));
654 actionHelp_History_Relnote->setText(QApplication::translate("MainWindow", "Release Note", 0));
655 actionHelp_History_ChangeLog->setText(QApplication::translate("MainWindow", "Change Log", 0));
656 actionHelp_History_MR_TANAM->setText(QApplication::translate("MainWindow", "History by Tanam", 0));
658 actionHelp_License->setText(QApplication::translate("MainWindow", "Show License", 0));
659 actionHelp_License_JP->setText(QApplication::translate("MainWindow", "Show License (Japanese)", 0));
663 // You can Override this function: Re-define on foo/MainWindow.cpp.
664 // This code is example: by X1(TurboZ).
665 void Ui_MainWindow::retranslateMachineMenu(void)
670 menuMachine->setTitle(QApplication::translate("MainWindow", "Machine", 0));
671 #if defined(USE_DEVICE_TYPE)
672 menuDeviceType->setTitle(QApplication::translate("MainWindow", "Device Type", 0));
673 for(i = 0; i < USE_DEVICE_TYPE; i++) {
675 tmps = QString::fromUtf8("Machine Device ") + tmps2;
676 actionDeviceType[i]->setText(tmps);
679 #if defined(USE_SOUND_DEVICE_TYPE)
680 menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Cards", 0));
681 for(i = 0; i < USE_SOUND_DEVICE_TYPE; i++) {
683 tmps = QString::fromUtf8("Sound Device ") + tmps2;
684 actionSoundDevice[i]->setText(tmps);
687 #if defined(USE_DRIVE_TYPE)
688 menuDriveType->setTitle(QApplication::translate("MainWindow", "Drive Type", 0));
689 for(i = 0; i < USE_DRIVE_TYPE; i++) {
691 tmps = QString::fromUtf8("Drive Type ") + tmps2;
692 actionDriveType[i]->setText(tmps);
695 #if defined(USE_PRINTER)
696 menuPrintDevice->setTitle(QApplication::translate("MainWindow", "Printer (Need RESET)", 0));
698 actionPrintDevice[0]->setText(QApplication::translate("MainWindow", "Dump to File", 0));
699 #if defined(USE_PRINTER_TYPE)
700 for(i = 1; i < (USE_PRINTER_TYPE - 1); i++) {
702 tmps = QApplication::translate("MainWindow", "Printer", 0) + tmps2;
703 actionPrintDevice[i]->setText(tmps);
706 actionPrintDevice[i]->setText(QApplication::translate("MainWindow", "Not Connect", 0));
709 void Ui_MainWindow::retranslateUi(void)
711 retranslateControlMenu("NMI Reset", true);
712 retranslateFloppyMenu(0, 0);
713 retranslateFloppyMenu(1, 1);
714 retranslateCMTMenu();
715 #if !defined(WITHOUT_SOUND)
716 retranslateSoundMenu();
718 retranslateScreenMenu();
719 retranslateCartMenu(0, 1);
720 retranslateCartMenu(1, 2);
721 retranslateCDROMMenu();
723 retranslateBinaryMenu(0, 1);
724 retranslateBinaryMenu(1, 2);
726 retranslateBubbleMenu(0, 1);
727 retranslateBubbleMenu(1, 2);
728 retranslateMachineMenu();
729 retranslateEmulatorMenu();
730 retranslateUI_Help();
734 void Ui_MainWindow::setCoreApplication(QApplication *p)
736 this->CoreApplication = p;
737 connect(actionExit_Emulator, SIGNAL(triggered()),
738 this->CoreApplication, SLOT(closeAllWindows())); // OnGuiExit()?
739 connect(actionHelp_AboutQt, SIGNAL(triggered()),
740 this->CoreApplication, SLOT(aboutQt()));