mirror of
https://github.com/LIV2/amiberry.git
synced 2025-12-06 06:32:45 +00:00
enhancement: added default Floppy, CD-ROM and Hard Drive paths (fixes #1268)
- Added default directories in repo - Added default paths pointing to those directories. They can of course be modified. - Added new paths in GUI->Paths panel
This commit is contained in:
parent
08c9a0739f
commit
3563858717
1
cdroms/dir.txt
Normal file
1
cdroms/dir.txt
Normal file
@ -0,0 +1 @@
|
||||
Directory for CDROM files
|
||||
1
floppies/dir.txt
Normal file
1
floppies/dir.txt
Normal file
@ -0,0 +1 @@
|
||||
Directory for Floppy image files
|
||||
1
harddrives/dir.txt
Normal file
1
harddrives/dir.txt
Normal file
@ -0,0 +1 @@
|
||||
Directory for Hard Drive files (hardfiles, directories)
|
||||
@ -1 +1 @@
|
||||
Directory for NVRAM files
|
||||
Directory for WHDLoad (.lha) files
|
||||
@ -288,6 +288,9 @@ std::string controllers_path;
|
||||
std::string retroarch_file;
|
||||
std::string whdboot_path;
|
||||
std::string whdload_arch_path;
|
||||
std::string floppy_path;
|
||||
std::string harddrive_path;
|
||||
std::string cdrom_path;
|
||||
std::string logfile_path;
|
||||
std::string floppy_sounds_dir;
|
||||
std::string data_dir;
|
||||
@ -3022,6 +3025,36 @@ void set_whdload_arch_path(const std::string& newpath)
|
||||
whdload_arch_path = newpath;
|
||||
}
|
||||
|
||||
std::string get_floppy_path()
|
||||
{
|
||||
return fix_trailing(floppy_path);
|
||||
}
|
||||
|
||||
void set_floppy_path(const std::string& newpath)
|
||||
{
|
||||
floppy_path = newpath;
|
||||
}
|
||||
|
||||
std::string get_harddrive_path()
|
||||
{
|
||||
return fix_trailing(harddrive_path);
|
||||
}
|
||||
|
||||
void set_harddrive_path(const std::string& newpath)
|
||||
{
|
||||
harddrive_path = newpath;
|
||||
}
|
||||
|
||||
std::string get_cdrom_path()
|
||||
{
|
||||
return fix_trailing(cdrom_path);
|
||||
}
|
||||
|
||||
void set_cdrom_path(const std::string& newpath)
|
||||
{
|
||||
cdrom_path = newpath;
|
||||
}
|
||||
|
||||
std::string get_logfile_path()
|
||||
{
|
||||
return logfile_path;
|
||||
@ -3464,6 +3497,9 @@ void save_amiberry_settings(void)
|
||||
write_string_option("retroarch_config", retroarch_file);
|
||||
write_string_option("whdboot_path", whdboot_path);
|
||||
write_string_option("whdload_arch_path", whdload_arch_path);
|
||||
write_string_option("floppy_path", floppy_path);
|
||||
write_string_option("harddrive_path", harddrive_path);
|
||||
write_string_option("cdrom_path", cdrom_path);
|
||||
write_string_option("logfile_path", logfile_path);
|
||||
write_string_option("rom_path", rom_path);
|
||||
write_string_option("rp9_path", rp9_path);
|
||||
@ -3604,6 +3640,9 @@ static int parse_amiberry_settings_line(const char *path, char *linea)
|
||||
ret |= cfgfile_string(option, value, "retroarch_config", retroarch_file);
|
||||
ret |= cfgfile_string(option, value, "whdboot_path", whdboot_path);
|
||||
ret |= cfgfile_string(option, value, "whdload_arch_path", whdload_arch_path);
|
||||
ret |= cfgfile_string(option, value, "floppy_path", floppy_path);
|
||||
ret |= cfgfile_string(option, value, "harddrive_path", harddrive_path);
|
||||
ret |= cfgfile_string(option, value, "cdrom_path", cdrom_path);
|
||||
ret |= cfgfile_string(option, value, "logfile_path", logfile_path);
|
||||
ret |= cfgfile_string(option, value, "rom_path", rom_path);
|
||||
ret |= cfgfile_string(option, value, "rp9_path", rp9_path);
|
||||
@ -3859,7 +3898,7 @@ static void init_amiberry_paths(void)
|
||||
init_macos_amiberry_folders(macos_amiberry_directory);
|
||||
macos_copy_amiberry_files_to_userdir(macos_amiberry_directory);
|
||||
}
|
||||
config_path = controllers_path = data_dir = whdboot_path = whdload_arch_path =
|
||||
config_path = controllers_path = data_dir = whdboot_path = whdload_arch_path = floppy_path = harddrive_path = cdrom_path =
|
||||
logfile_path = rom_path = rp9_path = saveimage_dir = savestate_dir = ripper_path =
|
||||
input_dir = screenshot_dir = nvram_dir = video_dir = macos_amiberry_directory;
|
||||
|
||||
@ -3868,6 +3907,9 @@ static void init_amiberry_paths(void)
|
||||
data_dir.append("/Data/");
|
||||
whdboot_path.append("/Whdboot/");
|
||||
whdload_arch_path.append("/Lha/");
|
||||
floppy_path.append("/Floppies/");
|
||||
harddrive_path.append("/Harddrives/");
|
||||
cdrom_path.append("/CDROMs/");
|
||||
logfile_path.append("/Amiberry.log");
|
||||
rom_path.append("/Kickstarts/");
|
||||
rp9_path.append("/RP9/");
|
||||
@ -3879,7 +3921,7 @@ static void init_amiberry_paths(void)
|
||||
nvram_dir.append("/Nvram/");
|
||||
video_dir.append("/Videos/");
|
||||
#else
|
||||
config_path = controllers_path = data_dir = whdboot_path = whdload_arch_path =
|
||||
config_path = controllers_path = data_dir = whdboot_path = whdload_arch_path = floppy_path = harddrive_path = cdrom_path =
|
||||
logfile_path = rom_path = rp9_path = saveimage_dir = savestate_dir = ripper_path =
|
||||
input_dir = screenshot_dir = nvram_dir = video_dir =
|
||||
start_path_data;
|
||||
@ -3889,6 +3931,9 @@ static void init_amiberry_paths(void)
|
||||
data_dir.append("/data/");
|
||||
whdboot_path.append("/whdboot/");
|
||||
whdload_arch_path.append("/lha/");
|
||||
floppy_path.append("/floppies/");
|
||||
harddrive_path.append("/harddrives/");
|
||||
cdrom_path.append("/cdroms/");
|
||||
logfile_path.append("/amiberry.log");
|
||||
rom_path.append("/kickstarts/");
|
||||
rp9_path.append("/rp9/");
|
||||
|
||||
@ -53,16 +53,20 @@ static NavigationMap nav_map[] =
|
||||
{"Start", "Reset", "Shutdown", "WHDLoad", "About"},
|
||||
|
||||
// PanelPaths
|
||||
{"cmdSystemROMs", "Paths", "Paths", "cmdRescanROMs", "cmdConfigPath"},
|
||||
{"cmdConfigPath", "Paths", "Paths", "cmdSystemROMs", "cmdNvramFiles"},
|
||||
{"cmdNvramFiles", "Paths", "Paths", "cmdConfigPath", "cmdScreenshotFiles"},
|
||||
{"cmdScreenshotFiles", "Paths", "Paths", "cmdNvramFiles", "cmdStateFiles"},
|
||||
{"cmdStateFiles", "Paths", "Paths", "cmdScreenshotFiles", "cmdControllersPath"},
|
||||
{"cmdControllersPath", "Paths", "Paths", "cmdStateFiles", "cmdRetroArchFile"},
|
||||
{"cmdRetroArchFile", "Paths", "Paths", "cmdControllersPath", "cmdWHDBootPath"},
|
||||
{"cmdWHDBootPath", "Paths", "Paths", "cmdRetroArchFile", "cmdWHDLoadArchPath"},
|
||||
{"cmdWHDLoadArchPath", "Paths", "Paths", "cmdWHDBootPath", "chkEnableLogging"},
|
||||
{"chkEnableLogging", "Paths", "Paths", "cmdWHDLoadArchPath", "cmdLogfilePath"},
|
||||
{"scrlPaths", "cmdSystemROMs", "Paths", "", "" },
|
||||
{"cmdSystemROMs", "Paths", "scrlPaths", "cmdRescanROMs", "cmdConfigPath"},
|
||||
{"cmdConfigPath", "Paths", "scrlPaths", "cmdSystemROMs", "cmdNvramFiles"},
|
||||
{"cmdNvramFiles", "Paths", "scrlPaths", "cmdConfigPath", "cmdScreenshotFiles"},
|
||||
{"cmdScreenshotFiles", "Paths", "scrlPaths", "cmdNvramFiles", "cmdStateFiles"},
|
||||
{"cmdStateFiles", "Paths", "scrlPaths", "cmdScreenshotFiles", "cmdControllersPath"},
|
||||
{"cmdControllersPath", "Paths", "scrlPaths", "cmdStateFiles", "cmdRetroArchFile"},
|
||||
{"cmdRetroArchFile", "Paths", "scrlPaths", "cmdControllersPath", "cmdWHDBootPath"},
|
||||
{"cmdWHDBootPath", "Paths", "scrlPaths", "cmdRetroArchFile", "cmdWHDLoadArchPath"},
|
||||
{"cmdWHDLoadArchPath", "Paths", "scrlPaths", "cmdWHDBootPath", "cmdFloppyPath"},
|
||||
{"cmdFloppyPath", "Paths", "scrlPaths", "cmdWHDLoadArchPath", "cmdCDPath"},
|
||||
{"cmdCDPath", "Paths", "scrlPaths", "cmdFloppyPath", "cmdHardDrivesPath"},
|
||||
{"cmdHardDrivesPath", "Paths", "scrlPaths", "cmdCDPath", "chkEnableLogging"},
|
||||
{"chkEnableLogging", "Paths", "Paths", "cmdHardDrivesPath", "cmdLogfilePath"},
|
||||
{"cmdLogfilePath", "Paths", "Paths", "chkEnableLogging", "cmdRescanROMs"},
|
||||
{"cmdRescanROMs", "Paths", "cmdDownloadXML", "cmdLogfilePath", "cmdSystemROMs"},
|
||||
{"cmdDownloadXML", "cmdRescanROMs", "cmdDownloadCtrlDb", "cmdLogfilePath", "cmdSystemROMs"},
|
||||
|
||||
@ -204,7 +204,8 @@ public:
|
||||
if (strlen(changed_prefs.floppyslots[i].df) > 0)
|
||||
tmp = std::string(changed_prefs.floppyslots[i].df);
|
||||
else
|
||||
tmp = current_dir;
|
||||
tmp = get_floppy_path();
|
||||
|
||||
tmp = SelectFile("Select disk image file", tmp, diskfile_filter);
|
||||
{
|
||||
if (strncmp(changed_prefs.floppyslots[i].df, tmp.c_str(), MAX_DPATH) != 0)
|
||||
@ -212,7 +213,6 @@ public:
|
||||
strncpy(changed_prefs.floppyslots[i].df, tmp.c_str(), MAX_DPATH);
|
||||
disk_insert(i, tmp.c_str());
|
||||
RefreshDiskListModel();
|
||||
current_dir = extract_path(tmp);
|
||||
|
||||
AdjustDropDownControls();
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ public:
|
||||
if (strlen(changed_prefs.cdslots[0].name) > 0)
|
||||
tmp = std::string(changed_prefs.cdslots[0].name);
|
||||
else
|
||||
tmp = current_dir;
|
||||
tmp = get_cdrom_path();
|
||||
|
||||
tmp = SelectFile("Select CD image file", tmp, cdfile_filter);
|
||||
{
|
||||
@ -253,7 +253,6 @@ public:
|
||||
changed_prefs.cdslots[0].inuse = true;
|
||||
changed_prefs.cdslots[0].type = SCSI_UNIT_DEFAULT;
|
||||
add_file_to_mru_list(lstMRUCDList, tmp);
|
||||
current_dir = extract_path(tmp);
|
||||
|
||||
RefreshCDListModel();
|
||||
AdjustDropDownControls();
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
#include "fsdb_host.h"
|
||||
#include "statusline.h"
|
||||
|
||||
static gcn::ScrollArea* scrollArea;
|
||||
static gcn::ScrollArea* scrlMisc;
|
||||
static gcn::Window* grpMiscOptions;
|
||||
|
||||
static gcn::CheckBox* chkAltTabRelease;
|
||||
@ -624,17 +624,17 @@ void InitPanelMisc(const config_category& category)
|
||||
|
||||
grpMiscOptions->setSize(category.panel->getWidth() - category.panel->getWidth() / 3 - 40, 800);
|
||||
|
||||
scrollArea = new gcn::ScrollArea(grpMiscOptions);
|
||||
scrollArea->setId("scrlMisc");
|
||||
scrollArea->setBackgroundColor(gui_baseCol);
|
||||
scrollArea->setBaseColor(gui_baseCol);
|
||||
scrollArea->setWidth(category.panel->getWidth() - (category.panel->getWidth() / 3) - 25);
|
||||
scrollArea->setHeight(600);
|
||||
scrollArea->setBorderSize(1);
|
||||
scrollArea->setFocusable(true);
|
||||
category.panel->add(scrollArea, DISTANCE_BORDER, DISTANCE_BORDER);
|
||||
scrlMisc = new gcn::ScrollArea(grpMiscOptions);
|
||||
scrlMisc->setId("scrlMisc");
|
||||
scrlMisc->setBackgroundColor(gui_baseCol);
|
||||
scrlMisc->setBaseColor(gui_baseCol);
|
||||
scrlMisc->setWidth(category.panel->getWidth() - (category.panel->getWidth() / 3) - 25);
|
||||
scrlMisc->setHeight(600);
|
||||
scrlMisc->setBorderSize(1);
|
||||
scrlMisc->setFocusable(true);
|
||||
category.panel->add(scrlMisc, DISTANCE_BORDER, DISTANCE_BORDER);
|
||||
|
||||
const auto column2_x = scrollArea->getWidth() + 20;
|
||||
const auto column2_x = scrlMisc->getWidth() + 20;
|
||||
posY = DISTANCE_BORDER;
|
||||
|
||||
category.panel->add(lblOpenGUI, column2_x, posY);
|
||||
@ -748,7 +748,7 @@ void ExitPanelMisc()
|
||||
delete miscActionListener;
|
||||
|
||||
delete grpMiscOptions;
|
||||
delete scrollArea;
|
||||
delete scrlMisc;
|
||||
}
|
||||
|
||||
void RefreshPanelMisc()
|
||||
|
||||
@ -10,6 +10,9 @@
|
||||
#include "gui_handling.h"
|
||||
#include "tinyxml2.h"
|
||||
|
||||
static gcn::ScrollArea* scrlPaths;
|
||||
static gcn::Window* grpPaths;
|
||||
|
||||
static gcn::Label* lblSystemROMs;
|
||||
static gcn::TextField* txtSystemROMs;
|
||||
static gcn::Button* cmdSystemROMs;
|
||||
@ -46,6 +49,18 @@ static gcn::Label* lblWHDLoadArchPath;
|
||||
static gcn::TextField* txtWHDLoadArchPath;
|
||||
static gcn::Button* cmdWHDLoadArchPath;
|
||||
|
||||
static gcn::Label* lblFloppyPath;
|
||||
static gcn::TextField* txtFloppyPath;
|
||||
static gcn::Button* cmdFloppyPath;
|
||||
|
||||
static gcn::Label* lblCDPath;
|
||||
static gcn::TextField* txtCDPath;
|
||||
static gcn::Button* cmdCDPath;
|
||||
|
||||
static gcn::Label* lblHardDrivesPath;
|
||||
static gcn::TextField* txtHardDrivesPath;
|
||||
static gcn::Button* cmdHardDrivesPath;
|
||||
|
||||
static gcn::CheckBox* chkEnableLogging;
|
||||
static gcn::Label* lblLogfilePath;
|
||||
static gcn::TextField* txtLogfilePath;
|
||||
@ -144,6 +159,33 @@ public:
|
||||
cmdWHDLoadArchPath->requestFocus();
|
||||
}
|
||||
|
||||
else if (actionEvent.getSource() == cmdFloppyPath)
|
||||
{
|
||||
path = SelectFolder("Folder for Floppies", get_floppy_path());
|
||||
{
|
||||
set_floppy_path(path);
|
||||
}
|
||||
cmdFloppyPath->requestFocus();
|
||||
}
|
||||
|
||||
else if (actionEvent.getSource() == cmdCDPath)
|
||||
{
|
||||
path = SelectFolder("Folder for CD-ROMs", get_cdrom_path());
|
||||
{
|
||||
set_cdrom_path(path);
|
||||
}
|
||||
cmdCDPath->requestFocus();
|
||||
}
|
||||
|
||||
else if (actionEvent.getSource() == cmdHardDrivesPath)
|
||||
{
|
||||
path = SelectFolder("Folder for Hard Drives", get_harddrive_path());
|
||||
{
|
||||
set_harddrive_path(path);
|
||||
}
|
||||
cmdHardDrivesPath->requestFocus();
|
||||
}
|
||||
|
||||
else if (actionEvent.getSource() == cmdLogfilePath)
|
||||
{
|
||||
const char* filter[] = { "amiberry.log", "\0" };
|
||||
@ -296,10 +338,12 @@ static DownloadControllerDbActionListener* downloadControllerDbActionListener;
|
||||
|
||||
void InitPanelPaths(const config_category& category)
|
||||
{
|
||||
const int textFieldWidth = category.panel->getWidth() - 2 * DISTANCE_BORDER - SMALL_BUTTON_WIDTH - DISTANCE_NEXT_X;
|
||||
int yPos = DISTANCE_BORDER;
|
||||
const int textFieldWidth = category.panel->getWidth() - 2 * DISTANCE_BORDER - SMALL_BUTTON_WIDTH * 2 - DISTANCE_NEXT_X;
|
||||
folderButtonActionListener = new FolderButtonActionListener();
|
||||
|
||||
grpPaths = new gcn::Window();
|
||||
grpPaths->setId("grpPaths");
|
||||
|
||||
lblSystemROMs = new gcn::Label("System ROMs:");
|
||||
txtSystemROMs = new gcn::TextField();
|
||||
txtSystemROMs->setSize(textFieldWidth, TEXTFIELD_HEIGHT);
|
||||
@ -405,6 +449,42 @@ void InitPanelPaths(const config_category& category)
|
||||
cmdWHDLoadArchPath->setBaseColor(gui_baseCol);
|
||||
cmdWHDLoadArchPath->addActionListener(folderButtonActionListener);
|
||||
|
||||
lblFloppyPath = new gcn::Label("Floppies path:");
|
||||
txtFloppyPath = new gcn::TextField();
|
||||
txtFloppyPath->setSize(textFieldWidth, TEXTFIELD_HEIGHT);
|
||||
txtFloppyPath->setBaseColor(gui_baseCol);
|
||||
txtFloppyPath->setBackgroundColor(colTextboxBackground);
|
||||
|
||||
cmdFloppyPath = new gcn::Button("...");
|
||||
cmdFloppyPath->setId("cmdFloppyPath");
|
||||
cmdFloppyPath->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
|
||||
cmdFloppyPath->setBaseColor(gui_baseCol);
|
||||
cmdFloppyPath->addActionListener(folderButtonActionListener);
|
||||
|
||||
lblCDPath = new gcn::Label("CD-ROMs path:");
|
||||
txtCDPath = new gcn::TextField();
|
||||
txtCDPath->setSize(textFieldWidth, TEXTFIELD_HEIGHT);
|
||||
txtCDPath->setBaseColor(gui_baseCol);
|
||||
txtCDPath->setBackgroundColor(colTextboxBackground);
|
||||
|
||||
cmdCDPath = new gcn::Button("...");
|
||||
cmdCDPath->setId("cmdCDPath");
|
||||
cmdCDPath->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
|
||||
cmdCDPath->setBaseColor(gui_baseCol);
|
||||
cmdCDPath->addActionListener(folderButtonActionListener);
|
||||
|
||||
lblHardDrivesPath = new gcn::Label("Hard drives path:");
|
||||
txtHardDrivesPath = new gcn::TextField();
|
||||
txtHardDrivesPath->setSize(textFieldWidth, TEXTFIELD_HEIGHT);
|
||||
txtHardDrivesPath->setBaseColor(gui_baseCol);
|
||||
txtHardDrivesPath->setBackgroundColor(colTextboxBackground);
|
||||
|
||||
cmdHardDrivesPath = new gcn::Button("...");
|
||||
cmdHardDrivesPath->setId("cmdHardDrivesPath");
|
||||
cmdHardDrivesPath->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
|
||||
cmdHardDrivesPath->setBaseColor(gui_baseCol);
|
||||
cmdHardDrivesPath->addActionListener(folderButtonActionListener);
|
||||
|
||||
enableLoggingActionListener = new EnableLoggingActionListener();
|
||||
chkEnableLogging = new gcn::CheckBox("Enable logging", true);
|
||||
chkEnableLogging->setId("chkEnableLogging");
|
||||
@ -421,61 +501,97 @@ void InitPanelPaths(const config_category& category)
|
||||
cmdLogfilePath->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
|
||||
cmdLogfilePath->setBaseColor(gui_baseCol);
|
||||
cmdLogfilePath->addActionListener(folderButtonActionListener);
|
||||
|
||||
category.panel->add(lblSystemROMs, DISTANCE_BORDER, yPos);
|
||||
|
||||
int yPos = DISTANCE_BORDER;
|
||||
grpPaths->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
|
||||
grpPaths->setBaseColor(gui_baseCol);
|
||||
grpPaths->setBackgroundColor(colTextboxBackground);
|
||||
|
||||
grpPaths->add(lblSystemROMs, DISTANCE_BORDER, yPos);
|
||||
yPos += lblSystemROMs->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtSystemROMs, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdSystemROMs, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtSystemROMs, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdSystemROMs, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtSystemROMs->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblConfigPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(lblConfigPath, DISTANCE_BORDER, yPos);
|
||||
yPos += lblConfigPath->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtConfigPath, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdConfigPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtConfigPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdConfigPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtConfigPath->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblNvramFiles, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(lblNvramFiles, DISTANCE_BORDER, yPos);
|
||||
yPos += lblNvramFiles->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtNvramFiles, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdNvramFiles, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtNvramFiles, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdNvramFiles, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtNvramFiles->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblScreenshotFiles, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(lblScreenshotFiles, DISTANCE_BORDER, yPos);
|
||||
yPos += lblScreenshotFiles->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtScreenshotFiles, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdScreenshotFiles, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtScreenshotFiles, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdScreenshotFiles, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtScreenshotFiles->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblStateFiles, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(lblStateFiles, DISTANCE_BORDER, yPos);
|
||||
yPos += lblStateFiles->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtStateFiles, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdStateFiles, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtStateFiles, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdStateFiles, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtStateFiles->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblControllersPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(lblControllersPath, DISTANCE_BORDER, yPos);
|
||||
yPos += lblControllersPath->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtControllersPath, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdControllersPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtControllersPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdControllersPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtControllersPath->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblRetroArchFile, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(lblRetroArchFile, DISTANCE_BORDER, yPos);
|
||||
yPos += lblRetroArchFile->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtRetroArchFile, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdRetroArchFile, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtRetroArchFile, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdRetroArchFile, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtRetroArchFile->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblWHDBootPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(lblWHDBootPath, DISTANCE_BORDER, yPos);
|
||||
yPos += lblWHDBootPath->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtWHDBootPath, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdWHDBootPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtWHDBootPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdWHDBootPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtWHDBootPath->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblWHDLoadArchPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(lblWHDLoadArchPath, DISTANCE_BORDER, yPos);
|
||||
yPos += lblWHDLoadArchPath->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
category.panel->add(txtWHDLoadArchPath, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(cmdWHDLoadArchPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
|
||||
grpPaths->add(txtWHDLoadArchPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdWHDLoadArchPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtWHDLoadArchPath->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
yPos += txtWHDLoadArchPath->getHeight() + DISTANCE_NEXT_Y * 2;
|
||||
grpPaths->add(lblFloppyPath, DISTANCE_BORDER, yPos);
|
||||
yPos += lblFloppyPath->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
grpPaths->add(txtFloppyPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdFloppyPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtFloppyPath->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
grpPaths->add(lblCDPath, DISTANCE_BORDER, yPos);
|
||||
yPos += lblCDPath->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
grpPaths->add(txtCDPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdCDPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
yPos += txtCDPath->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
grpPaths->add(lblHardDrivesPath, DISTANCE_BORDER, yPos);
|
||||
yPos += lblHardDrivesPath->getHeight() + DISTANCE_NEXT_Y / 2;
|
||||
grpPaths->add(txtHardDrivesPath, DISTANCE_BORDER, yPos);
|
||||
grpPaths->add(cmdHardDrivesPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X / 2, yPos);
|
||||
|
||||
grpPaths->setSize(category.panel->getWidth() - DISTANCE_BORDER * 2 - 15, txtHardDrivesPath->getY() + txtHardDrivesPath->getHeight() + DISTANCE_NEXT_Y);
|
||||
grpPaths->setTitleBarHeight(1);
|
||||
|
||||
scrlPaths = new gcn::ScrollArea(grpPaths);
|
||||
scrlPaths->setId("scrlPaths");
|
||||
scrlPaths->setBaseColor(gui_baseCol);
|
||||
scrlPaths->setBackgroundColor(colTextboxBackground);
|
||||
scrlPaths->setWidth(category.panel->getWidth() - DISTANCE_BORDER * 2);
|
||||
scrlPaths->setHeight(category.panel->getHeight() - TEXTFIELD_HEIGHT * 6);
|
||||
scrlPaths->setBorderSize(1);
|
||||
scrlPaths->setFocusable(true);
|
||||
category.panel->add(scrlPaths, DISTANCE_BORDER, DISTANCE_BORDER);
|
||||
|
||||
yPos = scrlPaths->getY() + scrlPaths->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblLogfilePath, DISTANCE_BORDER, yPos);
|
||||
category.panel->add(chkEnableLogging, lblLogfilePath->getX() + lblLogfilePath->getWidth() + DISTANCE_NEXT_X * 3, yPos);
|
||||
@ -551,11 +667,26 @@ void ExitPanelPaths()
|
||||
delete txtWHDLoadArchPath;
|
||||
delete cmdWHDLoadArchPath;
|
||||
|
||||
delete lblFloppyPath;
|
||||
delete txtFloppyPath;
|
||||
delete cmdFloppyPath;
|
||||
|
||||
delete lblCDPath;
|
||||
delete txtCDPath;
|
||||
delete cmdCDPath;
|
||||
|
||||
delete lblHardDrivesPath;
|
||||
delete txtHardDrivesPath;
|
||||
delete cmdHardDrivesPath;
|
||||
|
||||
delete chkEnableLogging;
|
||||
delete lblLogfilePath;
|
||||
delete txtLogfilePath;
|
||||
delete cmdLogfilePath;
|
||||
|
||||
|
||||
delete grpPaths;
|
||||
delete scrlPaths;
|
||||
|
||||
delete cmdRescanROMs;
|
||||
delete cmdDownloadXML;
|
||||
delete cmdDownloadCtrlDb;
|
||||
@ -589,6 +720,9 @@ void RefreshPanelPaths()
|
||||
txtRetroArchFile->setText(get_retroarch_file());
|
||||
txtWHDBootPath->setText(get_whdbootpath());
|
||||
txtWHDLoadArchPath->setText(get_whdload_arch_path());
|
||||
txtFloppyPath->setText(get_floppy_path());
|
||||
txtCDPath->setText(get_cdrom_path());
|
||||
txtHardDrivesPath->setText(get_harddrive_path());
|
||||
|
||||
chkEnableLogging->setSelected(get_logfile_enabled());
|
||||
txtLogfilePath->setText(get_logfile_path());
|
||||
|
||||
@ -288,7 +288,7 @@ static void RefreshWhdListModel()
|
||||
}
|
||||
}
|
||||
|
||||
class QSCDButtonActionListener : public gcn::ActionListener
|
||||
class QSCDActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
@ -303,11 +303,14 @@ public:
|
||||
}
|
||||
else if (actionEvent.getSource() == cmdCDSelect)
|
||||
{
|
||||
//---------------------------------------
|
||||
// Insert CD into drive
|
||||
//---------------------------------------
|
||||
std::string tmp;
|
||||
if (strlen(changed_prefs.cdslots[0].name) > 0)
|
||||
tmp = std::string(changed_prefs.cdslots[0].name);
|
||||
else
|
||||
tmp = current_dir;
|
||||
tmp = get_cdrom_path();
|
||||
|
||||
tmp = SelectFile("Select CD image file", tmp, cdfile_filter);
|
||||
{
|
||||
@ -317,7 +320,6 @@ public:
|
||||
changed_prefs.cdslots[0].inuse = true;
|
||||
changed_prefs.cdslots[0].type = SCSI_UNIT_DEFAULT;
|
||||
add_file_to_mru_list(lstMRUCDList, tmp);
|
||||
current_dir = extract_path(tmp);
|
||||
|
||||
RefreshCDListModel();
|
||||
AdjustDropDownControls();
|
||||
@ -325,100 +327,45 @@ public:
|
||||
}
|
||||
cmdCDSelect->requestFocus();
|
||||
}
|
||||
else if (actionEvent.getSource() == cboCDFile && !bIgnoreListChange)
|
||||
{
|
||||
//---------------------------------------
|
||||
// CD image from list selected
|
||||
//---------------------------------------
|
||||
const auto idx = cboCDFile->getSelected();
|
||||
|
||||
if (idx < 0)
|
||||
{
|
||||
strncpy(changed_prefs.cdslots[0].name, "", MAX_DPATH);
|
||||
AdjustDropDownControls();
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto element = get_full_path_from_disk_list(cdfileList.getElementAt(idx));
|
||||
if (element != changed_prefs.cdslots[0].name)
|
||||
{
|
||||
strncpy(changed_prefs.cdslots[0].name, element.c_str(), MAX_DPATH);
|
||||
DISK_history_add(changed_prefs.cdslots[0].name, -1, HISTORY_CD, 0);
|
||||
changed_prefs.cdslots[0].inuse = true;
|
||||
changed_prefs.cdslots[0].type = SCSI_UNIT_DEFAULT;
|
||||
lstMRUCDList.erase(lstMRUCDList.begin() + idx);
|
||||
lstMRUCDList.insert(lstMRUCDList.begin(), changed_prefs.cdslots[0].name);
|
||||
bIgnoreListChange = true;
|
||||
cboCDFile->setSelected(0);
|
||||
bIgnoreListChange = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RefreshPanelHD();
|
||||
RefreshPanelQuickstart();
|
||||
}
|
||||
};
|
||||
|
||||
static QSCDButtonActionListener* cdButtonActionListener;
|
||||
|
||||
class QSCDFileActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
//---------------------------------------
|
||||
// CD image from list selected
|
||||
//---------------------------------------
|
||||
if (!bIgnoreListChange)
|
||||
{
|
||||
if (actionEvent.getSource() == cboCDFile)
|
||||
{
|
||||
const auto idx = cboCDFile->getSelected();
|
||||
|
||||
if (idx < 0)
|
||||
{
|
||||
strncpy(changed_prefs.cdslots[0].name, "", MAX_DPATH);
|
||||
AdjustDropDownControls();
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto element = get_full_path_from_disk_list(cdfileList.getElementAt(idx));
|
||||
if (element != changed_prefs.cdslots[0].name)
|
||||
{
|
||||
strncpy(changed_prefs.cdslots[0].name, element.c_str(), MAX_DPATH);
|
||||
DISK_history_add (changed_prefs.cdslots[0].name, -1, HISTORY_CD, 0);
|
||||
changed_prefs.cdslots[0].inuse = true;
|
||||
changed_prefs.cdslots[0].type = SCSI_UNIT_DEFAULT;
|
||||
lstMRUCDList.erase(lstMRUCDList.begin() + idx);
|
||||
lstMRUCDList.insert(lstMRUCDList.begin(), changed_prefs.cdslots[0].name);
|
||||
bIgnoreListChange = true;
|
||||
cboCDFile->setSelected(0);
|
||||
bIgnoreListChange = false;
|
||||
}
|
||||
}
|
||||
RefreshPanelHD();
|
||||
RefreshPanelQuickstart();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static QSCDFileActionListener* cdFileActionListener;
|
||||
static QSCDActionListener* cdActionListener;
|
||||
|
||||
class QSWHDLoadActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
//---------------------------------------
|
||||
// WHDLoad file from list selected
|
||||
//---------------------------------------
|
||||
if (!bIgnoreListChange)
|
||||
{
|
||||
if (actionEvent.getSource() == cboWhdload)
|
||||
{
|
||||
const auto idx = cboWhdload->getSelected();
|
||||
|
||||
if (idx < 0)
|
||||
{
|
||||
whdload_prefs.whdload_filename = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto element = get_full_path_from_disk_list(whdloadFileList.getElementAt(idx));
|
||||
if (element != whdload_prefs.whdload_filename)
|
||||
{
|
||||
whdload_prefs.whdload_filename.assign(element);
|
||||
lstMRUWhdloadList.erase(lstMRUWhdloadList.begin() + idx);
|
||||
lstMRUWhdloadList.insert(lstMRUWhdloadList.begin(), whdload_prefs.whdload_filename);
|
||||
bIgnoreListChange = true;
|
||||
cboWhdload->setSelected(0);
|
||||
bIgnoreListChange = false;
|
||||
}
|
||||
whdload_auto_prefs(&changed_prefs, whdload_prefs.whdload_filename.c_str());
|
||||
}
|
||||
refresh_all_panels();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static QSWHDLoadActionListener* whdloadActionListener;
|
||||
|
||||
class QSWHDLoadButtonActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
@ -431,6 +378,9 @@ public:
|
||||
}
|
||||
else if (actionEvent.getSource() == cmdWhdloadSelect)
|
||||
{
|
||||
//---------------------------------------
|
||||
// Insert WHDLoad file
|
||||
//---------------------------------------
|
||||
std::string tmp;
|
||||
if (!whdload_prefs.whdload_filename.empty())
|
||||
tmp = whdload_prefs.whdload_filename;
|
||||
@ -443,19 +393,45 @@ public:
|
||||
add_file_to_mru_list(lstMRUWhdloadList, whdload_prefs.whdload_filename);
|
||||
RefreshWhdListModel();
|
||||
whdload_auto_prefs(&changed_prefs, whdload_prefs.whdload_filename.c_str());
|
||||
|
||||
|
||||
AdjustDropDownControls();
|
||||
SetLastActiveConfig(whdload_prefs.whdload_filename.c_str());
|
||||
}
|
||||
cmdWhdloadSelect->requestFocus();
|
||||
}
|
||||
refresh_all_panels();
|
||||
else if (actionEvent.getSource() == cboWhdload && !bIgnoreListChange)
|
||||
{
|
||||
//---------------------------------------
|
||||
// WHDLoad file from list selected
|
||||
//---------------------------------------
|
||||
const auto idx = cboWhdload->getSelected();
|
||||
|
||||
if (idx < 0)
|
||||
{
|
||||
whdload_prefs.whdload_filename = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto element = get_full_path_from_disk_list(whdloadFileList.getElementAt(idx));
|
||||
if (element != whdload_prefs.whdload_filename)
|
||||
{
|
||||
whdload_prefs.whdload_filename.assign(element);
|
||||
lstMRUWhdloadList.erase(lstMRUWhdloadList.begin() + idx);
|
||||
lstMRUWhdloadList.insert(lstMRUWhdloadList.begin(), whdload_prefs.whdload_filename);
|
||||
bIgnoreListChange = true;
|
||||
cboWhdload->setSelected(0);
|
||||
bIgnoreListChange = false;
|
||||
}
|
||||
whdload_auto_prefs(&changed_prefs, whdload_prefs.whdload_filename.c_str());
|
||||
}
|
||||
refresh_all_panels();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static QSWHDLoadButtonActionListener* whdloadButtonActionListener;
|
||||
static QSWHDLoadActionListener* whdloadActionListener;
|
||||
|
||||
class AmigaModelActionListener : public gcn::ActionListener
|
||||
class QuickstartActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
@ -491,7 +467,25 @@ public:
|
||||
refresh_all_panels();
|
||||
}
|
||||
|
||||
if (actionEvent.getSource() == cmdSetConfiguration)
|
||||
if (actionEvent.getSource() == chkNTSC)
|
||||
{
|
||||
if (chkNTSC->isSelected())
|
||||
{
|
||||
changed_prefs.ntscmode = true;
|
||||
changed_prefs.chipset_refreshrate = 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
changed_prefs.ntscmode = false;
|
||||
changed_prefs.chipset_refreshrate = 50;
|
||||
}
|
||||
RefreshPanelChipset();
|
||||
}
|
||||
else if (actionEvent.getSource() == chkQuickstartMode)
|
||||
{
|
||||
amiberry_options.quickstart_start = chkQuickstartMode->isSelected();
|
||||
}
|
||||
else if (actionEvent.getSource() == cmdSetConfiguration)
|
||||
{
|
||||
AdjustPrefs();
|
||||
refresh_all_panels();
|
||||
@ -499,34 +493,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static AmigaModelActionListener* amigaModelActionListener;
|
||||
static QuickstartActionListener* quickstartActionListener;
|
||||
|
||||
class QSNTSCButtonActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
if (chkNTSC->isSelected())
|
||||
{
|
||||
changed_prefs.ntscmode = true;
|
||||
changed_prefs.chipset_refreshrate = 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
changed_prefs.ntscmode = false;
|
||||
changed_prefs.chipset_refreshrate = 50;
|
||||
}
|
||||
RefreshPanelChipset();
|
||||
}
|
||||
};
|
||||
|
||||
static QSNTSCButtonActionListener* ntscButtonActionListener;
|
||||
|
||||
class QSDFxCheckActionListener : public gcn::ActionListener
|
||||
class QSDiskActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
int sub;
|
||||
for (auto i = 0; i < 2; ++i)
|
||||
{
|
||||
if (actionEvent.getSource() == chkqsDFx[i])
|
||||
@ -547,35 +521,18 @@ public:
|
||||
if (strlen(changed_prefs.floppyslots[i].df) <= 0)
|
||||
return;
|
||||
disk_setwriteprotect(&changed_prefs, i, changed_prefs.floppyslots[i].df,
|
||||
chkqsDFxWriteProtect[i]->isSelected());
|
||||
chkqsDFxWriteProtect[i]->isSelected());
|
||||
if (disk_getwriteprotect(&changed_prefs, changed_prefs.floppyslots[i].df, i) != chkqsDFxWriteProtect[i]->
|
||||
isSelected())
|
||||
{
|
||||
// Failed to change write protection -> maybe filesystem doesn't support this
|
||||
ShowMessage("Set/Clear write protect", "Failed to change write permission.",
|
||||
"Maybe underlying filesystem doesn't support this.", "", "Ok", "");
|
||||
"Maybe underlying filesystem doesn't support this.", "", "Ok", "");
|
||||
chkqsDFxWriteProtect[i]->requestFocus();
|
||||
}
|
||||
DISK_reinsert(i);
|
||||
}
|
||||
}
|
||||
|
||||
RefreshPanelFloppy();
|
||||
RefreshPanelQuickstart();
|
||||
}
|
||||
};
|
||||
|
||||
static QSDFxCheckActionListener* qsdfxCheckActionListener;
|
||||
|
||||
class QSDriveTypeActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
int sub;
|
||||
for (auto i = 0; i < 2; ++i)
|
||||
{
|
||||
if (actionEvent.getSource() == cboqsDFxType[i])
|
||||
else if (actionEvent.getSource() == cboqsDFxType[i])
|
||||
{
|
||||
const auto selectedType = cboqsDFxType[i]->getSelected();
|
||||
const int dfxtype = todfxtype(i, selectedType - 1, &sub);
|
||||
@ -592,22 +549,7 @@ public:
|
||||
changed_prefs.floppyslots[i].dfxsubtypeid[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
RefreshPanelFloppy();
|
||||
RefreshPanelQuickstart();
|
||||
}
|
||||
};
|
||||
|
||||
static QSDriveTypeActionListener* qsDriveTypeActionListener;
|
||||
|
||||
class QSDFxButtonActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
for (auto i = 0; i < 2; ++i)
|
||||
{
|
||||
if (actionEvent.getSource() == cmdqsDFxInfo[i])
|
||||
else if (actionEvent.getSource() == cmdqsDFxInfo[i])
|
||||
{
|
||||
//---------------------------------------
|
||||
// Show info about current disk-image
|
||||
@ -634,7 +576,8 @@ public:
|
||||
if (strlen(changed_prefs.floppyslots[i].df) > 0)
|
||||
tmp = std::string(changed_prefs.floppyslots[i].df);
|
||||
else
|
||||
tmp = current_dir;
|
||||
tmp = get_floppy_path();
|
||||
|
||||
tmp = SelectFile("Select disk image file", tmp, diskfile_filter);
|
||||
{
|
||||
if (strncmp(changed_prefs.floppyslots[i].df, tmp.c_str(), MAX_DPATH) != 0)
|
||||
@ -642,7 +585,6 @@ public:
|
||||
strncpy(changed_prefs.floppyslots[i].df, tmp.c_str(), MAX_DPATH);
|
||||
disk_insert(i, tmp.c_str());
|
||||
RefreshDiskListModel();
|
||||
current_dir = extract_path(tmp);
|
||||
|
||||
AdjustDropDownControls();
|
||||
SetLastActiveConfig(tmp.c_str());
|
||||
@ -650,22 +592,7 @@ public:
|
||||
}
|
||||
cmdqsDFxSelect[i]->requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
refresh_all_panels();
|
||||
}
|
||||
};
|
||||
|
||||
static QSDFxButtonActionListener* qsdfxButtonActionListener;
|
||||
|
||||
class QSDiskFileActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
for (auto i = 0; i < 2; ++i)
|
||||
{
|
||||
if (actionEvent.getSource() == cboqsDFxFile[i])
|
||||
else if (actionEvent.getSource() == cboqsDFxFile[i])
|
||||
{
|
||||
//---------------------------------------
|
||||
// Disk image from list selected
|
||||
@ -703,18 +630,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static QSDiskFileActionListener* diskFileActionListener;
|
||||
|
||||
class QuickstartModeActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
amiberry_options.quickstart_start = chkQuickstartMode->isSelected();
|
||||
}
|
||||
};
|
||||
|
||||
static QuickstartModeActionListener* quickstartModeActionListener;
|
||||
static QSDiskActionListener* qs_diskActionListener;
|
||||
|
||||
void InitPanelQuickstart(const config_category& category)
|
||||
{
|
||||
@ -742,17 +658,10 @@ void InitPanelQuickstart(const config_category& category)
|
||||
cdfileList.add(std::string(filename).append(" { ").append(full_path).append(" }"));
|
||||
}
|
||||
|
||||
amigaModelActionListener = new AmigaModelActionListener();
|
||||
ntscButtonActionListener = new QSNTSCButtonActionListener();
|
||||
qsdfxCheckActionListener = new QSDFxCheckActionListener();
|
||||
qsDriveTypeActionListener = new QSDriveTypeActionListener();
|
||||
qsdfxButtonActionListener = new QSDFxButtonActionListener();
|
||||
diskFileActionListener = new QSDiskFileActionListener();
|
||||
cdButtonActionListener = new QSCDButtonActionListener();
|
||||
cdFileActionListener = new QSCDFileActionListener();
|
||||
quickstartModeActionListener = new QuickstartModeActionListener();
|
||||
quickstartActionListener = new QuickstartActionListener();
|
||||
qs_diskActionListener = new QSDiskActionListener();
|
||||
cdActionListener = new QSCDActionListener();
|
||||
whdloadActionListener = new QSWHDLoadActionListener();
|
||||
whdloadButtonActionListener = new QSWHDLoadButtonActionListener();
|
||||
|
||||
lblModel = new gcn::Label("Amiga model:");
|
||||
lblModel->setAlignment(gcn::Graphics::RIGHT);
|
||||
@ -762,7 +671,7 @@ void InitPanelQuickstart(const config_category& category)
|
||||
cboModel->setBackgroundColor(colTextboxBackground);
|
||||
cboModel->setSelectionColor(gui_selection_color);
|
||||
cboModel->setId("cboAModel");
|
||||
cboModel->addActionListener(amigaModelActionListener);
|
||||
cboModel->addActionListener(quickstartActionListener);
|
||||
|
||||
lblConfig = new gcn::Label("Config:");
|
||||
lblConfig->setAlignment(gcn::Graphics::RIGHT);
|
||||
@ -773,13 +682,13 @@ void InitPanelQuickstart(const config_category& category)
|
||||
cboConfig->setBackgroundColor(colTextboxBackground);
|
||||
cboConfig->setSelectionColor(gui_selection_color);
|
||||
cboConfig->setId("cboAConfig");
|
||||
cboConfig->addActionListener(amigaModelActionListener);
|
||||
cboConfig->addActionListener(quickstartActionListener);
|
||||
|
||||
chkNTSC = new gcn::CheckBox("NTSC");
|
||||
chkNTSC->setId("qsNTSC");
|
||||
chkNTSC->setBaseColor(gui_baseCol);
|
||||
chkNTSC->setBackgroundColor(colTextboxBackground);
|
||||
chkNTSC->addActionListener(ntscButtonActionListener);
|
||||
chkNTSC->addActionListener(quickstartActionListener);
|
||||
|
||||
for (auto i = 0; i < 2; ++i)
|
||||
{
|
||||
@ -790,7 +699,7 @@ void InitPanelQuickstart(const config_category& category)
|
||||
chkqsDFx[i]->setId(tmp);
|
||||
chkqsDFx[i]->setBaseColor(gui_baseCol);
|
||||
chkqsDFx[i]->setBackgroundColor(colTextboxBackground);
|
||||
chkqsDFx[i]->addActionListener(qsdfxCheckActionListener);
|
||||
chkqsDFx[i]->addActionListener(qs_diskActionListener);
|
||||
|
||||
cboqsDFxType[i] = new gcn::DropDown(&qsDriveTypeList);
|
||||
cboqsDFxType[i]->setBaseColor(gui_baseCol);
|
||||
@ -798,36 +707,35 @@ void InitPanelQuickstart(const config_category& category)
|
||||
cboqsDFxType[i]->setSelectionColor(gui_selection_color);
|
||||
snprintf(tmp, 20, "cboqsType%d", i);
|
||||
cboqsDFxType[i]->setId(tmp);
|
||||
cboqsDFxType[i]->addActionListener(qsDriveTypeActionListener);
|
||||
cboqsDFxType[i]->addActionListener(qs_diskActionListener);
|
||||
|
||||
chkqsDFxWriteProtect[i] = new gcn::CheckBox("Write-protected");
|
||||
snprintf(tmp, 20, "qsWP%d", i);
|
||||
chkqsDFxWriteProtect[i]->setId(tmp);
|
||||
chkqsDFxWriteProtect[i]->setBaseColor(gui_baseCol);
|
||||
chkqsDFxWriteProtect[i]->setBackgroundColor(colTextboxBackground);
|
||||
chkqsDFxWriteProtect[i]->addActionListener(qsdfxCheckActionListener);
|
||||
|
||||
chkqsDFxWriteProtect[i]->addActionListener(qs_diskActionListener);
|
||||
|
||||
cmdqsDFxInfo[i] = new gcn::Button("?");
|
||||
snprintf(tmp, 20, "qsInfo%d", i);
|
||||
cmdqsDFxInfo[i]->setId(tmp);
|
||||
cmdqsDFxInfo[i]->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
|
||||
cmdqsDFxInfo[i]->setBaseColor(gui_baseCol);
|
||||
cmdqsDFxInfo[i]->addActionListener(qsdfxButtonActionListener);
|
||||
cmdqsDFxInfo[i]->addActionListener(qs_diskActionListener);
|
||||
|
||||
cmdqsDFxEject[i] = new gcn::Button("Eject");
|
||||
snprintf(tmp, 20, "qscmdEject%d", i);
|
||||
cmdqsDFxEject[i]->setId(tmp);
|
||||
cmdqsDFxEject[i]->setSize(SMALL_BUTTON_WIDTH * 2, SMALL_BUTTON_HEIGHT);
|
||||
cmdqsDFxEject[i]->setBaseColor(gui_baseCol);
|
||||
cmdqsDFxEject[i]->addActionListener(qsdfxButtonActionListener);
|
||||
cmdqsDFxEject[i]->addActionListener(qs_diskActionListener);
|
||||
|
||||
cmdqsDFxSelect[i] = new gcn::Button("Select file");
|
||||
snprintf(tmp, 20, "qscmdSel%d", i);
|
||||
cmdqsDFxSelect[i]->setId(tmp);
|
||||
cmdqsDFxSelect[i]->setSize(BUTTON_WIDTH + 10, SMALL_BUTTON_HEIGHT);
|
||||
cmdqsDFxSelect[i]->setBaseColor(gui_baseCol);
|
||||
cmdqsDFxSelect[i]->addActionListener(qsdfxButtonActionListener);
|
||||
cmdqsDFxSelect[i]->addActionListener(qs_diskActionListener);
|
||||
|
||||
cboqsDFxFile[i] = new gcn::DropDown(&diskfileList);
|
||||
snprintf(tmp, 20, "cboqsDisk%d", i);
|
||||
@ -836,7 +744,7 @@ void InitPanelQuickstart(const config_category& category)
|
||||
cboqsDFxFile[i]->setBaseColor(gui_baseCol);
|
||||
cboqsDFxFile[i]->setBackgroundColor(colTextboxBackground);
|
||||
cboqsDFxFile[i]->setSelectionColor(gui_selection_color);
|
||||
cboqsDFxFile[i]->addActionListener(diskFileActionListener);
|
||||
cboqsDFxFile[i]->addActionListener(qs_diskActionListener);
|
||||
}
|
||||
|
||||
chkCD = new gcn::CheckBox("CD drive");
|
||||
@ -849,13 +757,13 @@ void InitPanelQuickstart(const config_category& category)
|
||||
cmdCDEject->setSize(SMALL_BUTTON_WIDTH * 2, SMALL_BUTTON_HEIGHT);
|
||||
cmdCDEject->setBaseColor(gui_baseCol);
|
||||
cmdCDEject->setId("qscdEject");
|
||||
cmdCDEject->addActionListener(cdButtonActionListener);
|
||||
cmdCDEject->addActionListener(cdActionListener);
|
||||
|
||||
cmdCDSelect = new gcn::Button("Select image");
|
||||
cmdCDSelect->setSize(BUTTON_WIDTH + 10, SMALL_BUTTON_HEIGHT);
|
||||
cmdCDSelect->setBaseColor(gui_baseCol);
|
||||
cmdCDSelect->setId("qsCDSelect");
|
||||
cmdCDSelect->addActionListener(cdButtonActionListener);
|
||||
cmdCDSelect->addActionListener(cdActionListener);
|
||||
|
||||
cboCDFile = new gcn::DropDown(&cdfileList);
|
||||
cboCDFile->setSize(category.panel->getWidth() - 2 * DISTANCE_BORDER, cboCDFile->getHeight());
|
||||
@ -863,19 +771,19 @@ void InitPanelQuickstart(const config_category& category)
|
||||
cboCDFile->setBackgroundColor(colTextboxBackground);
|
||||
cboCDFile->setSelectionColor(gui_selection_color);
|
||||
cboCDFile->setId("cboCD");
|
||||
cboCDFile->addActionListener(cdFileActionListener);
|
||||
cboCDFile->addActionListener(cdActionListener);
|
||||
|
||||
chkQuickstartMode = new gcn::CheckBox("Start in Quickstart mode");
|
||||
chkQuickstartMode->setId("qsMode");
|
||||
chkQuickstartMode->setBaseColor(gui_baseCol);
|
||||
chkQuickstartMode->setBackgroundColor(colTextboxBackground);
|
||||
chkQuickstartMode->addActionListener(quickstartModeActionListener);
|
||||
chkQuickstartMode->addActionListener(quickstartActionListener);
|
||||
|
||||
cmdSetConfiguration = new gcn::Button("Set configuration");
|
||||
cmdSetConfiguration->setSize(BUTTON_WIDTH * 2, BUTTON_HEIGHT);
|
||||
cmdSetConfiguration->setBaseColor(gui_baseCol);
|
||||
cmdSetConfiguration->setId("cmdSetConfig");
|
||||
cmdSetConfiguration->addActionListener(amigaModelActionListener);
|
||||
cmdSetConfiguration->addActionListener(quickstartActionListener);
|
||||
|
||||
lblWhdload = new gcn::Label("WHDLoad auto-config:");
|
||||
cboWhdload = new gcn::DropDown(&whdloadFileList);
|
||||
@ -890,13 +798,13 @@ void InitPanelQuickstart(const config_category& category)
|
||||
cmdWhdloadEject->setSize(SMALL_BUTTON_WIDTH * 2, SMALL_BUTTON_HEIGHT);
|
||||
cmdWhdloadEject->setBaseColor(gui_baseCol);
|
||||
cmdWhdloadEject->setId("cmdQsWhdloadEject");
|
||||
cmdWhdloadEject->addActionListener(whdloadButtonActionListener);
|
||||
cmdWhdloadEject->addActionListener(whdloadActionListener);
|
||||
|
||||
cmdWhdloadSelect = new gcn::Button("Select file");
|
||||
cmdWhdloadSelect->setSize(BUTTON_WIDTH + 10, SMALL_BUTTON_HEIGHT);
|
||||
cmdWhdloadSelect->setBaseColor(gui_baseCol);
|
||||
cmdWhdloadSelect->setId("cmdQsWhdloadSelect");
|
||||
cmdWhdloadSelect->addActionListener(whdloadButtonActionListener);
|
||||
cmdWhdloadSelect->addActionListener(whdloadActionListener);
|
||||
|
||||
category.panel->add(lblModel, DISTANCE_BORDER, posY);
|
||||
category.panel->add(cboModel, DISTANCE_BORDER + lblModel->getWidth() + 8, posY);
|
||||
@ -992,17 +900,10 @@ void ExitPanelQuickstart()
|
||||
delete cmdWhdloadEject;
|
||||
delete cmdWhdloadSelect;
|
||||
|
||||
delete amigaModelActionListener;
|
||||
delete ntscButtonActionListener;
|
||||
delete qsdfxCheckActionListener;
|
||||
delete qsDriveTypeActionListener;
|
||||
delete qsdfxButtonActionListener;
|
||||
delete diskFileActionListener;
|
||||
delete cdButtonActionListener;
|
||||
delete cdFileActionListener;
|
||||
delete quickstartModeActionListener;
|
||||
delete quickstartActionListener;
|
||||
delete qs_diskActionListener;
|
||||
delete cdActionListener;
|
||||
delete whdloadActionListener;
|
||||
delete whdloadButtonActionListener;
|
||||
}
|
||||
|
||||
static void AdjustDropDownControls()
|
||||
|
||||
@ -118,6 +118,12 @@ extern std::string get_whdbootpath();
|
||||
extern void set_whdbootpath(const std::string& newpath);
|
||||
extern std::string get_whdload_arch_path();
|
||||
extern void set_whdload_arch_path(const std::string& newpath);
|
||||
extern std::string get_floppy_path();
|
||||
extern void set_floppy_path(const std::string& newpath);
|
||||
extern std::string get_harddrive_path();
|
||||
extern void set_harddrive_path(const std::string& newpath);
|
||||
extern std::string get_cdrom_path();
|
||||
extern void set_cdrom_path(const std::string& newpath);
|
||||
|
||||
extern bool get_logfile_enabled();
|
||||
extern void set_logfile_enabled(bool enabled);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user