• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revision5b195572032f2fb9be47722dff19a5610643672d (tree)
Time2018-05-27 23:43:57
AuthorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[UI][Qt] Update UI.

Change Summary

Incremental Difference

--- a/source/src/qt/common/CMakeLists.txt
+++ b/source/src/qt/common/CMakeLists.txt
@@ -26,6 +26,7 @@ set(QT_COMMON_BASE
2626 emu_thread.cpp
2727 emu_thread_slots.cpp
2828 util_fd2.cpp
29+ util_hdd2.cpp
2930 # util_bubble2.cpp
3031 util_main.cpp
3132 ../osd.cpp
--- a/source/src/qt/common/emu_thread.h
+++ b/source/src/qt/common/emu_thread.h
@@ -75,6 +75,8 @@ public slots:
7575 void do_write_protect_disk(int drv, bool flag);
7676 void do_close_disk(int);
7777 void do_open_disk(int, QString, int);
78+ void do_close_hard_disk(int);
79+ void do_open_hard_disk(int, QString);
7880 void do_play_tape(int drv, QString name);
7981 void do_rec_tape(int drv, QString name);
8082 void do_close_tape(int drv);
@@ -89,10 +91,10 @@ public slots:
8991 void do_open_quickdisk(int drv, QString path);
9092 void do_close_cart(int drv);
9193 void do_open_cart(int drv, QString path);
92- void do_close_laser_disc(void);
93- void do_open_laser_disc(QString path);
94- void do_eject_cdrom(void);
95- void do_open_cdrom(QString path);
94+ void do_close_laser_disc(int drv, );
95+ void do_open_laser_disc(int drv, QString path);
96+ void do_eject_cdrom(int drv);
97+ void do_open_cdrom(int drv, QString path);
9698 void do_load_binary(int drv, QString path);
9799 void do_save_binary(int drv, QString path);
98100 void do_write_protect_bubble_casette(int drv, bool flag);
@@ -103,9 +105,6 @@ public slots:
103105 void set_romakana(bool flag);
104106 void do_close_debugger(void);
105107
106- void do_close_hard_disk(int);
107- void do_open_hard_disk(int, QString);
108-
109108 signals:
110109 int sig_set_draw_fps(double);
111110 int sig_draw_one_turn(bool);
--- a/source/src/qt/common/emu_thread_slots.cpp
+++ b/source/src/qt/common/emu_thread_slots.cpp
@@ -634,16 +634,30 @@ void EmuThreadClass::do_open_quickdisk(int drv, QString path)
634634 #endif
635635 }
636636
637-void EmuThreadClass::do_open_cdrom(QString path)
637+void EmuThreadClass::do_open_cdrom(int drv, QString path)
638638 {
639639 #ifdef USE_COMPACT_DISC
640- p_emu->open_compact_disc(path.toLocal8Bit().constData());
640+ p_emu->open_compact_disc(drv, path.toLocal8Bit().constData());
641641 #endif
642642 }
643-void EmuThreadClass::do_eject_cdrom(void)
643+void EmuThreadClass::do_eject_cdrom(int drv)
644644 {
645645 #ifdef USE_COMPACT_DISC
646- p_emu->close_compact_disc();
646+ p_emu->close_compact_disc(drv);
647+#endif
648+}
649+
650+void EmuThreadClass::do_close_hard_disk(int drv)
651+{
652+#ifdef USE_HARD_DISK
653+ p_emu->close_hard_disk(drv);
654+#endif
655+}
656+
657+void EmuThreadClass::do_open_hard_disk(int drv, QString path)
658+{
659+#ifdef USE_HARD_DISK
660+ p_emu->open_hard_disk(drv, path.toLocal8Bit().constData());
647661 #endif
648662 }
649663
@@ -662,17 +676,17 @@ void EmuThreadClass::do_open_cart(int drv, QString path)
662676 }
663677
664678
665-void EmuThreadClass::do_close_laser_disc(void)
679+void EmuThreadClass::do_close_laser_disc(int drv)
666680 {
667681 #ifdef USE_LASER_DISC
668- p_emu->close_laser_disc();
682+ p_emu->close_laser_disc(drv);
669683 #endif
670684 }
671685
672-void EmuThreadClass::do_open_laser_disc(QString path)
686+void EmuThreadClass::do_open_laser_disc(int drv, QString path)
673687 {
674688 #ifdef USE_LASER_DISC
675- p_emu->open_laser_disc(path.toLocal8Bit().constData());
689+ p_emu->open_laser_disc(drv, path.toLocal8Bit().constData());
676690 #endif
677691 }
678692
@@ -771,18 +785,3 @@ bool EmuThreadClass::now_debugging() {
771785 #endif
772786 }
773787
774-void EmuThreadClass::do_close_hard_disk(int drv)
775-{
776-#ifdef USE_HARD_DISK
777- p_emu->close_hard_disk(drv);
778-#endif
779-}
780-
781-void EmuThreadClass::do_open_hard_disk(int drv, QString path)
782-{
783-#ifdef USE_HARD_DISK
784- QByteArray localPath = path.toLocal8Bit();
785- p_emu->open_hard_disk(drv, localPath.constData(), bank);
786- emit sig_update_recent_hard_disk(drv);
787-#endif
788-}
--- a/source/src/qt/common/qt_utils.cpp
+++ b/source/src/qt/common/qt_utils.cpp
@@ -156,16 +156,10 @@ void Ui_MainWindow::LaunchEmuThread(void)
156156 }
157157 #endif
158158 #if defined(USE_HARD_DISK)
159- connect(this, SIGNAL(sig_open_disk(int, QString, int)), hRunEmu, SLOT(do_open_disk(int, QString, int)));
160- connect(this, SIGNAL(sig_close_disk(int)), hRunEmu, SLOT(do_close_disk(int)));
161- connect(hRunEmu, SIGNAL(sig_update_recent_disk(int)), this, SLOT(do_update_recent_disk(int)));
159+ connect(this, SIGNAL(sig_open_hard_disk(int, QString)), hRunEmu, SLOT(do_open_hard_disk(int, QString)));
160+ connect(this, SIGNAL(sig_close_hard_disk(int)), hRunEmu, SLOT(do_close_hard_disk(int)));
161+ connect(hRunEmu, SIGNAL(sig_update_recent_hard_disk(int)), this, SLOT(do_update_recent_hard_disk(int)));
162162 //connect(hRunEmu, SIGNAL(sig_change_osd_fd(int, QString)), this, SLOT(do_change_osd_fd(int, QString)));
163- drvs = USE_FHARD_DISK;
164- for(int ii = 0; ii < drvs; ii++) {
165- menu_fds[ii]->setEmu(emu);
166- connect(menu_hdds[ii], SIGNAL(sig_update_inner_hdd(int ,QStringList , class Action_Control **, QStringList , int, bool)),
167- this, SLOT(do_update_inner_hdd(int ,QStringList , class Action_Control **, QStringList , int, bool)));
168- }
169163 #endif
170164 #if defined(USE_TAPE)
171165 connect(this, SIGNAL(sig_play_tape(int, QString)), hRunEmu, SLOT(do_play_tape(int, QString)));
@@ -192,14 +186,14 @@ void Ui_MainWindow::LaunchEmuThread(void)
192186 connect(this, SIGNAL(sig_close_cart(int)), hRunEmu, SLOT(do_close_cart(int)));
193187 #endif
194188 #if defined(USE_COMPACT_DISC)
195- connect(this, SIGNAL(sig_open_cdrom(QString)), hRunEmu, SLOT(do_open_cdrom(QString)));
196- connect(this, SIGNAL(sig_close_cdrom()), hRunEmu, SLOT(do_eject_cdrom()));
189+ connect(this, SIGNAL(sig_open_cdrom(int, QString)), hRunEmu, SLOT(do_open_cdrom(int, QString)));
190+ connect(this, SIGNAL(sig_close_cdrom(int)), hRunEmu, SLOT(do_eject_cdrom(int)));
197191 //connect(hRunEmu, SIGNAL(sig_change_osd_cdrom(QString)), this, SLOT(do_change_osd_cdrom(QString)));
198192 // ToDo: multiple CDs
199193 #endif
200194 #if defined(USE_LASER_DISC)
201- connect(this, SIGNAL(sig_open_laserdisc(QString)), hRunEmu, SLOT(do_open_laser_disc(QString)));
202- connect(this, SIGNAL(sig_close_laserdisc(void)), hRunEmu, SLOT(do_close_laser_disc(void)));
195+ connect(this, SIGNAL(sig_open_laserdisc(int, QString)), hRunEmu, SLOT(do_open_laser_disc(int, QString)));
196+ connect(this, SIGNAL(sig_close_laserdisc(int)), hRunEmu, SLOT(do_close_laser_disc(int)));
203197 // ToDo: multiple LDs
204198 #endif
205199 #if defined(USE_BINARY_FILE)
--- a/source/src/qt/common/util_fd2.cpp
+++ b/source/src/qt/common/util_fd2.cpp
@@ -144,55 +144,3 @@ void Ui_MainWindow::_open_disk(int drv, const QString fname)
144144
145145 #endif
146146
147-#if defined(USE_HARD_DISK)
148-void Ui_MainWindow::do_update_recent_hard_disk(int drv)
149-{
150- if(emu == NULL) return;
151- menu_hdds[drv]->do_update_histories(listHDDs[drv]);
152- menu_hdds[drv]->do_set_initialize_directory(p_config->initial_hard_disk_dir);
153-}
154-
155-int Ui_MainWindow::set_recent_hard_disk(int drv, int num)
156-{
157- QString s_path;
158- char path_shadow[PATH_MAX];
159- if((num < 0) || (num >= MAX_HISTORY)) return -1;
160- s_path = QString::fromLocal8Bit(p_config->recent_hard_disk_path[drv][num]);
161- strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX);
162- UPDATE_HISTORY(path_shadow, p_config->recent_hard_disk_path[drv], listHDDs[drv]);
163-
164- strncpy(p_config->initial_hard_disk_dir, get_parent_dir((const _TCHAR *)path_shadow), _MAX_PATH);
165- strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX);
166-
167- if(emu) {
168- emit sig_close_hard_disk(drv);
169- emit sig_open_hard_disk(drv, s_path, 0);
170- menu_hdds[drv]->do_update_histories(listHDDs[drv]);
171- menu_hdds[drv]->do_set_initialize_directory(p_config->initial_hard_disk_dir);
172- menu_hdds[drv]->do_clear_inner_media();
173- }
174- return 0;
175-}
176-
177-void Ui_MainWindow::_open_hard_disk(int drv, const QString fname)
178-{
179- char path_shadow[PATH_MAX];
180-
181- if(fname.length() <= 0) return;
182- drv = drv & 7;
183- strncpy(path_shadow, fname.toLocal8Bit().constData(), PATH_MAX);
184- UPDATE_HISTORY(path_shadow, p_config->recent_hard_disk_path[drv], listHDDs[drv]);
185- strcpy(p_config->initial_floppy_disk_dir, get_parent_dir((const _TCHAR *)path_shadow));
186- // Update List
187- strncpy(path_shadow, fname.toLocal8Bit().constData(), PATH_MAX);
188- if(emu) {
189- emit sig_close_hard_disk(drv);
190- //emu->LockVM();
191- emit sig_open_hard_disk(drv, fname, 0);
192- menu_hdds[drv]->do_update_histories(listHDDs[drv]);
193- menu_hdds[drv]->do_set_initialize_directory(p_config->initial_hard_disk_dir);
194- menu_hdds[drv]->do_clear_inner_media();
195- }
196-}
197-
198-#endif
--- /dev/null
+++ b/source/src/qt/common/util_hdd2.cpp
@@ -0,0 +1,65 @@
1+#include "mainwidget.h"
2+#include "commonclasses.h"
3+#include "menu_harddisk.h"
4+
5+#include "qt_dialogs.h"
6+#include "emu.h"
7+//#include "csp_logger.h"
8+
9+#include "menu_flags.h"
10+
11+//extern USING_FLAGS *using_flags;
12+extern class EMU *emu;
13+
14+#if defined(USE_HARD_DISK)
15+void Ui_MainWindow::do_update_recent_hard_disk(int drv)
16+{
17+ if(emu == NULL) return;
18+ menu_hdds[drv]->do_update_histories(listHDDs[drv]);
19+ menu_hdds[drv]->do_set_initialize_directory(p_config->initial_hard_disk_dir);
20+}
21+
22+int Ui_MainWindow::set_recent_hard_disk(int drv, int num)
23+{
24+ QString s_path;
25+ char path_shadow[PATH_MAX];
26+ if((num < 0) || (num >= MAX_HISTORY)) return -1;
27+ s_path = QString::fromLocal8Bit(p_config->recent_hard_disk_path[drv][num]);
28+ strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX);
29+ UPDATE_HISTORY(path_shadow, p_config->recent_hard_disk_path[drv], listHDDs[drv]);
30+
31+ strncpy(p_config->initial_hard_disk_dir, get_parent_dir((const _TCHAR *)path_shadow), _MAX_PATH);
32+ strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX);
33+
34+ if(emu) {
35+ emit sig_close_hard_disk(drv);
36+ emit sig_open_hard_disk(drv, s_path, 0);
37+ menu_hdds[drv]->do_update_histories(listHDDs[drv]);
38+ menu_hdds[drv]->do_set_initialize_directory(p_config->initial_hard_disk_dir);
39+ menu_hdds[drv]->do_clear_inner_media();
40+ }
41+ return 0;
42+}
43+
44+void Ui_MainWindow::_open_hard_disk(int drv, const QString fname)
45+{
46+ char path_shadow[PATH_MAX];
47+
48+ if(fname.length() <= 0) return;
49+ drv = drv & 7;
50+ strncpy(path_shadow, fname.toLocal8Bit().constData(), PATH_MAX);
51+ UPDATE_HISTORY(path_shadow, p_config->recent_hard_disk_path[drv], listHDDs[drv]);
52+ strcpy(p_config->initial_floppy_disk_dir, get_parent_dir((const _TCHAR *)path_shadow));
53+ // Update List
54+ strncpy(path_shadow, fname.toLocal8Bit().constData(), PATH_MAX);
55+ if(emu) {
56+ emit sig_close_hard_disk(drv);
57+ //emu->LockVM();
58+ emit sig_open_hard_disk(drv, fname, 0);
59+ menu_hdds[drv]->do_update_histories(listHDDs[drv]);
60+ menu_hdds[drv]->do_set_initialize_directory(p_config->initial_hard_disk_dir);
61+ menu_hdds[drv]->do_clear_inner_media();
62+ }
63+}
64+
65+#endif
--- a/source/src/qt/gui/CMakeLists.txt
+++ b/source/src/qt/gui/CMakeLists.txt
@@ -19,6 +19,7 @@ set(s_qt_gui_headers
1919 mainwidget_base.h
2020 menu_metaclass.h
2121 menu_disk.h
22+ menu_harddisk.h
2223 menu_cmt.h
2324 menu_cart.h
2425 menu_quickdisk.h
@@ -68,6 +69,7 @@ set(s_qt_gui_srcs
6869 menu_control.cpp
6970 menu_metaclass.cpp
7071 menu_disk.cpp
72+ menu_harddisk.cpp
7173 menu_quickdisk.cpp
7274 menu_compactdisc.cpp
7375 menu_laserdisc.cpp
@@ -80,6 +82,7 @@ set(s_qt_gui_srcs
8082 menu_screen.cpp
8183 mainwindow_utils.cpp
8284 util_fd.cpp
85+ util_hdd.cpp
8386 util_cd.cpp
8487 util_ld.cpp
8588 util_cmt.cpp
--- a/source/src/qt/gui/commonclasses.h
+++ b/source/src/qt/gui/commonclasses.h
@@ -107,10 +107,6 @@ public slots:
107107 void insert_binary_load(void);
108108 void insert_binary_save(void);
109109
110- void insert_cdrom(void);
111- void eject_cdrom(void);
112- void on_recent_cdrom();
113-
114110 void insert_laserdisc(void);
115111 void eject_laserdisc(void);
116112 void on_recent_laserdisc();
@@ -149,8 +145,6 @@ signals:
149145 int sig_eject_Qd(int);
150146 int sig_insert_Qd(int);
151147
152- int sig_insert_cdrom(bool);
153- int sig_eject_cdrom(void);
154148 int sig_recent_cdrom(int);
155149
156150 int sig_insert_laserdisc(bool);
--- a/source/src/qt/gui/mainwidget_base.h
+++ b/source/src/qt/gui/mainwidget_base.h
@@ -7,15 +7,15 @@
77 #ifndef _CSP_QT_MAINWIDGET_BASE_H
88 #define _CSP_QT_MAINWIDGET_BASE_H
99
10-#include <QVariant>
11-#include <QObject>
12-#include <QApplication>
10+//#include <QVariant>
11+//#include <QObject>
12+//#include <QApplication>
1313 #include <QMainWindow>
1414 #include <QIcon>
1515 #include <QString>
1616 #include <QStringList>
17-#include <QMenu>
18-#include <QMenuBar>
17+//#include <QMenu>
18+//#include <QMenuBar>
1919
2020 #include "common.h"
2121 #include "config.h"
@@ -101,6 +101,9 @@ class QButtonGroup;
101101 class QGraphicsView;
102102 class QGraphicsScene;
103103 class QHeaderView;
104+class QMenu;
105+class QMenuBar;
106+class QApplication;
104107
105108 class QStatusBar;
106109 class QWidget;
@@ -118,6 +121,7 @@ class Menu_MetaClass;
118121 class Menu_FDClass;
119122 class Menu_CMTClass;
120123 class Menu_CartClass;
124+class Menu_HDDClass;
121125 class Menu_QDClass;
122126 class Menu_BinaryClass;
123127 class Menu_BubbleClass;
@@ -253,7 +257,11 @@ private:
253257 void CreateFloppyMenu(int drv, int drv_base);
254258 void CreateFloppyPulldownMenu(int drv);
255259 void ConfigFloppyMenuSub(int drv);
256- // Bubble
260+
261+ void CreateHardDiskMenu(int drv, int drv_base);
262+ void CreateHardDiskPulldownMenu(int drv);
263+ void ConfigHardDiskMenuSub(int drv);
264+// Bubble
257265 void CreateBubbleMenu(int drv, int drv_base);
258266 void CreateBubblePulldownMenu(int drv);
259267 void ConfigBubbleMenuSub(int drv);
@@ -264,7 +272,7 @@ private:
264272 virtual QString GetBubbleB77FileName(int drv) { return QString::fromUtf8(""); }
265273 virtual QString GetBubbleB77BubbleName(int drv, int num) { return QString::fromUtf8(""); }
266274
267- void CreateCMTMenu(int drive);
275+ void CreateCMTMenu(int drive, int drv_base);
268276 void ConfigCMTMenu(void);
269277
270278 void ConfigQuickDiskMenu(void);
@@ -277,12 +285,12 @@ private:
277285 void ConfigCartMenuSub(int drv);
278286 void ConfigCartMenu(void);
279287
280- void CreateCDROMMenu(void);
288+ void CreateCDROMMenu(int drv, int drv_base);
281289 void ConfigCDROMMenu(void);
282290 void ConfigCDROMMenuSub(void);
283291 void CreateCDROMPulldownMenu(void);
284292
285- void CreateLaserdiscMenu(void);
293+ void CreateLaserdiscMenu(int drv, int drv_base);
286294 void ConfigLaserdiscMenu(void);
287295 void ConfigLaserdiscMenuSub(void);
288296 void CreateLaserdiscPulldownMenu(void);
@@ -324,10 +332,12 @@ protected:
324332 QStringList listQDs[8];
325333 QStringList listCMT[8];
326334 bool cmt_write_protect[8];
327- QStringList listCDROM;
328- QStringList listLaserdisc;
335+ QStringList listCDROM[8];
336+ QStringList listLaserdisc[8];
329337 QStringList listBINs[8];
330338 QStringList listFDs[16];
339+ QStringList listHDDs[16];
340+
331341 QStringList listD88[16];
332342 QStringList listBubbles[8];
333343 QStringList listB77[8];
@@ -413,8 +423,9 @@ protected:
413423 Menu_FDClass *menu_fds[16];
414424 Menu_QDClass *menu_QDs[8];
415425 Menu_CMTClass *menu_CMT[8];
416- Menu_CompactDiscClass *menu_CDROM;
417- Menu_LaserdiscClass *menu_Laserdisc;
426+ Menu_HDDClass *menu_hdds[16];
427+ Menu_CompactDiscClass *menu_CDROM[8];
428+ Menu_LaserdiscClass *menu_Laserdisc[8];
418429 Menu_CartClass *menu_Cart[8];
419430 Menu_BinaryClass *menu_BINs[8];
420431 Menu_BubbleClass *menu_bubbles[8];
@@ -448,6 +459,8 @@ protected:
448459 void retranslateControlMenu(const char *SpecialResetTitle, bool WithSpecialReset);
449460 void retranslateFloppyMenu(int drv, int basedrv);
450461 void retranslateFloppyMenu(int drv, int basedrv, QString specName);
462+ void retranslateHardDiskMenu(int drv, int basedrv);
463+ void retranslateHardDiskMenu(int drv, int basedrv, QString specName);
451464 void retranslateBubbleMenu(int drv, int basedrv);
452465 void retranslateCMTMenu(int drive);
453466 void retranslateQuickDiskMenu(int drv, int basedrv);
@@ -596,6 +609,9 @@ public slots:
596609 virtual int set_recent_disk(int, int);
597610
598611 virtual void do_update_recent_hard_disk(int);
612+ virtual void _open_hard_disk(int drv, const QString fname);
613+ void eject_hard_disk(int drv);
614+ virtual int set_recent_hard_disk(int, int);
599615 // Bubble Casette
600616 int write_protect_bubble(int drv, bool flag);
601617
@@ -695,6 +711,8 @@ signals:
695711 int sig_write_protect_disk(int drv, bool flag);
696712 int sig_open_disk(int, QString, int);
697713 int sig_close_disk(int);
714+ int sig_open_hard_disk(int, QString);
715+ int sig_close_hard_disk(int);
698716 int sig_play_tape(int ,QString);
699717 int sig_rec_tape(int, QString);
700718 int sig_close_tape(int);
@@ -710,9 +728,9 @@ signals:
710728 int sig_close_cart(int drv);
711729 int sig_open_cart(int drv, QString path);
712730 int sig_open_cdrom(QString path);
713- int sig_close_cdrom(void);
714- int sig_close_laserdisc(void);
715- int sig_open_laserdisc(QString path);
731+ int sig_close_cdrom(int drv);
732+ int sig_close_laserdisc(int drv);
733+ int sig_open_laserdisc(int drv, QString path);
716734 int sig_load_binary(int drv, QString path);
717735 int sig_save_binary(int drv, QString path);
718736 int sig_write_protect_bubble(int, bool);
--- a/source/src/qt/gui/menu_binary.cpp
+++ b/source/src/qt/gui/menu_binary.cpp
@@ -13,7 +13,7 @@
1313 #include "qt_dialogs.h"
1414
1515
16-Menu_BinaryClass::Menu_BinaryClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : Menu_MetaClass(root_entry, desc, p, parent, drv)
16+Menu_BinaryClass::Menu_BinaryClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
1717 {
1818 use_write_protect = false;
1919 use_d88_menus = false;
--- a/source/src/qt/gui/menu_binary.h
+++ b/source/src/qt/gui/menu_binary.h
@@ -21,7 +21,7 @@ protected:
2121
2222 QMenu *menu_history_save;
2323 public:
24- Menu_BinaryClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
24+ Menu_BinaryClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
2525 ~Menu_BinaryClass();
2626 void create_pulldown_menu_device_sub();
2727 void connect_menu_device_sub(void);
--- a/source/src/qt/gui/menu_bubble.cpp
+++ b/source/src/qt/gui/menu_bubble.cpp
@@ -12,11 +12,10 @@
1212
1313 #include "qt_dialogs.h"
1414
15-Menu_BubbleClass::Menu_BubbleClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : Menu_MetaClass(root_entry, desc, p, parent, drv)
15+Menu_BubbleClass::Menu_BubbleClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
1616 {
1717 use_write_protect = true;
1818 use_d88_menus = true;
19- //icon_bubble_casette = QIcon(":/icon_floppy.png");
2019 }
2120
2221 Menu_BubbleClass::~Menu_BubbleClass()
@@ -38,6 +37,6 @@ void Menu_BubbleClass::connect_menu_device_sub(void)
3837
3938 void Menu_BubbleClass::retranslate_pulldown_menu_device_sub(void)
4039 {
41- //action_insert->setIcon(icon_floppy);
40+
4241 }
4342
--- a/source/src/qt/gui/menu_bubble.h
+++ b/source/src/qt/gui/menu_bubble.h
@@ -17,7 +17,7 @@ class DLL_PREFIX Menu_BubbleClass: public Menu_MetaClass {
1717 protected:
1818 //QIcon icon_bubble_casette;
1919 public:
20- Menu_BubbleClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
20+ Menu_BubbleClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
2121 ~Menu_BubbleClass();
2222 void create_pulldown_menu_device_sub();
2323 void connect_menu_device_sub(void);
--- a/source/src/qt/gui/menu_cart.cpp
+++ b/source/src/qt/gui/menu_cart.cpp
@@ -18,7 +18,7 @@
1818 //#include "csp_logger.h"
1919
2020
21-Menu_CartClass::Menu_CartClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : Menu_MetaClass(root_entry, desc, p, parent, drv)
21+Menu_CartClass::Menu_CartClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
2222 {
2323 use_write_protect = false;
2424 use_d88_menus = false;
--- a/source/src/qt/gui/menu_cart.h
+++ b/source/src/qt/gui/menu_cart.h
@@ -16,7 +16,7 @@ class DLL_PREFIX Menu_CartClass: public Menu_MetaClass {
1616 Q_OBJECT
1717 protected:
1818 public:
19- Menu_CartClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
19+ Menu_CartClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
2020 ~Menu_CartClass();
2121 void create_pulldown_menu_device_sub();
2222 void connect_menu_device_sub(void);
--- a/source/src/qt/gui/menu_cmt.cpp
+++ b/source/src/qt/gui/menu_cmt.cpp
@@ -14,7 +14,7 @@
1414 //#include "emu.h"
1515
1616
17-Menu_CMTClass::Menu_CMTClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : Menu_MetaClass(root_entry, desc, p, parent, drv)
17+Menu_CMTClass::Menu_CMTClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
1818 {
1919 use_write_protect = true;
2020 use_d88_menus = false;
--- a/source/src/qt/gui/menu_cmt.h
+++ b/source/src/qt/gui/menu_cmt.h
@@ -40,7 +40,7 @@ protected:
4040 QIcon icon_record_to_wav;
4141
4242 public:
43- Menu_CMTClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
43+ Menu_CMTClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
4444 ~Menu_CMTClass();
4545 void create_pulldown_menu_device_sub();
4646 void connect_menu_device_sub(void);
--- a/source/src/qt/gui/menu_compactdisc.cpp
+++ b/source/src/qt/gui/menu_compactdisc.cpp
@@ -14,7 +14,7 @@
1414 //#include "emu.h"
1515
1616
17-Menu_CompactDiscClass::Menu_CompactDiscClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : Menu_MetaClass(root_entry, desc, p, parent, drv)
17+Menu_CompactDiscClass::Menu_CompactDiscClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
1818 {
1919 use_write_protect = false;
2020 use_d88_menus = false;
--- a/source/src/qt/gui/menu_compactdisc.h
+++ b/source/src/qt/gui/menu_compactdisc.h
@@ -16,7 +16,7 @@ class DLL_PREFIX Menu_CompactDiscClass: public Menu_MetaClass {
1616 Q_OBJECT
1717 protected:
1818 public:
19- Menu_CompactDiscClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
19+ Menu_CompactDiscClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
2020 ~Menu_CompactDiscClass();
2121 void create_pulldown_menu_device_sub();
2222 void connect_menu_device_sub(void);
--- a/source/src/qt/gui/menu_disk.cpp
+++ b/source/src/qt/gui/menu_disk.cpp
@@ -13,7 +13,7 @@
1313 //#include "emu.h"
1414
1515
16-Menu_FDClass::Menu_FDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : Menu_MetaClass(root_entry, desc, p, parent, drv)
16+Menu_FDClass::Menu_FDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
1717 {
1818 use_write_protect = true;
1919 use_d88_menus = true;
--- a/source/src/qt/gui/menu_disk.h
+++ b/source/src/qt/gui/menu_disk.h
@@ -21,7 +21,7 @@ protected:
2121 class Action_Control *action_count_immediate;
2222 QIcon icon_floppy;
2323 public:
24- Menu_FDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
24+ Menu_FDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
2525 ~Menu_FDClass();
2626 void create_pulldown_menu_device_sub();
2727 void connect_menu_device_sub(void);
--- a/source/src/qt/gui/menu_flags.h
+++ b/source/src/qt/gui/menu_flags.h
@@ -233,7 +233,7 @@ public:
233233 bool is_use_fd() { return use_fd; }
234234 int get_max_drive() { return max_drive; }
235235 int get_max_d88_banks() { return max_d88_banks; }
236- int get_base_floppy_num() { return base_fd_num; }
236+ int get_base_floppy_disk_num() { return base_fd_num; }
237237
238238 bool is_use_joystick() { return use_joystick; }
239239 bool is_use_joy_button_captions() { return use_joy_button_captions; }
@@ -273,6 +273,7 @@ public:
273273
274274 bool is_use_qd() { return use_qd; }
275275 int get_max_qd() { return max_qd; }
276+ int get_base_quick_disk_num() { return base_qd_num; }
276277
277278 bool is_use_scanline() { return use_scanline; }
278279 bool is_use_screen_rotate() { return use_screen_rotate; }
--- /dev/null
+++ b/source/src/qt/gui/menu_harddisk.cpp
@@ -0,0 +1,43 @@
1+/*
2+ * Qt / DIsk Menu, Utilities
3+ * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
4+ * LIcense: GPLv2
5+ * History: Jan 10, 2015 (MAYBE) : Initial.
6+ */
7+
8+#include "commonclasses.h"
9+#include "mainwidget_base.h"
10+#include "menu_harddisk.h"
11+
12+#include "qt_dialogs.h"
13+//#include "emu.h"
14+
15+
16+Menu_HDDClass::Menu_HDDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
17+{
18+}
19+
20+Menu_HDDClass::~Menu_HDDClass()
21+{
22+}
23+
24+void Menu_HDDClass::create_pulldown_menu_device_sub(void)
25+{
26+}
27+
28+
29+void Menu_HDDClass::connect_menu_device_sub(void)
30+{
31+ this->addSeparator();
32+
33+ connect(this, SIGNAL(sig_open_media(int, QString)), p_wid, SLOT(_open_hard_disk(int, QString)));
34+ connect(this, SIGNAL(sig_eject_media(int)), p_wid, SLOT(eject_hard_disk(int)));
35+}
36+
37+void Menu_HDDClass::retranslate_pulldown_menu_device_sub(void)
38+{
39+ action_insert->setIcon(icon_floppy);
40+ action_insert->setToolTip(QApplication::translate("MenuMedia", "Connect virtual hard disk file.", 0));
41+ action_eject->setToolTip(QApplication::translate("MenuMedia", "Disconnect virtual hard disk.", 0));
42+
43+}
--- /dev/null
+++ b/source/src/qt/gui/menu_harddisk.h
@@ -0,0 +1,29 @@
1+
2+/*
3+ * Menu_MetaClass : Defines
4+ * (C) 2015 by K.Ohta <whatisthis.sowhat _at_ gmail.com>
5+ * Please use this file as templete.
6+ */
7+
8+
9+#ifndef _CSP_QT_MENU_HDD_CLASSES_H
10+#define _CSP_QT_MENU_HDD_CLASSES_H
11+
12+#include "menu_metaclass.h"
13+
14+QT_BEGIN_NAMESPACE
15+
16+class DLL_PREFIX Menu_HDDClass: public Menu_MetaClass {
17+ Q_OBJECT
18+protected:
19+public:
20+ Menu_HDDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
21+ ~Menu_HDDClass();
22+ void create_pulldown_menu_device_sub();
23+ void connect_menu_device_sub(void);
24+ void retranslate_pulldown_menu_device_sub(void);
25+};
26+
27+QT_END_NAMESPACE
28+
29+#endif
--- a/source/src/qt/gui/menu_laserdisc.cpp
+++ b/source/src/qt/gui/menu_laserdisc.cpp
@@ -14,7 +14,7 @@
1414 //#include "emu.h"
1515
1616
17-Menu_LaserdiscClass::Menu_LaserdiscClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : Menu_MetaClass(root_entry, desc, p, parent, drv)
17+Menu_LaserdiscClass::Menu_LaserdiscClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
1818 {
1919 use_write_protect = false;
2020 use_d88_menus = false;
--- a/source/src/qt/gui/menu_laserdisc.h
+++ b/source/src/qt/gui/menu_laserdisc.h
@@ -16,7 +16,7 @@ class DLL_PREFIX Menu_LaserdiscClass: public Menu_MetaClass {
1616 Q_OBJECT
1717 protected:
1818 public:
19- Menu_LaserdiscClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
19+ Menu_LaserdiscClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
2020 ~Menu_LaserdiscClass();
2121 void create_pulldown_menu_device_sub();
2222 void connect_menu_device_sub(void);
--- a/source/src/qt/gui/menu_main.cpp
+++ b/source/src/qt/gui/menu_main.cpp
@@ -298,6 +298,7 @@ void Ui_MainWindowBase::setupUi(void)
298298 //MainWindow->resize(1288, 862);
299299 ConfigControlMenu();
300300 ConfigFloppyMenu();
301+ ConfigHardDiskMenu();
301302 ConfigCMTMenu();
302303 if(!using_flags->is_without_sound()) {
303304 ConfigSoundMenu();
@@ -450,41 +451,50 @@ void Ui_MainWindowBase::setupUi(void)
450451 menuDebugger->setObjectName(QString::fromUtf8("menuDebugger"));
451452 menuDebugger->setToolTipsVisible(true);
452453 if(using_flags->is_use_fd()) {
453- int i;
454- for(i = 0; i < using_flags->get_max_drive(); i++) CreateFloppyMenu(i, i + 1);
454+ int base_drv = using_flags->get_base_floppy_disk_num();
455+ for(int i = 0; i < using_flags->get_max_drive(); i++) CreateFloppyMenu(i, base_drv);
455456 }
456457 if(using_flags->is_use_qd()) {
457- int i;
458- for(i = 0; i < using_flags->get_max_qd(); i++) CreateQuickDiskMenu(i, i + 1);
458+ int base_drv = using_flags->get_base_quick_disk_num();
459+ for(int i = 0; i < using_flags->get_max_qd(); i++) CreateQuickDiskMenu(i, base_drv);
459460 }
460461 if(using_flags->is_use_tape()) {
461- for(int i = 0; i < using_flags->get_max_tape(); i++) CreateCMTMenu(i);
462+ int base_drv = using_flags->get_base_tape_num();
463+ for(int i = 0; i < using_flags->get_max_tape(); i++) CreateCMTMenu(i, base_drv);
462464 }
463- if(using_flags->get_max_scsi() > 0) {
465+ if(using_flags->is_use_hdd()) {
466+ int base_drv = using_flags->get_base_hdd_num();
467+ for(int i = 0; i < using_flags->get_max_hdd(); i++) CreateHDDMenu(i, base_drv);
464468 }
465469 CreateScreenMenu();
466470 if(using_flags->is_use_cart()) {
467- int i;
468- for(i = 0; i < using_flags->get_max_cart(); i++) {
469- CreateCartMenu(i, i + 1);
471+ int base_drv = using_flags->get_base_cart_num();
472+ for(int i = 0; i < using_flags->get_max_cart(); i++) {
473+ CreateCartMenu(i, base_drv);
470474 }
471475 }
472476 if(using_flags->is_use_binary_file()) {
473- int i;
474- for(i = 0; i < using_flags->get_max_binary(); i++) {
475- CreateBinaryMenu(i, i + 1);
477+ int base_drv = using_flags->get_base_binary_file_num();
478+ for(int i = 0; i < using_flags->get_max_binary(); i++) {
479+ CreateBinaryMenu(i, base_drv);
476480 }
477481 }
478482 if(using_flags->is_use_compact_disc()) {
479- CreateCDROMMenu();
483+ int base_drv = using_flags->get_base_compact_disc_num();
484+ for(int i = 0; i < using_flags->get_max_cd(); i++) {
485+ CreateCDROMMenu(i, base_drv);
486+ }
480487 }
481488 if(using_flags->is_use_laser_disc()) {
482- CreateLaserdiscMenu();
489+ int base_drv = using_flags->get_base_laser_disc_num();
490+ for(int i = 0; i < using_flags->get_max_ld(); i++) {
491+ CreateLaserdiscMenu(i, base_drv);
492+ }
483493 }
484494 if(using_flags->is_use_bubble()) {
485- int i;
486- for(i = 0; i < using_flags->get_max_bubble(); i++) {
487- CreateBubbleMenu(i, i + 1);
495+ int base_drv = using_flags->get_base_bubble_num();
496+ for(int i = 0; i < using_flags->get_max_bubble(); i++) {
497+ CreateBubbleMenu(i, base_drv);
488498 }
489499 }
490500 connect(this, SIGNAL(sig_update_screen(void)), graphicsView, SLOT(update(void)));
--- a/source/src/qt/gui/menu_metaclass.cpp
+++ b/source/src/qt/gui/menu_metaclass.cpp
@@ -5,6 +5,11 @@
55 * History: 2015-11-11 Initial.
66 */
77
8+#include <QAction>
9+#include <QActionGroup>
10+#include <QWidget>
11+#include <QDir>
12+#include <QStyle>
813
914 //#include "emu.h"
1015 //#include "vm.h"
@@ -15,7 +20,7 @@
1520 #include "commonclasses.h"
1621 #include "qt_main.h"
1722
18-Menu_MetaClass::Menu_MetaClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : QMenu(root_entry)
23+Menu_MetaClass::Menu_MetaClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : QMenu(root_entry)
1924 {
2025 QString tmps;
2126 int ii;
@@ -27,10 +32,13 @@ Menu_MetaClass::Menu_MetaClass(QMenuBar *root_entry, QString desc, USING_FLAGS *
2732 using_flags = p;
2833
2934 media_drive = drv;
30-
35+ base_drive = base_drv;
36+
3137 tmps.setNum(drv);
32- object_desc = desc;
38+ object_desc = QString::fromUtf8("Obj_") + desc;
3339 object_desc.append(tmps);
40+ setObjectName(object_desc);
41+
3442 for(ii = 0; ii < using_flags->get_max_d88_banks(); ii++) {
3543 action_select_media_list[ii] = NULL;
3644 }
@@ -48,6 +56,10 @@ Menu_MetaClass::Menu_MetaClass(QMenuBar *root_entry, QString desc, USING_FLAGS *
4856 icon_write_protected = QApplication::style()->standardIcon(QStyle::SP_DialogApplyButton);
4957 icon_write_enabled = QIcon();
5058 setToolTipsVisible(true);
59+
60+ tmps.arg(drv + base_drv);
61+ tmps = desc + tmps;
62+ setTitle(tmps);
5163 }
5264
5365 Menu_MetaClass::~Menu_MetaClass()
--- a/source/src/qt/gui/menu_metaclass.h
+++ b/source/src/qt/gui/menu_metaclass.h
@@ -10,13 +10,8 @@
1010
1111 #include <QString>
1212 #include <QStringList>
13-#include <QWidget>
1413 #include <QMenu>
15-#include <QMenuBar>
16-#include <QAction>
17-#include <QActionGroup>
18-#include <QDir>
19-#include <QStyle>
14+#include <QIcon>
2015
2116 #include "common.h"
2217 #include "config.h"
@@ -25,7 +20,11 @@
2520 class EMU;
2621
2722 QT_BEGIN_NAMESPACE
23+class QMenuBar;
24+class QAction;
25+class QActionGroup;
2826 class USING_FLAGS;
27+class Action_Control;
2928
3029 class DLL_PREFIX Menu_MetaClass : public QMenu {
3130 Q_OBJECT
@@ -62,6 +61,8 @@ protected:
6261 QString object_desc;
6362
6463 int media_drive;
64+ int base_drive;
65+
6566 bool use_write_protect;
6667 bool use_d88_menus;
6768
@@ -76,7 +77,7 @@ protected:
7677 QStringList history;
7778 QStringList inner_media_list;
7879 public:
79- Menu_MetaClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
80+ Menu_MetaClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
8081 ~Menu_MetaClass();
8182
8283 virtual void create_pulldown_menu_device_sub(void);
--- a/source/src/qt/gui/menu_quickdisk.cpp
+++ b/source/src/qt/gui/menu_quickdisk.cpp
@@ -13,7 +13,7 @@
1313 #include "qt_dialogs.h"
1414 //#include "emu.h"
1515
16-Menu_QDClass::Menu_QDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv) : Menu_MetaClass(root_entry, desc, p, parent, drv)
16+Menu_QDClass::Menu_QDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent, int drv, int base_drv) : Menu_MetaClass(root_entry, desc, p, parent, drv, base_drv)
1717 {
1818 QString tmps;
1919 use_write_protect = true;
--- a/source/src/qt/gui/menu_quickdisk.h
+++ b/source/src/qt/gui/menu_quickdisk.h
@@ -16,7 +16,7 @@ class DLL_PREFIX Menu_QDClass: public Menu_MetaClass {
1616 Q_OBJECT
1717 protected:
1818 public:
19- Menu_QDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0);
19+ Menu_QDClass(QMenuBar *root_entry, QString desc, USING_FLAGS *p, QWidget *parent = 0, int drv = 0, int base_drv = 1);
2020 ~Menu_QDClass();
2121 void create_pulldown_menu_device_sub();
2222 void connect_menu_device_sub(void);
--- a/source/src/qt/gui/util_binary.cpp
+++ b/source/src/qt/gui/util_binary.cpp
@@ -127,7 +127,7 @@ void Ui_MainWindowBase::CreateBinaryMenu(int drv, int drv_base)
127127 } else {
128128 desc1 = "Memory Dump";
129129 }
130- menu_BINs[drv] = new Menu_BinaryClass(menubar, QString::fromUtf8("Obj_Binary"), using_flags, this, drv);
130+ menu_BINs[drv] = new Menu_BinaryClass(menubar, QString::fromUtf8("Binary"), using_flags, this, drv, drv_base);
131131 menu_BINs[drv]->create_pulldown_menu();
132132
133133 menu_BINs[drv]->do_clear_inner_media();
--- a/source/src/qt/gui/util_cart.cpp
+++ b/source/src/qt/gui/util_cart.cpp
@@ -95,7 +95,7 @@ void Ui_MainWindowBase::CreateCartMenu(int drv, int drv_base)
9595 desc = "Game Cartridge";
9696 }
9797
98- menu_Cart[drv] = new Menu_CartClass(menubar, QString::fromUtf8("Obj_Cart"), using_flags, this, drv);
98+ menu_Cart[drv] = new Menu_CartClass(menubar, QString::fromUtf8("Cart"), using_flags, this, drv, drv_base);
9999 menu_Cart[drv]->create_pulldown_menu();
100100
101101 menu_Cart[drv]->do_clear_inner_media();
--- a/source/src/qt/gui/util_cd.cpp
+++ b/source/src/qt/gui/util_cd.cpp
@@ -16,34 +16,23 @@
1616 #include "menu_compactdisc.h"
1717
1818
19-void Object_Menu_Control::insert_cdrom(void) {
20- //AGAR_DebugLog(AGAR_LOG_DEBUG, "%d", play);
21- emit sig_insert_cdrom(play);
22-}
23-void Object_Menu_Control::eject_cdrom(void) {
24- emit sig_eject_cdrom();
25-}
26-void Object_Menu_Control::on_recent_cdrom(){
27- emit sig_recent_cdrom(s_num);
28-}
29-
30-void Ui_MainWindowBase::CreateCDROMMenu(void)
19+void Ui_MainWindowBase::CreateCDROMMenu(int drv, int drv_base)
3120 {
3221 QString ext_play, desc_play;
3322
34- listCDROM.clear();
35- menu_CDROM = new Menu_CompactDiscClass(menubar, "Object_CDROM_Menu", using_flags, this, 0);
36- menu_CDROM->setObjectName(QString::fromUtf8("menuCDROM", -1));
23+ listCDROM[drv].clear();
24+ menu_CDROM[drv] = new Menu_CompactDiscClass(menubar, "CDROM", using_flags, this, drv, drv_base);
25+ menu_CDROM[drv]->setObjectName(QString::fromUtf8("menuCDROM", -1));
3726
38- menu_CDROM->create_pulldown_menu();
27+ menu_CDROM[drv]->create_pulldown_menu();
3928 // Translate Menu
40- SETUP_HISTORY(using_flags->get_config_ptr()->recent_compact_disc_path, listCDROM);
41- menu_CDROM->do_update_histories(listCDROM);
42- menu_CDROM->do_set_initialize_directory(using_flags->get_config_ptr()->initial_compact_disc_dir);
29+ SETUP_HISTORY(using_flags->get_config_ptr()->recent_compact_disc_path, listCDROM[drv]);
30+ menu_CDROM[drv]->do_update_histories(listCDROM[drv]);
31+ menu_CDROM[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_compact_disc_dir);
4332
4433 ext_play = "*.ccd *.cue *.gz";
4534 desc_play = "Compact Disc";
46- menu_CDROM->do_add_media_extension(ext_play, desc_play);
35+ menu_CDROM[drv]->do_add_media_extension(ext_play, desc_play);
4736
4837 }
4938
@@ -64,21 +53,21 @@ int Ui_MainWindowBase::set_recent_cdrom(int drv, int num)
6453
6554 s_path = QString::fromLocal8Bit(using_flags->get_config_ptr()->recent_compact_disc_path[num]);
6655 strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX);
67- UPDATE_HISTORY(path_shadow, using_flags->get_config_ptr()->recent_compact_disc_path, listCDROM);
56+ UPDATE_HISTORY(path_shadow, using_flags->get_config_ptr()->recent_compact_disc_path, listCDROM[drv]);
6857
6958 strcpy(using_flags->get_config_ptr()->initial_compact_disc_dir, get_parent_dir(path_shadow));
7059 strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX);
71- emit sig_close_cdrom();
60+ emit sig_close_cdrom(drv);
7261 csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_VFILE_COMPACTDISC + 0, "Open : filename = %s", path_shadow);
73- emit sig_open_cdrom(s_path);
74- menu_CDROM->do_update_histories(listCDROM);
75- menu_CDROM->do_set_initialize_directory(using_flags->get_config_ptr()->initial_compact_disc_dir);
62+ emit sig_open_cdrom(drv, s_path);
63+ menu_CDROM[drv]->do_update_histories(listCDROM[drv]);
64+ menu_CDROM[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_compact_disc_dir);
7665 return 0;
7766 }
7867
7968 void Ui_MainWindowBase::do_eject_cdrom(int drv)
8069 {
81- emit sig_close_cdrom();
70+ emit sig_close_cdrom(drv);
8271 }
8372
8473 void Ui_MainWindowBase::do_open_cdrom(int drv, QString path)
@@ -86,22 +75,22 @@ void Ui_MainWindowBase::do_open_cdrom(int drv, QString path)
8675 char path_shadow[PATH_MAX];
8776 if(path.length() <= 0) return;
8877 strncpy(path_shadow, path.toLocal8Bit().constData(), PATH_MAX);
89- UPDATE_HISTORY(path_shadow, using_flags->get_config_ptr()->recent_compact_disc_path, listCDROM);
78+ UPDATE_HISTORY(path_shadow, using_flags->get_config_ptr()->recent_compact_disc_path, listCDROM[drv]);
9079 strcpy(using_flags->get_config_ptr()->initial_compact_disc_dir, get_parent_dir(path_shadow));
9180 // Copy filename again.
9281 strncpy(path_shadow, path.toLocal8Bit().constData(), PATH_MAX);
9382
94- emit sig_close_cdrom();
83+ emit sig_close_cdrom(drv);
9584 csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_VFILE_COMPACTDISC + 0, "Open : filename = %s", path_shadow);
96- emit sig_open_cdrom(path);
97- menu_CDROM->do_update_histories(listCDROM);
98- menu_CDROM->do_set_initialize_directory(using_flags->get_config_ptr()->initial_compact_disc_dir);
85+ emit sig_open_cdrom(drv, path);
86+ menu_CDROM[drv]->do_update_histories(listCDROM);
87+ menu_CDROM[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_compact_disc_dir);
9988 }
10089
10190 void Ui_MainWindowBase::retranslateCDROMMenu(void)
10291 {
10392 if(using_flags->is_use_compact_disc()) {
104- menu_CDROM->retranslateUi();
93+ menu_CDROM[drv]->retranslateUi();
10594 }
10695 }
10796
--- a/source/src/qt/gui/util_cmt.cpp
+++ b/source/src/qt/gui/util_cmt.cpp
@@ -17,7 +17,7 @@
1717 #include "menu_flags.h"
1818
1919 //extern USING_FLAGS *using_flags;
20-void Ui_MainWindowBase::CreateCMTMenu(int drive)
20+void Ui_MainWindowBase::CreateCMTMenu(int drive, int base_drv)
2121 {
2222 QString ext_play;
2323 QString ext_rec;
@@ -25,7 +25,7 @@ void Ui_MainWindowBase::CreateCMTMenu(int drive)
2525 QString desc_rec;
2626
2727 listCMT[drive].clear();
28- menu_CMT[drive] = new Menu_CMTClass(menubar, "Object_CMT_Menu", using_flags, this, drive);
28+ menu_CMT[drive] = new Menu_CMTClass(menubar, QString::fromUtf8("CMT"), using_flags, this, drive, base_drv);
2929 menu_CMT[drive]->setObjectName(QString::fromUtf8("menuCMT", -1));
3030
3131 menu_CMT[drive]->create_pulldown_menu();
--- a/source/src/qt/gui/util_fd.cpp
+++ b/source/src/qt/gui/util_fd.cpp
@@ -100,7 +100,7 @@ void Ui_MainWindowBase::CreateFloppyMenu(int drv, int drv_base)
100100 {
101101 QString ext = "*.d88 *.d77 *.1dd *.td0 *.imd *.dsk *.nfd *.fdi *.hdm *.hd5 *.hd4 *.hdb *.dd9 *.dd6 *.tfd *.xdf *.2d *.sf7 *.img *.ima *.vfd";
102102 QString desc1 = "Floppy Disk";
103- menu_fds[drv] = new Menu_FDClass(menubar, QString::fromUtf8("Obj_Floppy"), using_flags, this, drv);
103+ menu_fds[drv] = new Menu_FDClass(menubar, QString::fromUtf8("Floppy"), using_flags, this, drv, drv_base);
104104 menu_fds[drv]->create_pulldown_menu();
105105
106106 menu_fds[drv]->do_clear_inner_media();
@@ -109,12 +109,6 @@ void Ui_MainWindowBase::CreateFloppyMenu(int drv, int drv_base)
109109 menu_fds[drv]->do_update_histories(listFDs[drv]);
110110 menu_fds[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_floppy_disk_dir);
111111 listD88[drv].clear();
112-
113- QString name = QString::fromUtf8("FD");
114- QString tmpv;
115- tmpv.setNum(drv_base);
116- name.append(tmpv);
117- menu_fds[drv]->setTitle(name);
118112 }
119113 }
120114
--- /dev/null
+++ b/source/src/qt/gui/util_hdd.cpp
@@ -0,0 +1,94 @@
1+/*
2+ * UI->Qt->MainWindow : FDD Utils.
3+ * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
4+ * License: GPLv2
5+ *
6+ * History:
7+ * Jan 24, 2014 : Moved from some files.
8+ */
9+
10+
11+#include "mainwidget_base.h"
12+#include "commonclasses.h"
13+#include "menu_harddisk.h"
14+
15+#include "qt_dialogs.h"
16+#include "csp_logger.h"
17+
18+#include "menu_flags.h"
19+
20+//extern USING_FLAGS *using_flags;
21+//extern class EMU *emu;
22+
23+
24+void Ui_MainWindowBase::do_update_recent_hard_disk(int drv)
25+{
26+}
27+
28+
29+int Ui_MainWindowBase::set_recent_hard_disk(int drv, int num)
30+{
31+ return 0;
32+}
33+
34+void Ui_MainWindowBase::_open_hard_disk(int drv, const QString fname)
35+{
36+}
37+
38+void Ui_MainWindowBase::eject_hard_disk(int drv)
39+{
40+ emit sig_close_hard_disk(drv);
41+ menu_hdds[drv]->do_clear_inner_media();
42+}
43+
44+// Common Routine
45+
46+void Ui_MainWindowBase::CreateHardDiskMenu(int drv, int drv_base)
47+{
48+ {
49+ QString ext = "*.thd;*.nhd;*.hdi;*.dat";
50+ QString desc1 = "Hard Disk Drive";
51+ menu_hdds[drv] = new Menu_HDDDClass(menubar, QString::fromUtf8("HDD"), using_flags, this, drv, drv_base);
52+ menu_hdds[drv]->create_pulldown_menu();
53+
54+ menu_hdds[drv]->do_clear_inner_media();
55+ menu_hdds[drv]->do_add_media_extension(ext, desc1);
56+ SETUP_HISTORY(using_flags->get_config_ptr()->recent_hard_disk_path[drv], listHDDs[drv]);
57+ menu_hdds[drv]->do_update_histories(listHDDs[drv]);
58+ menu_hdds[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_hard_disk_dir);
59+ }
60+}
61+
62+void Ui_MainWindowBase::CreateHardDiskPulldownMenu(int drv)
63+{
64+}
65+
66+void Ui_MainWindowBase::ConfigHardDiskMenuSub(int drv)
67+{
68+}
69+
70+void Ui_MainWindowBase::retranslateHardDiskMenu(int drv, int basedrv)
71+{
72+ QString s = QApplication::translate("MenuMedia", "HDD", 0);
73+ s = s + QString::number(basedrv);
74+ retranslateHardDiskMenu(drv, basedrv, s);
75+}
76+
77+void Ui_MainWindowBase::retranslateHardDiskMenu(int drv, int basedrv, QString specName)
78+{
79+ QString drive_name;
80+ drive_name = QString::fromUtf8("[") + QString::number(basedrv) + QString::fromUtf8(":] ");
81+ drive_name = drive_name + specName;
82+ //drive_name += QString::number(basedrv);
83+
84+ if((drv < 0) || (drv >= using_flags->get_max_drive())) return;
85+ menu_hdds[drv]->setTitle(QApplication::translate("MenuMedia", drive_name.toUtf8().constData() , 0));
86+ menu_hdds[drv]->retranslateUi();
87+}
88+
89+void Ui_MainWindowBase::ConfigHardDiskMenu(void)
90+{
91+ for(int i = 0; i < using_flags->get_max_hdd(); i++) {
92+ ConfigHardDiskMenuSub(i);
93+ }
94+}
--- a/source/src/qt/gui/util_ld.cpp
+++ b/source/src/qt/gui/util_ld.cpp
@@ -27,27 +27,27 @@ void Object_Menu_Control::on_recent_laserdisc(){
2727 emit sig_recent_laserdisc(s_num);
2828 }
2929
30-void Ui_MainWindowBase::CreateLaserdiscMenu(void)
30+void Ui_MainWindowBase::CreateLaserdiscMenu(int drv, int drv_base)
3131 {
3232 QString ext_play, desc_play;
3333
34- listLaserdisc.clear();
35- menu_Laserdisc = new Menu_LaserdiscClass(menubar, "Object_Laserdisc_Menu", using_flags, this, 0);
36- menu_Laserdisc->setObjectName(QString::fromUtf8("menuLaserdisc", -1));
34+ listLaserdisc[drv].clear();
35+ menu_Laserdisc[drv] = new Menu_LaserdiscClass(menubar, "Laserdisc", using_flags, this, drv, drv_base);
36+ menu_Laserdisc[drv]->setObjectName(QString::fromUtf8("menuLaserdisc", -1));
3737
38- menu_Laserdisc->create_pulldown_menu();
38+ menu_Laserdisc[drv]->create_pulldown_menu();
3939 // Translate Menu
40- SETUP_HISTORY(using_flags->get_config_ptr()->recent_laser_disc_path, listLaserdisc);
41- menu_Laserdisc->do_update_histories(listLaserdisc);
42- menu_Laserdisc->do_set_initialize_directory(using_flags->get_config_ptr()->initial_laser_disc_dir);
40+ SETUP_HISTORY(using_flags->get_config_ptr()->recent_laser_disc_path, listLaserdisc[drv]);
41+ menu_Laserdisc[drv]->do_update_histories(listLaserdisc[drv]);
42+ menu_Laserdisc[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_laser_disc_dir);
4343
4444 ext_play = "*.ogv *.mp4 *.avi *.mkv";
4545 desc_play = "Laserisc";
46- menu_Laserdisc->do_add_media_extension(ext_play, desc_play);
46+ menu_Laserdisc[drv]->do_add_media_extension(ext_play, desc_play);
4747
4848 }
4949
50-void Ui_MainWindowBase::CreateLaserdiscPulldownMenu(void)
50+void Ui_MainWindowBase::CreateLaserdiscPulldownMenu(int drv)
5151 {
5252 }
5353
@@ -64,21 +64,21 @@ int Ui_MainWindowBase::set_recent_laserdisc(int drv, int num)
6464
6565 s_path = QString::fromLocal8Bit(using_flags->get_config_ptr()->recent_laser_disc_path[num]);
6666 strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX);
67- UPDATE_HISTORY(path_shadow, using_flags->get_config_ptr()->recent_laser_disc_path, listLaserdisc);
67+ UPDATE_HISTORY(path_shadow, using_flags->get_config_ptr()->recent_laser_disc_path, listLaserdisc[drv]);
6868
6969 strcpy(using_flags->get_config_ptr()->initial_laser_disc_dir, get_parent_dir(path_shadow));
7070 strncpy(path_shadow, s_path.toLocal8Bit().constData(), PATH_MAX);
71- emit sig_close_laserdisc();
71+ emit sig_close_laserdisc(drv);
7272 csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_VFILE_LASERDISC + 0, "Open : filename = %s", path_shadow);
73- emit sig_open_laserdisc(s_path);
74- menu_Laserdisc->do_update_histories(listLaserdisc);
75- menu_Laserdisc->do_set_initialize_directory(using_flags->get_config_ptr()->initial_laser_disc_dir);
73+ emit sig_open_laserdisc(drv, s_path);
74+ menu_Laserdisc[drv]->do_update_histories(listLaserdisc[drv]);
75+ menu_Laserdisc[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_laser_disc_dir);
7676 return 0;
7777 }
7878
7979 void Ui_MainWindowBase::do_eject_laserdisc(int drv)
8080 {
81- emit sig_close_laserdisc();
81+ emit sig_close_laserdisc(drv);
8282 }
8383
8484 void Ui_MainWindowBase::do_open_laserdisc(int drv, QString path)
@@ -87,16 +87,16 @@ void Ui_MainWindowBase::do_open_laserdisc(int drv, QString path)
8787
8888 if(path.length() <= 0) return;
8989 strncpy(path_shadow, path.toLocal8Bit().constData(), PATH_MAX);
90- UPDATE_HISTORY(path_shadow, using_flags->get_config_ptr()->recent_laser_disc_path, listLaserdisc);
90+ UPDATE_HISTORY(path_shadow, using_flags->get_config_ptr()->recent_laser_disc_path, listLaserdisc[drv]);
9191 strcpy(using_flags->get_config_ptr()->initial_laser_disc_dir, get_parent_dir(path_shadow));
9292 // Copy filename again.
9393 strncpy(path_shadow, path.toLocal8Bit().constData(), PATH_MAX);
9494
95- emit sig_close_laserdisc();
95+ emit sig_close_laserdisc(drv);
9696 csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_VFILE_LASERDISC + 0, "Open : filename = %s", path_shadow);
97- emit sig_open_laserdisc(path);
98- menu_Laserdisc->do_update_histories(listLaserdisc);
99- menu_Laserdisc->do_set_initialize_directory(using_flags->get_config_ptr()->initial_laser_disc_dir);
97+ emit sig_open_laserdisc(drv, path);
98+ menu_Laserdisc[drv]->do_update_histories(listLaserdisc[drv]);
99+ menu_Laserdisc[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_laser_disc_dir);
100100 }
101101
102102 void Ui_MainWindowBase::retranslateLaserdiscMenu(void)
--- a/source/src/qt/gui/util_qd.cpp
+++ b/source/src/qt/gui/util_qd.cpp
@@ -152,7 +152,7 @@ void Ui_MainWindowBase::CreateQuickDiskMenu(int drv, int drv_base)
152152 {
153153 QString ext = "*.mzt *.q20 *.qdf";
154154 QString desc1 = "Quick DIsk";
155- menu_QDs[drv] = new Menu_QDClass(menubar, QString::fromUtf8("Obj_QuickDisk"), using_flags, this, drv);
155+ menu_QDs[drv] = new Menu_QDClass(menubar, QString::fromUtf8("QD"), using_flags, this, drv);
156156 menu_QDs[drv]->create_pulldown_menu();
157157
158158 menu_QDs[drv]->do_clear_inner_media();
@@ -161,11 +161,6 @@ void Ui_MainWindowBase::CreateQuickDiskMenu(int drv, int drv_base)
161161 menu_QDs[drv]->do_update_histories(listQDs[drv]);
162162 menu_QDs[drv]->do_set_initialize_directory(using_flags->get_config_ptr()->initial_quick_disk_dir);
163163
164- QString name = QString::fromUtf8("Quick Disk");
165- QString tmpv;
166- tmpv.setNum(drv_base);
167- name.append(tmpv);
168- menu_QDs[drv]->setTitle(name);
169164 }
170165 }
171166
Show on old repository browser