equal
deleted
inserted
replaced
42 #include <QTextStream> |
42 #include <QTextStream> |
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 "teamselect.h" |
|
48 |
47 |
49 HWForm::HWForm(QWidget *parent) |
48 HWForm::HWForm(QWidget *parent) |
50 : QMainWindow(parent) |
49 : QMainWindow(parent) |
51 { |
50 { |
52 ui.setupUi(this); |
51 ui.setupUi(this); |
121 defaultTeam.SetCfgDir(cfgdir.absolutePath()); |
120 defaultTeam.SetCfgDir(cfgdir.absolutePath()); |
122 defaultTeam.SaveToFile(); |
121 defaultTeam.SaveToFile(); |
123 list.push_back("DefaultTeam"); |
122 list.push_back("DefaultTeam"); |
124 } |
123 } |
125 |
124 |
|
125 pts=new TeamSelWidget(ui.Pages->widget(ID_PAGE_SINGLEPLAYER)); |
|
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 QString tmpTeamStr=(*it).replace(QRegExp("^(.*).cfg$"), "\\1"); |
129 QString tmpTeamStr=(*it).replace(QRegExp("^(.*).cfg$"), "\\1"); |
129 m_teamNames.push_back(tmpTeamStr); |
130 pts->addTeam(tmpTeamStr); |
130 ui.CBTeamName->addItem(tmpTeamStr); |
131 ui.CBTeamName->addItem(tmpTeamStr); |
131 } |
132 } |
132 |
133 |
133 QFile settings(cfgdir.absolutePath() + "/options"); |
134 QFile settings(cfgdir.absolutePath() + "/options"); |
134 if (settings.open(QIODevice::ReadOnly)) |
135 if (settings.open(QIODevice::ReadOnly)) |
193 |
194 |
194 void HWForm::GoToSinglePlayer() |
195 void HWForm::GoToSinglePlayer() |
195 { |
196 { |
196 ui.Pages->setCurrentIndex(ID_PAGE_SINGLEPLAYER); |
197 ui.Pages->setCurrentIndex(ID_PAGE_SINGLEPLAYER); |
197 |
198 |
198 TeamSelWidget* pts=new TeamSelWidget(m_teamNames, ui.Pages->widget(ID_PAGE_SINGLEPLAYER)); |
|
199 |
|
200 pts->resize(500, 350); |
199 pts->resize(500, 350); |
201 pts->show(); |
200 pts->show(); |
202 } |
201 } |
203 |
202 |
204 void HWForm::GoToSetup() |
203 void HWForm::GoToSetup() |