QTfrontend/hwform.cpp
changeset 50 9ab4067dabec
parent 45 1072e7fe85c8
child 52 ae2950c5465c
equal deleted inserted replaced
49:3afe33c1cf06 50:9ab4067dabec
    43 
    43 
    44 #include "hwform.h"
    44 #include "hwform.h"
    45 #include "sdlkeys.h"
    45 #include "sdlkeys.h"
    46 #include "hwconsts.h"
    46 #include "hwconsts.h"
    47 //#include "gamecmds.h"
    47 //#include "gamecmds.h"
       
    48 #include "teamselect.h"
    48 
    49 
    49 HWForm::HWForm(QWidget *parent)
    50 HWForm::HWForm(QWidget *parent)
    50 	: QMainWindow(parent)
    51 	: QMainWindow(parent)
    51 {
    52 {
    52 	ui.setupUi(this);
    53 	ui.setupUi(this);
   123 	  list.push_back("DefaultTeam");
   124 	  list.push_back("DefaultTeam");
   124 	}
   125 	}
   125 
   126 
   126 	for (QStringList::Iterator it = list.begin(); it != list.end(); ++it )
   127 	for (QStringList::Iterator it = list.begin(); it != list.end(); ++it )
   127 	{
   128 	{
   128 		ui.CBTeamName->addItem((*it).replace(QRegExp("^(.*).cfg$"), "\\1"));
   129 	  QString tmpTeamStr=(*it).replace(QRegExp("^(.*).cfg$"), "\\1");
       
   130 	  m_teamNames.push_back(tmpTeamStr);
       
   131 	  ui.CBTeamName->addItem(tmpTeamStr);
   129 	}
   132 	}
   130 
   133 
   131 	QFile settings(cfgdir.absolutePath() + "/options");
   134 	QFile settings(cfgdir.absolutePath() + "/options");
   132 	if (settings.open(QIODevice::ReadOnly))
   135 	if (settings.open(QIODevice::ReadOnly))
   133 	{
   136 	{
   190 }
   193 }
   191 
   194 
   192 void HWForm::GoToSinglePlayer()
   195 void HWForm::GoToSinglePlayer()
   193 {
   196 {
   194 	ui.Pages->setCurrentIndex(ID_PAGE_SINGLEPLAYER);
   197 	ui.Pages->setCurrentIndex(ID_PAGE_SINGLEPLAYER);
       
   198 
       
   199 	TeamSelWidget* pts=new TeamSelWidget(m_teamNames, ui.Pages->widget(ID_PAGE_SINGLEPLAYER));
       
   200 
       
   201 	pts->resize(500, 350);
       
   202 	pts->show();
   195 }
   203 }
   196 
   204 
   197 void HWForm::GoToSetup()
   205 void HWForm::GoToSetup()
   198 {
   206 {
   199 	ui.Pages->setCurrentIndex(ID_PAGE_SETUP);
   207 	ui.Pages->setCurrentIndex(ID_PAGE_SETUP);