QTfrontend/teamselhelper.cpp
changeset 6015 daffc14a518a
parent 5423 48b7823ec7e4
equal deleted inserted replaced
6014:b432c4b9cc9b 6015:daffc14a518a
    44     mainLayout.setSpacing(3);
    44     mainLayout.setSpacing(3);
    45     mainLayout.setMargin(0);
    45     mainLayout.setMargin(0);
    46     this->setMaximumHeight(38);
    46     this->setMaximumHeight(38);
    47     this->setMinimumHeight(38);
    47     this->setMinimumHeight(38);
    48     QIcon difficultyIcon=team.isNetTeam() ?
    48     QIcon difficultyIcon=team.isNetTeam() ?
    49         QIcon(QString(":/res/botlevels/net%1.png").arg(m_team.difficulty))
    49         QIcon(QString(":/res/botlevels/net%1.png").arg(m_team.difficulty()))
    50         : QIcon(QString(":/res/botlevels/%1.png").arg(m_team.difficulty));
    50         : QIcon(QString(":/res/botlevels/%1.png").arg(m_team.difficulty()));
    51 
    51 
    52     butt = new QPushButton(difficultyIcon, team.TeamName.replace("&","&&"), this);
    52     butt = new QPushButton(difficultyIcon, team.name().replace("&","&&"), this);
    53     butt->setFlat(true);
    53     butt->setFlat(true);
    54     butt->setToolTip(team.Owner);
    54     butt->setToolTip(team.owner());
    55     mainLayout.addWidget(butt);
    55     mainLayout.addWidget(butt);
    56     butt->setStyleSheet("QPushButton{"
    56     butt->setStyleSheet("QPushButton{"
    57             "icon-size: 48px;"
    57             "icon-size: 48px;"
    58             "text-align: left;"
    58             "text-align: left;"
    59             "background-color: #0d0544;"
    59             "background-color: #0d0544;"
    74         connect(colorButt, SIGNAL(clicked()), this, SLOT(changeTeamColor()));
    74         connect(colorButt, SIGNAL(clicked()), this, SLOT(changeTeamColor()));
    75         mainLayout.addWidget(colorButt);
    75         mainLayout.addWidget(colorButt);
    76 
    76 
    77         phhoger = new CHedgehogerWidget(QImage(":/res/hh25x25.png"), QImage(":/res/hh25x25grey.png"), this);
    77         phhoger = new CHedgehogerWidget(QImage(":/res/hh25x25.png"), QImage(":/res/hh25x25grey.png"), this);
    78         connect(phhoger, SIGNAL(hedgehogsNumChanged()), this, SLOT(hhNumChanged()));
    78         connect(phhoger, SIGNAL(hedgehogsNumChanged()), this, SLOT(hhNumChanged()));
    79         phhoger->setHHNum(team.numHedgehogs);
    79         phhoger->setHHNum(team.numHedgehogs());
    80         mainLayout.addWidget(phhoger);
    80         mainLayout.addWidget(phhoger);
    81     } else {
    81     } else {
    82     }
    82     }
    83 
    83 
    84     QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam()));
    84     QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam()));
   100   phhoger->setHHNum(num);
   100   phhoger->setHHNum(num);
   101 }
   101 }
   102 
   102 
   103 void TeamShowWidget::hhNumChanged()
   103 void TeamShowWidget::hhNumChanged()
   104 {
   104 {
   105   m_team.numHedgehogs=phhoger->getHedgehogsNum();
   105   m_team.setNumHedgehogs(phhoger->getHedgehogsNum());
   106   emit hhNmChanged(m_team);
   106   emit hhNmChanged(m_team);
   107 }
   107 }
   108 
   108 
   109 void TeamShowWidget::activateTeam()
   109 void TeamShowWidget::activateTeam()
   110 {
   110 {
   142             "background-color: %1;"
   142             "background-color: %1;"
   143             "border-width: 1px;"
   143             "border-width: 1px;"
   144             "border-radius: 2px;"
   144             "border-radius: 2px;"
   145             "}").arg(pOurFrameTeams->currentColor->name()));
   145             "}").arg(pOurFrameTeams->currentColor->name()));
   146 
   146 
   147     m_team.teamColor=color;
   147     m_team.setColor(color);
   148     emit teamColorChanged(m_team);
   148     emit teamColorChanged(m_team);
   149 }
   149 }
   150 
   150 
   151 HWTeam TeamShowWidget::getTeam() const
   151 HWTeam TeamShowWidget::getTeam() const
   152 {
   152 {