89 PageEditTeam::PageEditTeam(QWidget* parent) : |
89 PageEditTeam::PageEditTeam(QWidget* parent) : |
90 AbstractPage(parent) |
90 AbstractPage(parent) |
91 { |
91 { |
92 QGridLayout * pageLayout = new QGridLayout(this); |
92 QGridLayout * pageLayout = new QGridLayout(this); |
93 QTabWidget * tbw = new QTabWidget(this); |
93 QTabWidget * tbw = new QTabWidget(this); |
94 QWidget * page1 = new QWidget(); |
94 QWidget * page1 = new QWidget(this); |
95 QWidget * page2 = new QWidget(); |
95 QWidget * page2 = new QWidget(this); |
96 tbw->addTab(page1, tr("General")); |
96 tbw->addTab(page1, tr("General")); |
97 tbw->addTab(page2, tr("Advanced")); |
97 tbw->addTab(page2, tr("Advanced")); |
98 pageLayout->addWidget(tbw, 0, 0, 1, 3); |
98 pageLayout->addWidget(tbw, 0, 0, 1, 3); |
99 BtnTeamDiscard = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
99 BtnTeamDiscard = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
100 BtnTeamSave = addButton(":/res/Save.png", pageLayout, 1, 2, true);; |
100 BtnTeamSave = addButton(":/res/Save.png", pageLayout, 1, 2, true);; |
197 GBoxBinds->setTitle(QGroupBox::tr("Key binds")); |
197 GBoxBinds->setTitle(QGroupBox::tr("Key binds")); |
198 QGridLayout * GBBLayout = new QGridLayout(GBoxBinds); |
198 QGridLayout * GBBLayout = new QGridLayout(GBoxBinds); |
199 BindsBox = new QToolBox(GBoxBinds); |
199 BindsBox = new QToolBox(GBoxBinds); |
200 BindsBox->setLineWidth(0); |
200 BindsBox->setLineWidth(0); |
201 GBBLayout->addWidget(BindsBox); |
201 GBBLayout->addWidget(BindsBox); |
202 page_A = new QWidget(); |
202 page_A = new QWidget(this); |
203 BindsBox->addItem(page_A, QToolBox::tr("Actions")); |
203 BindsBox->addItem(page_A, QToolBox::tr("Actions")); |
204 page_W = new QWidget(); |
204 page_W = new QWidget(this); |
205 BindsBox->addItem(page_W, QToolBox::tr("Weapons")); |
205 BindsBox->addItem(page_W, QToolBox::tr("Weapons")); |
206 page_WP = new QWidget(); |
206 page_WP = new QWidget(this); |
207 BindsBox->addItem(page_WP, QToolBox::tr("Weapon properties")); |
207 BindsBox->addItem(page_WP, QToolBox::tr("Weapon properties")); |
208 page_O = new QWidget(); |
208 page_O = new QWidget(this); |
209 BindsBox->addItem(page_O, QToolBox::tr("Other")); |
209 BindsBox->addItem(page_O, QToolBox::tr("Other")); |
210 page2Layout->addWidget(GBoxBinds, 0, 0); |
210 page2Layout->addWidget(GBoxBinds, 0, 0); |
211 |
211 |
212 QStringList binds; |
212 QStringList binds; |
213 for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
213 for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
216 } |
216 } |
217 |
217 |
218 quint16 widind = 0, i = 0; |
218 quint16 widind = 0, i = 0; |
219 while (i < BINDS_NUMBER) { |
219 while (i < BINDS_NUMBER) { |
220 quint16 num = 0; |
220 quint16 num = 0; |
221 QGridLayout * pagelayout = new QGridLayout(BindsBox->widget(widind)); |
221 QWidget * curW = BindsBox->widget(widind); |
|
222 QGridLayout * pagelayout = new QGridLayout(curW); |
222 do { |
223 do { |
223 LBind[i] = new QLabel(BindsBox->widget(widind)); |
224 LBind[i] = new QLabel(curW); |
224 LBind[i]->setText(QApplication::translate("binds", cbinds[i].name)); |
225 LBind[i]->setText(QApplication::translate("binds", cbinds[i].name)); |
225 LBind[i]->setAlignment(Qt::AlignRight); |
226 LBind[i]->setAlignment(Qt::AlignRight); |
226 pagelayout->addWidget(LBind[i], num, 0); |
227 pagelayout->addWidget(LBind[i], num, 0); |
227 CBBind[i] = new QComboBox(BindsBox->widget(widind)); |
228 CBBind[i] = new QComboBox(curW); |
228 CBBind[i]->addItems(binds); |
229 CBBind[i]->addItems(binds); |
229 pagelayout->addWidget(CBBind[i], num, 1); |
230 pagelayout->addWidget(CBBind[i], num, 1); |
230 num++; |
231 num++; |
231 } while (!cbinds[i++].chwidget); |
232 } while (!cbinds[i++].chwidget); |
232 pagelayout->addWidget(new QWidget(BindsBox->widget(widind)), num, 0, 1, 2); |
233 pagelayout->addWidget(new QWidget(curW), num, 0, 1, 2); |
233 widind++; |
234 widind++; |
234 } |
235 } |
235 } |
236 } |
236 |
237 |
237 void PageEditTeam::CBFort_activated(const QString & fortname) |
238 void PageEditTeam::CBFort_activated(const QString & fortname) |