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

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1376 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
skidau 2015-04-30 00:30:07 +00:00
parent daaae2563a
commit 5de802fab0
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...") EVT_HANDLER(wxID_OPEN, "Open ROM...")
{ {
if(!open_dir.size()) if (gbEmulatorType == 1)
open_dir = gopts.gba_rom_dir; 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 // 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;*.gba;*.bin;*.elf;*.mb"
"*.agb.gz;*.gba.gz;*.bin.gz;*.elf.gz;*.mb.gz" "*.agb.gz;*.gba.gz;*.bin.gz;*.elf.gz;*.mb.gz"
"*.agb.z;*.gba.z;*.bin.z;*.elf.z;*.mb.z" "*.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;*.gb;*.gbc;*.cgb;*.sgb"
"*.dmg.gz;*.gb.gz;*.gbc.gz;*.cgb.gz;*.sgb.gz" "*.dmg.gz;*.gb.gz;*.gbc.gz;*.cgb.gz;*.sgb.gz"
"*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z" "*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z"
"|Archives (*.zip;*.7z;*.rar)" "|"
"|*.zip;*.7z;*.rar|"); );
pats.append(wxALL_FILES); pats.append(wxALL_FILES);
wxFileDialog dlg(this, _("Open ROM file"), open_dir, wxT(""), wxFileDialog dlg(this, _("Open ROM file"), open_dir, wxT(""),
pats, pats,