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.
13 #include "commonclasses.h"
14 #include "menuclasses.h"
20 extern config_t config;
22 Action_Control_MZ700::Action_Control_MZ700(QObject *parent, USING_FLAGS *p) : Action_Control(parent, p)
24 mz_binds = new Object_Menu_Control_MZ700(parent, p);
27 Action_Control_MZ700::~Action_Control_MZ700(){
31 Object_Menu_Control_MZ700::Object_Menu_Control_MZ700(QObject *parent, USING_FLAGS *p) : Object_Menu_Control(parent, p)
35 Object_Menu_Control_MZ700::~Object_Menu_Control_MZ700(){
38 void Object_Menu_Control_MZ700::do_monitor_type(void)
40 emit sig_monitor_type(getValue1());
43 void META_MainWindow::set_monitor_type(int num)
45 #ifdef USE_MONITOR_TYPE
46 if((num < 0) || (num >= USE_MONITOR_TYPE)) return;
47 config.monitor_type = num;
48 this->do_emu_update_config();
52 void META_MainWindow::do_set_pcg(bool flag)
55 this->set_dipsw(0, flag);
56 //this->do_emu_update_config();
60 void META_MainWindow::setupUI_Emu(void)
63 //menuMachine->setVisible(false);
66 action_PCG700 = new QAction(menuMachine);
67 action_PCG700->setCheckable(true);
68 if((config.dipswitch & 0x0001) != 0) action_PCG700->setChecked(true);
69 connect(action_PCG700, SIGNAL(toggled(bool)), this, SLOT(do_set_pcg(bool)));
70 menuMachine->addAction(action_PCG700);
71 menuMachine->addSeparator();
73 #if defined(USE_BOOT_MODE)
74 menuBootMode = new QMenu(menuMachine);
75 menuBootMode->setObjectName(QString::fromUtf8("menuControl_BootMode"));
76 menuMachine->addAction(menuBootMode->menuAction());
77 ConfigCPUBootMode(USE_BOOT_MODE);
79 #if defined(USE_MONITOR_TYPE)
82 menuMonitorType = new QMenu(menuMachine);
83 menuMonitorType->setObjectName(QString::fromUtf8("menuControl_MonitorType"));
84 menuMachine->addAction(menuMonitorType->menuAction());
86 actionGroup_MonitorType = new QActionGroup(this);
87 actionGroup_MonitorType->setExclusive(true);
88 for(ii = 0; ii < USE_MONITOR_TYPE; ii++) {
89 actionMonitorType[ii] = new Action_Control_MZ700(this, using_flags);
90 actionGroup_MonitorType->addAction(actionMonitorType[ii]);
91 actionMonitorType[ii]->setCheckable(true);
92 actionMonitorType[ii]->setVisible(true);
93 actionMonitorType[ii]->mz_binds->setValue1(ii);
94 if(config.monitor_type == ii) actionMonitorType[ii]->setChecked(true);
95 menuMonitorType->addAction(actionMonitorType[ii]);
96 connect(actionMonitorType[ii], SIGNAL(triggered()),
97 actionMonitorType[ii]->mz_binds, SLOT(do_monitor_type()));
98 connect(actionMonitorType[ii]->mz_binds, SIGNAL(sig_monitor_type(int)),
99 this, SLOT(set_monitor_type(int)));
106 void META_MainWindow::retranslateUi(void)
108 retranslateControlMenu(" ", true);
109 retranslateFloppyMenu(0, 0);
110 retranslateFloppyMenu(1, 1);
111 retranslateQuickDiskMenu(0, 0);
112 retranslateCMTMenu();
113 retranslateSoundMenu();
114 retranslateScreenMenu();
115 retranslateMachineMenu();
116 retranslateEmulatorMenu();
117 retranslateUI_Help();
119 this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
121 menuBootMode->setTitle("BOOT Mode");
122 actionBootMode[0]->setText(QString::fromUtf8("MZ-800"));
123 actionBootMode[1]->setText(QString::fromUtf8("MZ-700"));
125 menuMonitorType->setTitle("Monitor Type");
126 actionMonitorType[0]->setText(QApplication::translate("MainWindow", "Color", 0));
127 actionMonitorType[1]->setText(QApplication::translate("MainWindow", "Monochrome", 0));
128 menuMachine->setTitle(QApplication::translate("MainWindow", "Machine", 0));;
129 #elif defined(_MZ700)
130 action_PCG700->setText(QApplication::translate("MainWindow", "PCG-700", 0));
133 actionPrintDevice[1]->setText(QString::fromUtf8("Sharp MZ-1P17"));
136 actionDebugger[0]->setVisible(true);
137 actionDebugger[1]->setVisible(false);
138 actionDebugger[2]->setVisible(false);
139 actionDebugger[3]->setVisible(false);
145 META_MainWindow::META_MainWindow(USING_FLAGS *p, QWidget *parent) : Ui_MainWindow(p, parent)
152 META_MainWindow::~META_MainWindow()