GCI: use player's name for the default team
authorzero579911
Thu, 29 Nov 2012 04:57:35 +0100
changeset 8136 c2196b1dccb4
parent 8131 2c8e8c204490
child 8138 cfb228baa598
GCI: use player's name for the default team task: http://www.google-melange.com/gci/task/view/google/gci2012/8007227 note: these bugs were NOT introduced by this: - double confirmation on team removal - team addition fails
QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp	Wed Nov 28 10:57:07 2012 -0500
+++ b/QTfrontend/hwform.cpp	Thu Nov 29 04:57:35 2012 +0100
@@ -453,9 +453,19 @@
 
     if(teamslist.empty())
     {
-        HWTeam defaultTeam(tr("DefaultTeam"));
+        QString currentNickName = gameSettings->value("net/nick","").toString().toUtf8();
+        QString teamName;
+        if (currentNickName == "")
+        {
+            teamName = tr("DefaultTeam");
+        }
+        else
+        {
+            teamName = tr("%1's Team").arg(currentNickName);
+        }
+        HWTeam defaultTeam(teamName);
         defaultTeam.saveToFile();
-        teamslist.push_back(tr("DefaultTeam"));
+        teamslist.push_back(teamName);
     }
 
     ui.pageOptions->CBTeamName->clear();