mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -508,8 +508,8 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
|||||||
// 2. All Regions are set to hide
|
// 2. All Regions are set to hide
|
||||||
// Otherwise call BootGame to either...
|
// Otherwise call BootGame to either...
|
||||||
// 1. Boot the selected iso
|
// 1. Boot the selected iso
|
||||||
// 2. Call BrowseForDirectory and boot the default or last loaded iso.
|
// 2. Boot the default or last loaded iso.
|
||||||
// TODO: (LPFaint99) We shouldn't boot an iso after BrowseForDirectory
|
// 3. Call BrowseForDirectory if the gamelist is empty
|
||||||
if (!m_GameListCtrl->GetGameNames().size() &&
|
if (!m_GameListCtrl->GetGameNames().size() &&
|
||||||
!((SConfig::GetInstance().m_ListGC ||
|
!((SConfig::GetInstance().m_ListGC ||
|
||||||
SConfig::GetInstance().m_ListWii ||
|
SConfig::GetInstance().m_ListWii ||
|
||||||
|
@ -420,8 +420,9 @@ void CFrame::BootGame()
|
|||||||
}
|
}
|
||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
}
|
}
|
||||||
// Start the selected ISO
|
// Start the selected ISO, return if gamelist is empty
|
||||||
else if (m_GameListCtrl->GetSelectedISO() != 0)
|
else if (m_GameListCtrl->GetSelectedISO() == 0) return;
|
||||||
|
else if (m_GameListCtrl->GetSelectedISO()->IsValid())
|
||||||
{
|
{
|
||||||
BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName());
|
BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName());
|
||||||
}
|
}
|
||||||
@ -462,7 +463,7 @@ void CFrame::DoOpen(bool Boot)
|
|||||||
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
|
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
bool fileChosen = path ? true : false;
|
bool fileChosen = !path.IsEmpty();
|
||||||
|
|
||||||
std::string currentDir2 = File::GetCurrentDirectory();
|
std::string currentDir2 = File::GetCurrentDirectory();
|
||||||
|
|
||||||
|
@ -727,8 +727,8 @@ const GameListItem * CGameListCtrl::GetSelectedISO()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
||||||
if (item == -1) // -1 means the selection is bogus, not a gamelistitem
|
if (item == wxNOT_FOUND)
|
||||||
return 0;
|
return new GameListItem("");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Here is a little workaround for multiselections:
|
// Here is a little workaround for multiselections:
|
||||||
|
Reference in New Issue
Block a user