OSDN Git Service

[VM][General] Merge Upstream 2021-05-06. Some variants of PC-6001 are temporally...
[csp-qt/common_source_project-fm7.git] / source / src / qt / machines / mz700 / MainWindow.cpp
1 /*
2  * Common Source code Project:
3  * Ui->Qt->MainWindow for X1TurboZ .
4  * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
5  *   License : GPLv2
6  *   History :
7  * Jan 14, 2015 : Initial, many of constructors were moved to qt/gui/menu_main.cpp.
8  */
9
10 #include <QApplication>
11 #include <QVariant>
12 #include <QtGui>
13 #include <QMenu>
14
15 #include "vm.h"
16 #include "commonclasses.h"
17 #include "menuclasses.h"
18 #include "emu.h"
19 #include "qt_main.h"
20
21 //QT_BEGIN_NAMESPACE
22
23 extern config_t config;
24
25 Action_Control_MZ700::Action_Control_MZ700(QObject *parent, USING_FLAGS *p) : Action_Control(parent, p)
26 {
27         mz_binds = new Object_Menu_Control_MZ700(parent, p);
28 }
29
30 Action_Control_MZ700::~Action_Control_MZ700(){
31         delete mz_binds;
32 }
33
34 Object_Menu_Control_MZ700::Object_Menu_Control_MZ700(QObject *parent, USING_FLAGS *p) : Object_Menu_Control(parent, p)
35 {
36 }
37
38 Object_Menu_Control_MZ700::~Object_Menu_Control_MZ700(){
39 }
40
41
42 void META_MainWindow::do_set_pcg(bool flag)
43 {
44 #ifdef _MZ700
45         this->set_dipsw(0, flag);
46         //this->do_emu_update_config();
47 #endif
48 }
49
50 void META_MainWindow::setupUI_Emu(void)
51 {
52 #if !defined(_MZ800)
53         //menuMachine->setVisible(false);
54 #endif   
55 #if defined(_MZ700)
56         action_PCG700 = new QAction(menuMachine);
57         action_PCG700->setCheckable(true);
58         if((config.dipswitch & 0x0001) != 0) action_PCG700->setChecked(true);
59         connect(action_PCG700, SIGNAL(toggled(bool)), this, SLOT(do_set_pcg(bool)));
60         menuMachine->addAction(action_PCG700);
61         menuMachine->addSeparator();
62 #endif
63 #if defined(USE_BOOT_MODE)
64         ConfigCPUBootMode(USE_BOOT_MODE);
65 #endif
66
67 }
68
69 void META_MainWindow::retranslateUi(void)
70 {
71         Ui_MainWindowBase::retranslateUi();
72         retranslateControlMenu(" ",  true);
73 #if defined(USE_JOYSTICK_TYPE)
74         actionJoystickType[0]->setText(QApplication::translate("MachineMZ700", "MZ-1X03", 0));
75         actionJoystickType[0]->setToolTip(QApplication::translate("MachineMZ700", "Use Sharp MZ-1X03 Joystick unit.", 0));
76         actionJoystickType[1]->setText(QApplication::translate("MachineMZ700", "JOY-700", 0));
77         actionJoystickType[1]->setToolTip(QApplication::translate("MachineMZ700", "Use Tsukumo JOY-700 Joystick unit.", 0));
78         actionJoystickType[2]->setText(QApplication::translate("MachineMZ700", "AM7J", 0));
79         actionJoystickType[2]->setToolTip(QApplication::translate("MachineMZ700", "Use AM7J ATARI-Joystick adapter.", 0));
80 #endif
81 #if defined(_MZ800)
82         menuBootMode->setTitle(QApplication::translate("Machine", "BOOT Mode", 0));
83         actionBootMode[0]->setText(QString::fromUtf8("MZ-800"));
84         actionBootMode[1]->setText(QString::fromUtf8("MZ-700"));
85    
86         menuMonitorType->setTitle("Monitor Type");
87         menuMonitorType->setToolTipsVisible(true);
88         actionMonitorType[0]->setText(QApplication::translate("MachineMZ700", "Color", 0));
89         actionMonitorType[1]->setText(QApplication::translate("MachineMZ700", "Monochrome", 0));
90         actionMonitorType[0]->setToolTip(QApplication::translate("MachineMZ700", "Use color CRT.", 0));
91         actionMonitorType[1]->setToolTip(QApplication::translate("MachineMZ700", "Use monochrome CRT.", 0));
92         menuMachine->setTitle(QApplication::translate("MachineMZ700", "Machine", 0));;
93
94 #elif defined(_MZ700)
95         action_PCG700->setText(QApplication::translate("MachineMZ700", "PCG-700", 0));
96         action_PCG700->setToolTip(QApplication::translate("MachineMZ700", "HAL laboratory PCG-700 PCG.", 0));
97 #endif
98 #if defined(_MZ1500)
99         actionPrintDevice[1]->setText(QString::fromUtf8("MZ-1P17"));
100         actionPrintDevice[1]->setToolTip(QApplication::translate("MachineMZ700", "Sharp MZ-1P17 kanji thermal printer.", 0));
101         actionPrintDevice[2]->setText(QString::fromUtf8("PC-PR201"));
102         actionPrintDevice[2]->setToolTip(QApplication::translate("MenuMZ700", "NEC PC-PR201 kanji serial printer.", 0));
103         actionPrintDevice[2]->setEnabled(false);
104         
105         actionPrintDevice[3]->setText(QString::fromUtf8("None"));
106 #endif
107 #if defined(USE_DRIVE_TYPE)
108         menuDriveType->setTitle(QApplication::translate("MachineMZ700", "Floppy Type", 0));
109         actionDriveType[0]->setText(QApplication::translate("MachineMZ700", "2D", 0));
110         actionDriveType[1]->setText(QApplication::translate("MachineMZ700", "2DD", 0));
111 #endif
112 #ifdef USE_DEBUGGER
113         actionDebugger[0]->setVisible(true);
114         actionDebugger[1]->setVisible(false);
115         actionDebugger[2]->setVisible(false);
116         actionDebugger[3]->setVisible(false);
117 #endif
118         // Set Labels
119 } // retranslateUi
120
121
122 META_MainWindow::META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent) : Ui_MainWindow(p, logger, parent)
123 {
124         setupUI_Emu();
125         retranslateUi();
126 }
127
128
129 META_MainWindow::~META_MainWindow()
130 {
131 }
132
133 //QT_END_NAMESPACE
134
135
136