Fix deactivating entry field.

This commit is contained in:
hiker 2014-06-05 10:12:26 +10:00
parent 67c6e1b61e
commit b417a5c612

View File

@ -111,14 +111,16 @@ void BaseUserScreen::init()
PlayerProfile *player = PlayerManager::getCurrentPlayer(); PlayerProfile *player = PlayerManager::getCurrentPlayer();
const stringw &online_name = player->getLastOnlineName(); const stringw &online_name = player->getLastOnlineName();
m_username_tb->setText(online_name); m_username_tb->setText(online_name);
if(online_name.size()>0)
m_username_tb->setDeactivated();
else
m_username_tb->setActivated();
// Select 'online // Select 'online
m_online_cb->setState(player->wasOnlineLastTime() || m_online_cb->setState(player->wasOnlineLastTime() ||
player->isLoggedIn() ); player->isLoggedIn() );
makeEntryFieldsVisible(); makeEntryFieldsVisible();
// We have to deactivate after make visible (since make visible
// automatically activates widgets).
if(online_name.size()>0)
m_username_tb->setDeactivated();
else
m_username_tb->setActivated();
} }
else // no current player found else // no current player found
{ {