QTfrontend/hwform.cpp
changeset 12241 0b5aa545e058
parent 12220 a7c08e4748ff
child 12242 09010333c947
equal deleted inserted replaced
12240:88b31fdc760b 12241:0b5aa545e058
   460     if(teamslist.empty())
   460     if(teamslist.empty())
   461     {
   461     {
   462         QString currentNickName = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8();
   462         QString currentNickName = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8();
   463         QString teamName;
   463         QString teamName;
   464 
   464 
       
   465         // Default team
   465         if (currentNickName.isEmpty())
   466         if (currentNickName.isEmpty())
   466         {
   467         {
   467             teamName = tr("DefaultTeam");
   468             teamName = tr("Team 1");
   468         }
   469         }
   469         else
   470         else
   470         {
   471         {
   471             teamName = tr("%1's Team").arg(currentNickName);
   472             teamName = tr("%1's Team").arg(currentNickName);
   472         }
   473         }
   473 
   474 
   474         HWTeam defaultTeam(teamName);
   475         HWTeam defaultTeam(teamName);
   475         defaultTeam.saveToFile();
   476         defaultTeam.saveToFile();
   476         teamslist.push_back(teamName);
   477         teamslist.push_back(teamName);
       
   478 
       
   479         // Team 2, Team 3, Team 4
       
   480         for(int i=2; i<=4; i++)
       
   481         {
       
   482             teamName = tr("Team %1").arg(i);
       
   483             HWTeam numberTeam(teamName);
       
   484             numberTeam.saveToFile();
       
   485             teamslist.push_back(teamName);
       
   486         }
   477     }
   487     }
   478 
   488 
   479     ui.pageOptions->CBTeamName->clear();
   489     ui.pageOptions->CBTeamName->clear();
   480     ui.pageOptions->CBTeamName->addItems(teamslist);
   490     ui.pageOptions->CBTeamName->addItems(teamslist);
   481     ui.pageCampaign->CBTeam->clear();
   491     ui.pageCampaign->CBTeam->clear();