371 pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3); |
371 pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3); |
372 QGridLayout * gbTBLayout = new QGridLayout(gbTwoBoxes); |
372 QGridLayout * gbTBLayout = new QGridLayout(gbTwoBoxes); |
373 gbTBLayout->setMargin(0); |
373 gbTBLayout->setMargin(0); |
374 gbTBLayout->setSpacing(0); |
374 gbTBLayout->setSpacing(0); |
375 gbTBLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); |
375 gbTBLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); |
|
376 |
|
377 QPixmap pmNew(":/res/new.png"); |
|
378 QPixmap pmEdit(":/res/edit.png"); |
|
379 QPixmap pmDelete(":/res/delete.png"); |
|
380 |
376 { |
381 { |
377 teamsBox = new IconedGroupBox(this); |
382 teamsBox = new IconedGroupBox(this); |
378 //teamsBox->setContentTopPadding(0); |
383 //teamsBox->setContentTopPadding(0); |
379 //teamsBox->setAttribute(Qt::WA_PaintOnScreen, true); |
384 //teamsBox->setAttribute(Qt::WA_PaintOnScreen, true); |
380 teamsBox->setIcon(QIcon(":/res/teamicon.png")); |
385 teamsBox->setIcon(QIcon(":/res/teamicon.png")); |
381 teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
386 teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
382 teamsBox->setTitle(QGroupBox::tr("Teams")); |
387 teamsBox->setTitle(QGroupBox::tr("Teams")); |
383 |
388 |
384 QVBoxLayout * GBTlayout = new QVBoxLayout(teamsBox); |
389 QGridLayout * GBTlayout = new QGridLayout(teamsBox); |
385 |
390 |
386 CBTeamName = new QComboBox(teamsBox); |
391 CBTeamName = new QComboBox(teamsBox); |
387 GBTlayout->addWidget(CBTeamName); |
392 GBTlayout->addWidget(CBTeamName, 0, 0); |
388 |
393 |
389 QHBoxLayout * layout1 = new QHBoxLayout; |
394 BtnNewTeam = new QPushButton(teamsBox); |
390 GBTlayout->addLayout(layout1); |
395 BtnNewTeam->setToolTip(tr("New team")); |
391 BtnNewTeam = addButton(tr("New team"), layout1, 0); |
396 BtnNewTeam->setIconSize(pmNew.size()); |
392 BtnEditTeam = addButton(tr("Edit team"), layout1, 1); |
397 BtnNewTeam->setIcon(pmNew); |
393 layout1->setStretchFactor(BtnNewTeam, 100); |
398 BtnNewTeam->setMaximumWidth(pmNew.width() + 6); |
394 layout1->setStretchFactor(BtnEditTeam, 100); |
399 GBTlayout->addWidget(BtnNewTeam, 0, 1); |
|
400 |
|
401 BtnEditTeam = new QPushButton(teamsBox); |
|
402 BtnEditTeam->setToolTip(tr("Edit team")); |
|
403 BtnEditTeam->setIconSize(pmEdit.size()); |
|
404 BtnEditTeam->setIcon(pmEdit); |
|
405 BtnEditTeam->setMaximumWidth(pmEdit.width() + 6); |
|
406 GBTlayout->addWidget(BtnEditTeam, 0, 2); |
|
407 |
|
408 BtnDeleteTeam = new QPushButton(teamsBox); |
|
409 BtnDeleteTeam->setToolTip(tr("Delete team")); |
|
410 BtnDeleteTeam->setIconSize(pmDelete.size()); |
|
411 BtnDeleteTeam->setIcon(pmDelete); |
|
412 BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6); |
|
413 BtnDeleteTeam->setEnabled(false); |
|
414 BtnDeleteTeam->setVisible(false); // hide for now |
|
415 GBTlayout->addWidget(BtnDeleteTeam, 0, 3); |
395 |
416 |
396 gbTBLayout->addWidget(teamsBox, 0, 0); |
417 gbTBLayout->addWidget(teamsBox, 0, 0); |
397 } |
418 } |
398 |
419 |
399 { |
420 { |
|
421 // TODO: This box should contain controls for all schemes: game modes and weapons |
|
422 |
400 IconedGroupBox* groupWeapons = new IconedGroupBox(this); |
423 IconedGroupBox* groupWeapons = new IconedGroupBox(this); |
401 //groupWeapons->setContentTopPadding(0); |
424 //groupWeapons->setContentTopPadding(0); |
402 groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
425 groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
403 groupWeapons->setIcon(QIcon(":/res/weaponsicon.png")); |
426 groupWeapons->setIcon(QIcon(":/res/weaponsicon.png")); |
404 //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
427 //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
405 groupWeapons->setTitle(QGroupBox::tr("Weapons")); |
428 groupWeapons->setTitle(QGroupBox::tr("Weapons")); |
406 QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons); |
429 QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons); |
407 |
430 |
408 WeaponsButt = addButton(tr("Weapons set"), WeaponsLayout, 1, 0); |
431 WeaponsName = new QComboBox(groupWeapons); |
409 WeaponsName = new QComboBox(this); |
432 WeaponsLayout->addWidget(WeaponsName, 0, 0); |
410 WeaponsLayout->addWidget(WeaponsName, 0, 0, 1, 2); |
433 |
411 WeaponEdit = addButton(tr("Edit"), WeaponsLayout, 1, 1); |
434 WeaponsButt = new QPushButton(groupWeapons); |
|
435 WeaponsButt->setToolTip(tr("New weapon scheme")); |
|
436 WeaponsButt->setIconSize(pmNew.size()); |
|
437 WeaponsButt->setIcon(pmNew); |
|
438 WeaponsButt->setMaximumWidth(pmNew.width() + 6); |
|
439 WeaponsLayout->addWidget(WeaponsButt, 0, 1); |
|
440 |
|
441 WeaponEdit = new QPushButton(groupWeapons); |
|
442 WeaponEdit->setToolTip(tr("Edit weapon scheme")); |
|
443 WeaponEdit->setIconSize(pmEdit.size()); |
|
444 WeaponEdit->setIcon(pmEdit); |
|
445 WeaponEdit->setMaximumWidth(pmEdit.width() + 6); |
|
446 WeaponsLayout->addWidget(WeaponEdit, 0, 2); |
|
447 |
|
448 WeaponDelete = new QPushButton(groupWeapons); |
|
449 WeaponDelete->setToolTip(tr("Delete weapon scheme")); |
|
450 WeaponDelete->setIconSize(pmDelete.size()); |
|
451 WeaponDelete->setIcon(pmDelete); |
|
452 WeaponDelete->setMaximumWidth(pmDelete.width() + 6); |
|
453 WeaponDelete->setEnabled(false); |
|
454 WeaponDelete->setVisible(false); // hide for now |
|
455 WeaponsLayout->addWidget(WeaponDelete, 0, 3); |
412 |
456 |
413 WeaponTooltip = new QCheckBox(this); |
457 WeaponTooltip = new QCheckBox(this); |
414 WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips")); |
458 WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips")); |
415 WeaponsLayout->addWidget(WeaponTooltip, 2, 0, 1, 2); |
459 WeaponsLayout->addWidget(WeaponTooltip, 1, 0, 1, 3); |
416 |
460 |
417 gbTBLayout->addWidget(groupWeapons, 1, 0); |
461 gbTBLayout->addWidget(groupWeapons, 1, 0); |
418 } |
462 } |
419 |
463 |
420 { |
464 { |