OSDN Git Service

4ffc241983faf505c0b06a3e04234adc9533bcdb
[csp-qt/common_source_project-fm7.git] / source / src / qt / gui / menu_main.cpp
1 /*
2  * Common Source code Project:
3  * Ui->Qt->gui->menu_main for generic.
4  * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
5  *   License : GPLv2
6  *   History :
7  * Jan 14, 2015 : Initial, moved from qt/x1turboz/MainWindow.cpp .
8  */
9
10 #include <QtCore/QVariant>
11 #include <QtGui>
12 #include <QIcon>
13 #include <QImage>
14 #include <QImageReader>
15 #include <QPixmap>
16
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"
23 #include "menu_cmt.h"
24 #include "menu_cart.h"
25 #include "menu_quickdisk.h"
26 #include "menu_binary.h"
27
28 #include "qt_gldraw.h"
29 #include "emu.h"
30 #include "qt_main.h"
31
32
33 extern EMU *emu;
34
35 QT_BEGIN_NAMESPACE
36
37 Ui_MainWindow::Ui_MainWindow(QWidget *parent) : QMainWindow(parent)
38 {
39         setupUi();
40         createContextMenu();
41 }
42
43 Ui_MainWindow::~Ui_MainWindow()
44 {
45         graphicsView->releaseKeyboard();
46 }
47
48
49 void Action_Control::do_check_grab_mouse(bool flag)
50 {
51         this->toggle();
52 }
53
54 void Action_Control::do_send_string(void)
55 {
56         emit sig_send_string(bindString);
57 }
58
59 void Action_Control::do_set_string(QString s)
60 {
61         bindString = s;
62 }
63
64
65 void Ui_MainWindow::do_show_about(void)
66 {
67         Dlg_AboutCSP *dlg = new Dlg_AboutCSP;
68         dlg->show();
69 }
70
71 void Ui_MainWindow::do_browse_document(QString fname)
72 {
73         Dlg_BrowseText *dlg = new Dlg_BrowseText(fname);
74         dlg->show();
75 }
76
77
78 void Ui_MainWindow::setupUi(void)
79 {
80         int w, h;
81         //   QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
82         MainWindow = new QMainWindow();
83         if (MainWindow->objectName().isEmpty())
84                 MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
85         //MainWindow->resize(1288, 862);
86    
87         ConfigControlMenu();
88         ConfigFloppyMenu();
89         ConfigCMTMenu();
90 #if !defined(WITHOUT_SOUND)     
91         ConfigSoundMenu();
92 #endif  
93 #if defined(USE_BINARY_FILE1)
94         ConfigBinaryMenu(); 
95 #endif
96
97 #if defined(USE_QD1) || defined(USE_QD2)
98         ConfigQuickDiskMenu();
99 #endif
100
101         ConfigScreenMenu();
102 #if defined(USE_CART1) || defined(USE_CART2)
103         ConfigCartMenu();
104 #endif
105         
106         actionAbout = new Action_Control(this);
107         actionAbout->setObjectName(QString::fromUtf8("actionAbout"));
108    
109         graphicsView = new GLDrawClass(this);
110         graphicsView->setObjectName(QString::fromUtf8("graphicsView"));
111         graphicsView->setMaximumSize(2560, 2560); // ?
112         graphicsView->setMinimumSize(240, 192); // ?
113         //graphicsView->grabKeyboard();
114         graphicsView->setAttribute(Qt::WA_InputMethodEnabled, false); // Disable [Zenkaku / Hankaku] with IM.
115         graphicsView->setAttribute(Qt::WA_KeyboardFocusChange, false); 
116         //graphicsView->setFocusPolicy(Qt::StrongFocus);
117         //this->setFocusPolicy(Qt::ClickFocus);
118    
119 #if defined(USE_BITMAP)
120         bitmapImage = NULL;
121 #endif   
122         MainWindow->setCentralWidget(graphicsView);
123         MainWindow->setFocusProxy(graphicsView);
124         
125         MainWindow->centralWidget()->adjustSize();
126         MainWindow->adjustSize();
127
128         statusbar = new QStatusBar(this);
129         statusbar->setObjectName(QString::fromUtf8("statusbar"));
130         MainWindow->setStatusBar(statusbar);
131         initStatusBar();
132         
133         menubar = new QMenuBar(this);
134         menubar->setObjectName(QString::fromUtf8("menubar"));
135         menubar->setGeometry(QRect(0, 0, 1288, 27));
136         menuControl = new QMenu(menubar);
137         menuControl->setObjectName(QString::fromUtf8("menuControl"));
138         menuState = new QMenu(menuControl);
139         menuState->setObjectName(QString::fromUtf8("menuState"));
140 #ifdef USE_AUTO_KEY
141         menuCopy_Paste = new QMenu(menuControl);
142         menuCopy_Paste->setObjectName(QString::fromUtf8("menuCopy_Paste"));
143 #endif  
144         menuCpu_Speed = new QMenu(menuControl);
145         menuCpu_Speed->setObjectName(QString::fromUtf8("menuCpu_Speed"));
146         menuDebugger = new QMenu(menuControl);
147         menuDebugger->setObjectName(QString::fromUtf8("menuDebugger"));
148 #ifdef USE_FD1  
149         CreateFloppyMenu(0, 1);
150 #endif
151 #ifdef USE_FD2  
152         CreateFloppyMenu(1, 2);
153 #endif
154 #ifdef USE_FD3  
155         CreateFloppyMenu(2, 3);
156 #endif
157 #ifdef USE_FD4  
158         CreateFloppyMenu(3, 4);
159 #endif
160 #ifdef USE_FD5  
161         CreateFloppyMenu(4, 5);
162 #endif
163 #ifdef USE_FD6  
164         CreateFloppyMenu(5, 6);
165 #endif
166 #ifdef USE_FD7  
167         CreateFloppyMenu(6, 7);
168 #endif
169 #ifdef USE_FD8  
170         CreateFloppyMenu(7, 8);
171 #endif
172
173 #if defined(USE_QD1)
174         CreateQuickDiskMenu(0, 1);
175 #endif
176 #if defined(USE_QD2)
177         CreateQuickDiskMenu(1, 2);
178 #endif
179 #ifdef USE_TAPE
180         CreateCMTMenu();
181 #endif
182
183         CreateScreenMenu();
184 #if defined(USE_CART1)
185         CreateCartMenu(0, 1);
186 #endif
187 #if defined(USE_CART2)
188         CreateCartMenu(1, 2);
189 #endif
190 #if defined(USE_BINARY_FILE1)
191         CreateBinaryMenu(0, 1);
192 #endif
193 #if defined(USE_BINARY_FILE2)
194         CreateBinaryMenu(1, 2);
195 #endif
196
197         connect(this, SIGNAL(sig_update_screen(void)), graphicsView, SLOT(update(void)));
198
199         menuMachine = new QMenu(menubar);
200         menuMachine->setObjectName(QString::fromUtf8("menuMachine"));
201         actionMouseEnable = new Action_Control(this);
202         actionMouseEnable->setCheckable(true);
203         actionMouseEnable->setVisible(true);
204         actionMouseEnable->setChecked(false);
205         menuMachine->addAction(actionMouseEnable);
206         connect(actionMouseEnable, SIGNAL(toggled(bool)),
207                 this, SLOT(do_set_mouse_enable(bool)));
208         connect(graphicsView, SIGNAL(sig_check_grab_mouse(bool)),
209                 actionMouseEnable, SLOT(do_check_grab_mouse(bool)));
210         
211         ConfigDeviceType();
212         ConfigDriveType();
213         ConfigSoundDeviceType();
214         ConfigPrinterType();
215
216 #if !defined(WITHOUT_SOUND)     
217         menuSound = new QMenu(menubar);
218         menuSound->setObjectName(QString::fromUtf8("menuSound"));
219 #endif
220         menuEmulator = new QMenu(menubar);
221         menuEmulator->setObjectName(QString::fromUtf8("menuEmulator"));
222         menuHELP = new QMenu(menubar);
223         menuHELP->setObjectName(QString::fromUtf8("menuHELP"));
224         MainWindow->setMenuBar(menubar);
225
226         menubar->addAction(menuControl->menuAction());
227         connectActions_ControlMenu();
228 #if defined(USE_FD1)
229         menubar->addAction(menu_fds[0]->menuAction());
230 #endif
231 #if defined(USE_FD2)
232         menubar->addAction(menu_fds[1]->menuAction());
233 #endif
234 #if defined(USE_FD3)
235         menubar->addAction(menu_fds[2]->menuAction());
236 #endif
237 #if defined(USE_FD4)
238         menubar->addAction(menu_fds[3]->menuAction());
239 #endif
240 #if defined(USE_FD5)
241         menubar->addAction(menu_fds[4]->menuAction());
242 #endif
243 #if defined(USE_FD6)
244         menubar->addAction(menu_fds[5]->menuAction());
245 #endif
246 #if defined(USE_FD7)
247         menubar->addAction(menu_fds[6]->menuAction());
248 #endif
249 #if defined(USE_FD8)
250         menubar->addAction(menu_fds[7]->menuAction());
251 #endif
252 #if defined(USE_QD1)
253         menubar->addAction(menu_QDs[0]->menuAction());
254 #endif
255 #if defined(USE_QD2)
256         menubar->addAction(menu_QDs[1]->menuAction());
257 #endif
258 #if defined(USE_TAPE)
259         menubar->addAction(menu_CMT->menuAction());
260 #endif
261 #if defined(USE_CART1)
262         menubar->addAction(menu_Cart[0]->menuAction());
263 #endif
264 #if defined(USE_CART2)
265         menubar->addAction(menu_Cart[1]->menuAction());
266 #endif
267 #if defined(USE_BINARY_FILE1)
268         menubar->addAction(menu_BINs[0]->menuAction());
269 #endif
270 #if defined(USE_BINARY_FILE2)
271         menubar->addAction(menu_BINs[1]->menuAction());
272 #endif
273         menubar->addAction(menuMachine->menuAction());
274         
275 #if !defined(WITHOUT_SOUND)     
276         menubar->addAction(menuSound->menuAction());
277 #endif   
278         menubar->addAction(menuScreen->menuAction());
279 //      menubar->addAction(menuRecord->menuAction());
280         menubar->addAction(menuEmulator->menuAction());
281         menubar->addAction(menuHELP->menuAction());
282 #if defined(USE_QD1)
283         CreateQuickDiskPulldownMenu(0);
284 #endif
285 #if defined(USE_QD2)
286         CreateQuickDiskPulldownMenu(1);
287 #endif
288 #if defined(USE_BINARY_FILE1)
289         CreateBinaryPulldownMenu(0);
290 #endif
291 #if defined(USE_BINARY_FILE2)
292         CreateBinaryPulldownMenu(1);
293 #endif
294 #if !defined(WITHOUT_SOUND)     
295         CreateSoundMenu();
296 #endif
297   
298         menuHELP->addAction(actionAbout);
299         connect(actionAbout, SIGNAL(triggered()), this, SLOT(do_show_about()));
300         menuHELP->addSeparator();
301         
302         actionHelp_AboutQt = new Action_Control(this);
303         actionHelp_AboutQt->setObjectName(QString::fromUtf8("menuHelp_AboutQt"));
304         menuHELP->addAction(actionHelp_AboutQt);
305         menuHELP->addSeparator();
306         menuHelp_Readme = new QMenu(menuHELP);
307         menuHelp_Readme->setObjectName(QString::fromUtf8("menuHelp_Readme_menu"));;
308         menuHELP->addAction(menuHelp_Readme->menuAction());
309
310         actionHelp_README = new Action_Control(this);
311         actionHelp_README->setObjectName(QString::fromUtf8("menuHelp_README"));
312         actionHelp_README->do_set_string(QString::fromUtf8("readme.txt"));
313         connect(actionHelp_README, SIGNAL(triggered()), actionHelp_README, SLOT(do_send_string()));
314         connect(actionHelp_README, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
315         menuHelp_Readme->addAction(actionHelp_README);
316         
317         actionHelp_README_QT = new Action_Control(this);
318         actionHelp_README_QT->setObjectName(QString::fromUtf8("menuHelp_README_QT"));
319         actionHelp_README_QT->do_set_string(QString::fromUtf8("readme.qt.txt"));
320         menuHelp_Readme->addAction(actionHelp_README_QT);
321         connect(actionHelp_README_QT, SIGNAL(triggered()), actionHelp_README_QT, SLOT(do_send_string()));
322         connect(actionHelp_README_QT, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
323         actionHelp_README_Artane = new Action_Control(this);
324         actionHelp_README_Artane->setObjectName(QString::fromUtf8("menuHelp_README_Artane"));
325         actionHelp_README_Artane->do_set_string(QString::fromUtf8("readme_by_artane.txt"));
326         connect(actionHelp_README_Artane, SIGNAL(triggered()), actionHelp_README_Artane, SLOT(do_send_string()));
327         connect(actionHelp_README_Artane, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
328         menuHelp_Readme->addAction(actionHelp_README_Artane);
329         menuHelp_Readme->addSeparator();
330         
331         actionHelp_README_MR_TANAM = new Action_Control(this);
332         actionHelp_README_MR_TANAM->setObjectName(QString::fromUtf8("menuHelp_README_MR_TANAM"));
333         actionHelp_README_MR_TANAM->do_set_string(QString::fromUtf8("readme_by_mr_tanam.txt"));
334         connect(actionHelp_README_MR_TANAM, SIGNAL(triggered()), actionHelp_README_MR_TANAM, SLOT(do_send_string()));
335         connect(actionHelp_README_MR_TANAM, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
336         menuHelp_Readme->addAction(actionHelp_README_MR_TANAM);
337         
338         menuHelp_Readme->addSeparator();
339         
340         actionHelp_README_FM7 = new Action_Control(this);
341         actionHelp_README_FM7->setObjectName(QString::fromUtf8("menuHelp_README_FM7"));
342         actionHelp_README_FM7->do_set_string(QString::fromUtf8("readme_fm7.txt"));
343         connect(actionHelp_README_FM7, SIGNAL(triggered()), actionHelp_README_FM7, SLOT(do_send_string()));
344         connect(actionHelp_README_FM7, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
345         menuHelp_Readme->addAction(actionHelp_README_FM7);
346         
347         actionHelp_README_FM7_JP = new Action_Control(this);
348         actionHelp_README_FM7_JP->setObjectName(QString::fromUtf8("menuHelp_README_FM7_JP"));
349         actionHelp_README_FM7_JP->do_set_string(QString::fromUtf8("readme_fm7.jp.txt"));
350         connect(actionHelp_README_FM7_JP, SIGNAL(triggered()), actionHelp_README_FM7_JP, SLOT(do_send_string()));
351         connect(actionHelp_README_FM7_JP, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
352         menuHelp_Readme->addAction(actionHelp_README_FM7_JP);
353
354         menuHelp_Histories = new QMenu(menuHELP);
355         menuHelp_Histories->setObjectName(QString::fromUtf8("menuHelp_Histories"));;
356         menuHELP->addAction(menuHelp_Histories->menuAction());
357
358         actionHelp_History = new Action_Control(this);
359         actionHelp_History->setObjectName(QString::fromUtf8("menuHelp_History"));
360         actionHelp_History->do_set_string(QString::fromUtf8("history.txt"));
361         connect(actionHelp_History, SIGNAL(triggered()), actionHelp_History, SLOT(do_send_string()));
362         connect(actionHelp_History, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
363         menuHelp_Histories->addAction(actionHelp_History);
364         
365         actionHelp_History_Relnote = new Action_Control(this);
366         actionHelp_History_Relnote->setObjectName(QString::fromUtf8("menuHelp_History_Relnote"));
367         actionHelp_History_Relnote->do_set_string(QString::fromUtf8("RELEASENOTE.txt"));
368         connect(actionHelp_History_Relnote, SIGNAL(triggered()), actionHelp_History_Relnote, SLOT(do_send_string()));
369         connect(actionHelp_History_Relnote, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
370         menuHelp_Histories->addAction(actionHelp_History_Relnote);
371         
372         actionHelp_History_ChangeLog = new Action_Control(this);
373         actionHelp_History_ChangeLog->setObjectName(QString::fromUtf8("menuHelp_History_ChangeLog"));
374         actionHelp_History_ChangeLog->do_set_string(QString::fromUtf8("ChangeLog.txt"));
375         connect(actionHelp_History_ChangeLog, SIGNAL(triggered()), actionHelp_History_ChangeLog, SLOT(do_send_string()));
376         connect(actionHelp_History_ChangeLog, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
377         menuHelp_Histories->addAction(actionHelp_History_ChangeLog);
378
379         actionHelp_History_MR_TANAM = new Action_Control(this);
380         actionHelp_History_MR_TANAM->setObjectName(QString::fromUtf8("menuHelp_History_MR_TANAM"));
381         actionHelp_History_MR_TANAM->do_set_string(QString::fromUtf8("history_by_mr_tanam.txt"));
382         connect(actionHelp_History_MR_TANAM, SIGNAL(triggered()), actionHelp_History_MR_TANAM, SLOT(do_send_string()));
383         connect(actionHelp_History_MR_TANAM, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
384         menuHelp_Histories->addAction(actionHelp_History_MR_TANAM);
385         
386         actionHelp_License = new Action_Control(this);
387         actionHelp_License->setObjectName(QString::fromUtf8("menuHelp_License"));
388         actionHelp_License->do_set_string(QString::fromUtf8("LICENSE.txt"));
389         connect(actionHelp_License, SIGNAL(triggered()), actionHelp_License, SLOT(do_send_string()));
390         connect(actionHelp_License, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
391         menuHELP->addAction(actionHelp_License);
392         
393         actionHelp_License_JP = new Action_Control(this);
394         actionHelp_License_JP->setObjectName(QString::fromUtf8("menuHelp_License_JP"));
395         actionHelp_License_JP->do_set_string(QString::fromUtf8("LICENSE.ja.txt"));
396         connect(actionHelp_License_JP, SIGNAL(triggered()), actionHelp_License_JP, SLOT(do_send_string()));
397         connect(actionHelp_License_JP, SIGNAL(sig_send_string(QString)), this, SLOT(do_browse_document(QString)));
398         menuHELP->addAction(actionHelp_License_JP);
399         
400         if(config.window_mode <= 0) config.window_mode = 0;
401         if(config.window_mode >= _SCREEN_MODE_NUM) config.window_mode = _SCREEN_MODE_NUM - 1;
402         w = SCREEN_WIDTH;
403         h = SCREEN_HEIGHT;
404         if(actionScreenSize[config.window_mode] != NULL) {
405                 double nd = actionScreenSize[config.window_mode]->binds->getDoubleValue();
406                 w = (int)(nd * (double)w);
407                 h = (int)(nd * (double)h);
408 #if defined(USE_SCREEN_ROTATE)
409                 if(config.rotate_type) {
410                         int tmp_w = w;
411                         w = h;
412                         h = tmp_w;
413                 }
414 #endif     
415         } else {
416 #if defined(USE_SCREEN_ROTATE)
417                 if(config.rotate_type) {
418                         w = 600;
419                         h = 960;
420                 } else 
421 #endif
422                 {                  
423                         w = 1280;
424                         h = 800;
425                 }
426         }
427         graphicsView->setFixedSize(w, h);
428         for(int i = 0; i < _SCREEN_MODE_NUM; i++) {
429                 if(actionScreenSize[i] != NULL) {
430                         connect(actionScreenSize[i]->binds, SIGNAL(sig_screen_multiply(float)),
431                                 graphicsView, SLOT(do_set_screen_multiply(float)));
432                 }
433         }
434         this->set_screen_size(w, h);
435         this->set_screen_aspect(config.stretch_type);
436         if(actionScreenSize[config.window_mode] != NULL) {
437                 double nd = actionScreenSize[config.window_mode]->binds->getDoubleValue();
438                 graphicsView->do_set_screen_multiply(nd);
439         }
440            
441         QImageReader reader(":/default.ico");
442         QImage result = reader.read();
443         MainWindow->setWindowIcon(QPixmap::fromImage(result));
444         QMetaObject::connectSlotsByName(MainWindow);
445 } // setupUi
446
447
448 void Ui_MainWindow::retranslateUI_Help(void)
449 {
450         menuHELP->setTitle(QApplication::translate("MainWindow", "HELP", 0));
451         actionHelp_AboutQt->setText(QApplication::translate("MainWindow", "About Qt", 0));
452         actionAbout->setText(QApplication::translate("MainWindow", "About...", 0));
453
454         menuHelp_Readme->setTitle(QApplication::translate("MainWindow", "READMEs", 0));
455         
456         actionHelp_README->setText(QApplication::translate("MainWindow", "General Document", 0));
457         actionHelp_README_QT->setText(QApplication::translate("MainWindow", "About Qt ports", 0));
458         actionHelp_README_Artane->setText(QApplication::translate("MainWindow", "About Qt ports (Japanese).", 0));
459         actionHelp_README_MR_TANAM->setText(QApplication::translate("MainWindow", "By Mr. tanam", 0));
460         actionHelp_README_FM7->setText(QApplication::translate("MainWindow", "About eFM-7/8/77/AV.", 0));
461         actionHelp_README_FM7_JP->setText(QApplication::translate("MainWindow", "About eFM-7/8/77/AV (Japanese).", 0));
462
463         menuHelp_Histories->setTitle(QApplication::translate("MainWindow", "Histories", 0));
464         actionHelp_History->setText(QApplication::translate("MainWindow", "General History", 0));
465         actionHelp_History_Relnote->setText(QApplication::translate("MainWindow", "Release Note", 0));
466         actionHelp_History_ChangeLog->setText(QApplication::translate("MainWindow", "Change Log", 0));
467         actionHelp_History_MR_TANAM->setText(QApplication::translate("MainWindow", "History by Tanam", 0));
468
469         actionHelp_License->setText(QApplication::translate("MainWindow", "Show License", 0));
470         actionHelp_License_JP->setText(QApplication::translate("MainWindow", "Show License (Japanese)", 0));
471         
472 }
473
474 // You can Override this function: Re-define on foo/MainWindow.cpp.
475 // This code is example: by X1(TurboZ).
476 void Ui_MainWindow::retranslateMachineMenu(void)
477 {
478         int i;
479         QString tmps;
480         QString tmps2;
481 #if defined(USE_DEVICE_TYPE)
482         menuDeviceType->setTitle(QApplication::translate("MainWindow", "Device Type", 0));
483         for(i = 0; i < USE_DEVICE_TYPE; i++) {
484                 tmps2.setNum(i + 1);
485                 tmps = QString::fromUtf8("Machine Device ") + tmps2;
486                 actionDeviceType[i]->setText(tmps); 
487         }
488 #endif
489 #if defined(USE_SOUND_DEVICE_TYPE)
490         menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Cards", 0));
491         for(i = 0; i < USE_SOUND_DEVICE_TYPE; i++) {
492                 tmps2.setNum(i + 1);
493                 tmps = QString::fromUtf8("Sound Device ") + tmps2;
494                 actionSoundDevice[i]->setText(tmps); 
495         }
496 #endif
497 #if defined(USE_DRIVE_TYPE)
498         menuDriveType->setTitle(QApplication::translate("MainWindow", "Drive Type", 0));
499         for(i = 0; i < USE_DRIVE_TYPE; i++) {
500                 tmps2.setNum(i + 1);
501                 tmps = QString::fromUtf8("Drive Type ") + tmps2;
502                 actionDriveType[i]->setText(tmps); 
503         }
504 #endif
505 #if defined(USE_PRINTER)
506         menuPrintDevice->setTitle(QApplication::translate("MainWindow", "Printer (Need RESET)", 0));
507         i = 1;
508         actionPrintDevice[0]->setText(QApplication::translate("MainWindow", "Dump to File", 0));
509   #if defined(USE_PRINTER_TYPE)
510         for(i = 1; i < (USE_PRINTER_TYPE - 1); i++) {
511                 tmps2.setNum(i + 1);
512                 tmps = QApplication::translate("MainWindow", "Printer", 0) + tmps2;
513                 actionPrintDevice[i]->setText(tmps); 
514         }
515    #endif
516         actionPrintDevice[i]->setText(QApplication::translate("MainWindow", "Not connect", 0));
517 #endif
518 }
519 void Ui_MainWindow::retranslateUi(void)
520 {
521         retranslateControlMenu("NMI Reset",  true);
522         retranslateFloppyMenu(0, 0);
523         retranslateFloppyMenu(1, 1);
524         retranslateCMTMenu();
525 #if !defined(WITHOUT_SOUND)     
526         retranslateSoundMenu();
527 #endif   
528         retranslateScreenMenu();
529         retranslateCartMenu(0, 1);
530         retranslateCartMenu(1, 2);
531         retranslateBinaryMenu(0, 1);
532         retranslateBinaryMenu(1, 2);
533         retranslateMachineMenu();
534         retranslateUI_Help();
535    
536         this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
537
538
539         menuEmulator->setTitle(QApplication::translate("MainWindow", "Emulator", 0));
540         menuMachine->setTitle(QApplication::translate("MainWindow", "Machine", 0));
541 } // retranslateUi
542
543 void Ui_MainWindow::setCoreApplication(QApplication *p)
544 {
545         this->CoreApplication = p;
546         connect(actionExit_Emulator, SIGNAL(triggered()),
547                         this->CoreApplication, SLOT(closeAllWindows())); // OnGuiExit()?  
548         connect(actionHelp_AboutQt, SIGNAL(triggered()),
549                         this->CoreApplication, SLOT(aboutQt()));
550         
551 }
552 QT_END_NAMESPACE