From 171d29a16c22d8b158ffc63a65bd1ad2c8722c3c Mon Sep 17 00:00:00 2001 From: skidau Date: Thu, 30 Apr 2015 00:30:07 +0000 Subject: [PATCH] Default the Open dialog to the directory of the currently emulated system. Made opening "Archives" the default in the File Dialog. --- src/wx/cmdevents.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index 5a72846f..69c1fd5a 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -77,10 +77,16 @@ static wxString open_dir; EVT_HANDLER(wxID_OPEN, "Open ROM...") { - if(!open_dir.size()) - open_dir = gopts.gba_rom_dir; + 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,