Default the Open dialog to the directory of the currently emulated system. Made opening "Archives" the default in the File Dialog.

This commit is contained in:
skidau 2015-04-30 00:30:07 +00:00
parent 14ceac973e
commit 171d29a16c
1 changed files with 11 additions and 5 deletions

View File

@ -77,10 +77,16 @@ static wxString open_dir;
EVT_HANDLER(wxID_OPEN, "Open ROM...")
{
if(!open_dir.size())
if (gbEmulatorType == 1)
open_dir = gopts.gba_rom_dir;
else // if (gbEmulatorType == 5) // TODO: GBC rom dir
open_dir = gopts.gb_rom_dir;
// FIXME: ignore if non-existent or not a dir
wxString pats = _("GameBoy Advance Files (*.agb;*.gba;*.bin;*.elf;*.mb)|"
wxString pats = _(
"Archives (*.zip;*.7z;*.rar)|"
"*.zip;*.7z;*.rar"
"|GameBoy Advance Files (*.agb;*.gba;*.bin;*.elf;*.mb)|"
"*.agb;*.gba;*.bin;*.elf;*.mb"
"*.agb.gz;*.gba.gz;*.bin.gz;*.elf.gz;*.mb.gz"
"*.agb.z;*.gba.z;*.bin.z;*.elf.z;*.mb.z"
@ -88,8 +94,8 @@ EVT_HANDLER(wxID_OPEN, "Open ROM...")
"*.dmg;*.gb;*.gbc;*.cgb;*.sgb"
"*.dmg.gz;*.gb.gz;*.gbc.gz;*.cgb.gz;*.sgb.gz"
"*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z"
"|Archives (*.zip;*.7z;*.rar)"
"|*.zip;*.7z;*.rar|");
"|"
);
pats.append(wxALL_FILES);
wxFileDialog dlg(this, _("Open ROM file"), open_dir, wxT(""),
pats,