QTfrontend/team.cpp
changeset 25 27aa8030322b
parent 21 dff476dcaaa3
child 26 e32fa14529f8
equal deleted inserted replaced
24:79c411363184 25:27aa8030322b
    34 #include <QFile>
    34 #include <QFile>
    35 #include <QTextStream>
    35 #include <QTextStream>
    36 #include "team.h"
    36 #include "team.h"
    37 #include "hwform.h"
    37 #include "hwform.h"
    38 
    38 
    39 HWTeam::HWTeam()
    39 HWTeam::HWTeam(const QString & teamname)
    40 {
    40 {
    41 	TeamName = "unnamed";
    41 	TeamName = teamname;
    42 	for (int i = 0; i < 8; i++) HHName[i].sprintf("hedgehog %d", i);
    42 	for (int i = 0; i < 8; i++) HHName[i].sprintf("hedgehog %d", i);
    43 	Grave = "Simple";
    43 	Grave = "Simple";
    44 	Fort = "Barrelhouse";
    44 	Fort = "Barrelhouse";
    45 	for(int i = 0; i < BINDS_NUMBER; i++)
    45 	for(int i = 0; i < BINDS_NUMBER; i++)
    46 	{
    46 	{
   124 	return true;
   124 	return true;
   125 }
   125 }
   126 
   126 
   127 void HWTeam::SetToPage(HWForm * hwform)
   127 void HWTeam::SetToPage(HWForm * hwform)
   128 {
   128 {
   129 	form->TeamNameEdit->setText(TeamName);
   129 	hwform->TeamNameEdit->setText(TeamName);
   130 	for(int i = 0; i < 8; i++)
   130 	for(int i = 0; i < 8; i++)
   131 	{
   131 	{
   132 		form->HHNameEdit[i]->setText(HHName[i]);
   132 		hwform->HHNameEdit[i]->setText(HHName[i]);
   133 	}
   133 	}
   134 	form->ui.CBGrave->setCurrentIndex(form->ui.CBGrave->findText(Grave));
   134 	hwform->ui.CBGrave->setCurrentIndex(hwform->ui.CBGrave->findText(Grave));
   135 	form->CBGrave_activated(Grave);
   135 	hwform->CBGrave_activated(Grave);
   136 	
   136 	
   137 	form->ui.CBFort->setCurrentIndex(form->ui.CBFort->findText(Fort));
   137 	hwform->ui.CBFort->setCurrentIndex(hwform->ui.CBFort->findText(Fort));
   138 	form->CBFort_activated(Fort);
   138 	hwform->CBFort_activated(Fort);
   139 	
   139 	
   140 	for(int i = 0; i < BINDS_NUMBER; i++)
   140 	for(int i = 0; i < BINDS_NUMBER; i++)
   141 	{
   141 	{
   142 		form->CBBind[i]->setCurrentIndex(form->CBBind[i]->findText(binds[i].strbind));
   142 		hwform->CBBind[i]->setCurrentIndex(hwform->CBBind[i]->findText(binds[i].strbind));
   143 	}
   143 	}
   144 }
   144 }
   145 
   145 
   146 void HWTeam::GetFromPage(HWForm * hwform)
   146 void HWTeam::GetFromPage(HWForm * hwform)
   147 {
   147 {
   148 	TeamName  = form->TeamNameEdit->text();
   148 	TeamName  = hwform->TeamNameEdit->text();
   149 	for(int i = 0; i < 8; i++)
   149 	for(int i = 0; i < 8; i++)
   150 	{
   150 	{
   151 		HHName[i] = form->HHNameEdit[i]->text();
   151 		HHName[i] = hwform->HHNameEdit[i]->text();
   152 	}
   152 	}
   153 	
   153 	
   154 	Grave = form->ui.CBGrave->currentText();
   154 	Grave = hwform->ui.CBGrave->currentText();
   155 	Fort = form->ui.CBFort->currentText();
   155 	Fort = hwform->ui.CBFort->currentText();
   156 	for(int i = 0; i < 8; i++)
   156 	for(int i = 0; i < 8; i++)
   157 	{
   157 	{
   158 		binds[i].strbind = form->CBBind[i]->currentText();
   158 		binds[i].strbind = hwform->CBBind[i]->currentText();
   159 	}
   159 	}
   160 }
   160 }
   161 
   161 
   162 void HWTeam::SetCfgDir(const QString & dir)
   162 void HWTeam::SetCfgDir(const QString & dir)
   163 {
   163 {