Do not BootGame if there are no items in the GameListCtrl, fix test to see if cancel was chosen from File > Open.

Fixes issue 1046.
it does leak 10kB every time that GetSelectedISO is called, I am not too worried about this. The other ways of accomplishing this would be more complicated, for little gain. Feel free to revert everything except line 466 of FrameTools.cpp :P

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3625 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99
2009-07-01 04:55:53 +00:00
parent 656ba06e40
commit 52e424485f
3 changed files with 8 additions and 7 deletions

View File

@ -420,8 +420,9 @@ void CFrame::BootGame()
}
UpdateGUI();
}
// Start the selected ISO
else if (m_GameListCtrl->GetSelectedISO() != 0)
// Start the selected ISO, return if gamelist is empty
else if (m_GameListCtrl->GetSelectedISO() == 0) return;
else if (m_GameListCtrl->GetSelectedISO()->IsValid())
{
BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName());
}
@ -462,7 +463,7 @@ void CFrame::DoOpen(bool Boot)
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
this);
bool fileChosen = path ? true : false;
bool fileChosen = !path.IsEmpty();
std::string currentDir2 = File::GetCurrentDirectory();