45 pageLayout->addWidget(gb, 1,0,13,5); |
46 pageLayout->addWidget(gb, 1,0,13,5); |
46 |
47 |
47 gbGameModes = new QGroupBox(QGroupBox::tr("Game Modifiers"), gb); |
48 gbGameModes = new QGroupBox(QGroupBox::tr("Game Modifiers"), gb); |
48 gbBasicSettings = new QGroupBox(QGroupBox::tr("Basic Settings"), gb); |
49 gbBasicSettings = new QGroupBox(QGroupBox::tr("Basic Settings"), gb); |
49 |
50 |
|
51 // TODO name stuff and put CSS into main style sheet |
50 gbGameModes->setStyleSheet(".QGroupBox {" |
52 gbGameModes->setStyleSheet(".QGroupBox {" |
51 "background-color: #130f2c; background-image:url();" |
53 "background-color: #130f2c; background-image:url();" |
52 "}"); |
54 "}"); |
53 gbBasicSettings->setStyleSheet(".QGroupBox {" |
55 gbBasicSettings->setStyleSheet(".QGroupBox {" |
54 "background-color: #130f2c; background-image:url();" |
56 "background-color: #130f2c; background-image:url();" |
386 LE_name = new QLineEdit(this); |
388 LE_name = new QLineEdit(this); |
387 |
389 |
388 gl->addWidget(LE_name,15,1,1,5); |
390 gl->addWidget(LE_name,15,1,1,5); |
389 gl->addWidget(l,15,0,1,1); |
391 gl->addWidget(l,15,0,1,1); |
390 |
392 |
391 mapper = new QDataWidgetMapper(this); |
393 return pageLayout; |
392 |
394 } |
393 |
395 |
394 BtnBack = addButton(":/res/Exit.png", pageLayout, 16, 0, true); |
396 QLayout * PageScheme::footerLayoutDefinition() |
395 connect(BtnBack, SIGNAL(clicked()), this, SIGNAL(goBack())); |
397 { |
396 |
398 QHBoxLayout * bottomLayout = new QHBoxLayout(); |
397 |
|
398 BtnCopy = addButton(tr("Copy"), pageLayout, 16, 2); |
|
399 BtnNew = addButton(tr("New"), pageLayout, 16, 3); |
|
400 BtnDelete = addButton(tr("Delete"), pageLayout, 16, 4); |
|
401 |
|
402 selectScheme = new QComboBox(this); |
399 selectScheme = new QComboBox(this); |
403 pageLayout->addWidget(selectScheme, 16, 1); |
400 |
404 |
401 bottomLayout->addWidget(selectScheme, 0); |
|
402 BtnCopy = addButton(tr("Copy"), bottomLayout, 1); |
|
403 BtnNew = addButton(tr("New"), bottomLayout, 2); |
|
404 BtnDelete = addButton(tr("Delete"), bottomLayout, 3); |
|
405 |
|
406 bottomLayout->setStretch(1,1); |
|
407 bottomLayout->setStretch(2,1); |
|
408 bottomLayout->setStretch(3,1); |
|
409 |
|
410 return bottomLayout; |
|
411 } |
|
412 |
|
413 void PageScheme::connectSignals() |
|
414 { |
405 connect(BtnCopy, SIGNAL(clicked()), this, SLOT(copyRow())); |
415 connect(BtnCopy, SIGNAL(clicked()), this, SLOT(copyRow())); |
406 connect(BtnNew, SIGNAL(clicked()), this, SLOT(newRow())); |
416 connect(BtnNew, SIGNAL(clicked()), this, SLOT(newRow())); |
407 connect(BtnDelete, SIGNAL(clicked()), this, SLOT(deleteRow())); |
417 connect(BtnDelete, SIGNAL(clicked()), this, SLOT(deleteRow())); |
|
418 mapper = new QDataWidgetMapper(this); |
408 connect(selectScheme, SIGNAL(currentIndexChanged(int)), mapper, SLOT(setCurrentIndex(int))); |
419 connect(selectScheme, SIGNAL(currentIndexChanged(int)), mapper, SLOT(setCurrentIndex(int))); |
409 connect(selectScheme, SIGNAL(currentIndexChanged(int)), this, SLOT(schemeSelected(int))); |
420 connect(selectScheme, SIGNAL(currentIndexChanged(int)), this, SLOT(schemeSelected(int))); |
|
421 } |
|
422 |
|
423 PageScheme::PageScheme(QWidget* parent) : AbstractPage(parent) |
|
424 { |
|
425 initPage(); |
410 } |
426 } |
411 |
427 |
412 void PageScheme::setModel(QAbstractItemModel * model) |
428 void PageScheme::setModel(QAbstractItemModel * model) |
413 { |
429 { |
414 mapper->setModel(model); |
430 mapper->setModel(model); |