Save config file when relevant. Forbid editing or removing the guest account through the GUI

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5041 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-03-22 01:39:01 +00:00
parent 1b7eb82392
commit 84f4d6d3f3
2 changed files with 8 additions and 3 deletions

View File

@ -326,6 +326,7 @@ UserConfig::UserConfig()
if(!loadConfig() || UserConfigParams::m_all_players.size() == 0)
{
addDefaultPlayer();
saveConfig();
}
} // UserConfig

View File

@ -118,6 +118,7 @@ void OptionsScreenPlayers::deletePlayer(PlayerProfile* player)
void OptionsScreenPlayers::tearDown()
{
user_config->saveConfig();
}
// -----------------------------------------------------------------------------
@ -148,11 +149,14 @@ void OptionsScreenPlayers::eventCallback(Widget* widget, const std::string& name
std::string selectedPlayer = players->getSelectionName();
const int playerAmount = UserConfigParams::m_all_players.size();
for(int n=0; n<playerAmount; n++)
for (int n=0; n<playerAmount; n++)
{
if(UserConfigParams::m_all_players[n].getName() == selectedPlayer)
if (UserConfigParams::m_all_players[n].getName() == selectedPlayer)
{
new PlayerInfoDialog( &UserConfigParams::m_all_players[n], 0.5f, 0.6f );
if (!(UserConfigParams::m_all_players[n].isGuestAccount()))
{
new PlayerInfoDialog( &UserConfigParams::m_all_players[n], 0.5f, 0.6f );
}
return;
}
} // end for