2 * UI->Qt->MainWindow : FDD Utils.
3 * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
7 * Jan 24, 2014 : Moved from some files.
9 #include <QApplication>
11 #include "mainwidget_base.h"
12 #include "commonclasses.h"
13 #include "menu_harddisk.h"
15 #include "qt_dialogs.h"
16 #include "csp_logger.h"
18 #include "menu_flags.h"
20 //extern USING_FLAGS *using_flags;
21 //extern class EMU *emu;
24 void Ui_MainWindowBase::do_update_recent_hard_disk(int drv)
29 int Ui_MainWindowBase::set_recent_hard_disk(int drv, int num)
34 void Ui_MainWindowBase::_open_hard_disk(int drv, const QString fname)
38 void Ui_MainWindowBase::eject_hard_disk(int drv)
40 emit sig_close_hard_disk(drv);
41 menu_hdds[drv]->do_clear_inner_media();
46 void Ui_MainWindowBase::CreateHardDiskMenu(int drv, int drv_base)
49 QString ext = "*.thd;*.nhd;*.hdi;*.hdd;*.dat";
50 QString desc1 = "Hard Disk Drive";
51 menu_hdds[drv] = new Menu_HDDClass(menubar, QString::fromUtf8("HDD"), using_flags, this, drv, drv_base);
52 menu_hdds[drv]->create_pulldown_menu();
54 menu_hdds[drv]->do_clear_inner_media();
55 menu_hdds[drv]->do_add_media_extension(ext, desc1);
56 SETUP_HISTORY(p_config->recent_hard_disk_path[drv], listHDDs[drv]);
57 menu_hdds[drv]->do_update_histories(listHDDs[drv]);
58 menu_hdds[drv]->do_set_initialize_directory(p_config->initial_hard_disk_dir);
62 void Ui_MainWindowBase::CreateHardDiskPulldownMenu(int drv)
66 void Ui_MainWindowBase::ConfigHardDiskMenuSub(int drv)
70 void Ui_MainWindowBase::retranslateHardDiskMenu(int drv, int basedrv)
72 QString s = QApplication::translate("MenuMedia", "HDD", 0);
73 s = s + QString::number(basedrv);
74 retranslateHardDiskMenu(drv, basedrv, s);
77 void Ui_MainWindowBase::retranslateHardDiskMenu(int drv, int basedrv, QString specName)
80 drive_name = QString::fromUtf8(":");
81 drive_name = specName + drive_name;
82 //drive_name += QString::number(basedrv);
84 if((drv < 0) || (drv >= using_flags->get_max_hdd())) return;
85 menu_hdds[drv]->setTitle(QApplication::translate("MenuMedia", drive_name.toUtf8().constData() , 0));
86 menu_hdds[drv]->retranslateUi();
89 void Ui_MainWindowBase::ConfigHardDiskMenu(void)
91 for(int i = 0; i < using_flags->get_max_hdd(); i++) {
92 ConfigHardDiskMenuSub(i);