Disable play and record buttons if an iso was selected, but is later deselected.

This commit is contained in:
Rachel Bryk 2013-02-07 00:31:57 -05:00
parent 6bc9e7579c
commit 0ebe35e0ef
1 changed files with 5 additions and 2 deletions

View File

@ -57,6 +57,8 @@ size_t CGameListCtrl::m_numberItem = 0;
std::string CGameListCtrl::m_currentFilename; std::string CGameListCtrl::m_currentFilename;
bool sorted = false; bool sorted = false;
extern CFrame* main_frame;
static int CompareGameListItems(const GameListItem* iso1, const GameListItem* iso2, static int CompareGameListItems(const GameListItem* iso1, const GameListItem* iso2,
long sortData = CGameListCtrl::COLUMN_TITLE) long sortData = CGameListCtrl::COLUMN_TITLE)
{ {
@ -373,7 +375,8 @@ void CGameListCtrl::Update()
SetItemFont(index, *wxITALIC_FONT); SetItemFont(index, *wxITALIC_FONT);
SetColumnWidth(0, wxLIST_AUTOSIZE); SetColumnWidth(0, wxLIST_AUTOSIZE);
} }
if (GetSelectedISO() == NULL)
main_frame->UpdateGUI();
Show(); Show();
AutomaticColumnWidth(); AutomaticColumnWidth();
@ -975,7 +978,7 @@ const GameListItem * CGameListCtrl::GetSelectedISO()
{ {
long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (item == wxNOT_FOUND) if (item == wxNOT_FOUND)
return new GameListItem(""); // TODO: wtf is this return NULL;
else else
{ {
// Here is a little workaround for multiselections: // Here is a little workaround for multiselections: