QTfrontend/pages.cpp
changeset 4600 5a3b1dbdd4c9
parent 4598 7cb8c9db6e8d
child 4812 f924be23ffb4
child 4822 2873b89358b8
equal deleted inserted replaced
4598:7cb8c9db6e8d 4600:5a3b1dbdd4c9
  1505     gb->setLayout(gl);
  1505     gb->setLayout(gl);
  1506     QSizePolicy sp;
  1506     QSizePolicy sp;
  1507     sp.setVerticalPolicy(QSizePolicy::MinimumExpanding);
  1507     sp.setVerticalPolicy(QSizePolicy::MinimumExpanding);
  1508     sp.setHorizontalPolicy(QSizePolicy::Expanding);
  1508     sp.setHorizontalPolicy(QSizePolicy::Expanding);
  1509 
  1509 
  1510     pageLayout->addWidget(gb, 1,0,13,4);
  1510     pageLayout->addWidget(gb, 1,0,13,5);
  1511 
  1511 
  1512     gbGameModes = new QGroupBox(QGroupBox::tr("Game Modifiers"), gb);
  1512     gbGameModes = new QGroupBox(QGroupBox::tr("Game Modifiers"), gb);
  1513     gbBasicSettings = new QGroupBox(QGroupBox::tr("Basic Settings"), gb);
  1513     gbBasicSettings = new QGroupBox(QGroupBox::tr("Basic Settings"), gb);
  1514 
  1514 
  1515     gbGameModes->setStyleSheet(".QGroupBox {"
  1515     gbGameModes->setStyleSheet(".QGroupBox {"
  1832     gl->addWidget(l,14,0,1,1);
  1832     gl->addWidget(l,14,0,1,1);
  1833 
  1833 
  1834     mapper = new QDataWidgetMapper(this);
  1834     mapper = new QDataWidgetMapper(this);
  1835 
  1835 
  1836     BtnBack = addButton(":/res/Exit.png", pageLayout, 15, 0, true);
  1836     BtnBack = addButton(":/res/Exit.png", pageLayout, 15, 0, true);
  1837     BtnNew = addButton(tr("New"), pageLayout, 15, 2);
  1837     BtnCopy = addButton(tr("Copy"), pageLayout, 15, 2);
  1838     BtnDelete = addButton(tr("Delete"), pageLayout, 15, 3);
  1838     BtnNew = addButton(tr("New"), pageLayout, 15, 3);
       
  1839     BtnDelete = addButton(tr("Delete"), pageLayout, 15, 4);
  1839 
  1840 
  1840     selectScheme = new QComboBox(this);
  1841     selectScheme = new QComboBox(this);
  1841     pageLayout->addWidget(selectScheme, 15, 1);
  1842     pageLayout->addWidget(selectScheme, 15, 1);
  1842 
  1843 
       
  1844     connect(BtnCopy, SIGNAL(clicked()), this, SLOT(copyRow()));
  1843     connect(BtnNew, SIGNAL(clicked()), this, SLOT(newRow()));
  1845     connect(BtnNew, SIGNAL(clicked()), this, SLOT(newRow()));
  1844     connect(BtnDelete, SIGNAL(clicked()), this, SLOT(deleteRow()));
  1846     connect(BtnDelete, SIGNAL(clicked()), this, SLOT(deleteRow()));
  1845     connect(selectScheme, SIGNAL(currentIndexChanged(int)), mapper, SLOT(setCurrentIndex(int)));
  1847     connect(selectScheme, SIGNAL(currentIndexChanged(int)), mapper, SLOT(setCurrentIndex(int)));
  1846     connect(selectScheme, SIGNAL(currentIndexChanged(int)), this, SLOT(schemeSelected(int)));
  1848     connect(selectScheme, SIGNAL(currentIndexChanged(int)), this, SLOT(schemeSelected(int)));
  1847 }
  1849 }
  1894 }
  1896 }
  1895 
  1897 
  1896 void PageScheme::newRow()
  1898 void PageScheme::newRow()
  1897 {
  1899 {
  1898     QAbstractItemModel * model = mapper->model();
  1900     QAbstractItemModel * model = mapper->model();
  1899     model->insertRow(model->rowCount());
  1901     model->insertRow(-1);
       
  1902     selectScheme->setCurrentIndex(model->rowCount() - 1);
       
  1903 }
       
  1904 
       
  1905 void PageScheme::copyRow()
       
  1906 {
       
  1907     QAbstractItemModel * model = mapper->model();
       
  1908     model->insertRow(selectScheme->currentIndex());
  1900     selectScheme->setCurrentIndex(model->rowCount() - 1);
  1909     selectScheme->setCurrentIndex(model->rowCount() - 1);
  1901 }
  1910 }
  1902 
  1911 
  1903 void PageScheme::deleteRow()
  1912 void PageScheme::deleteRow()
  1904 {
  1913 {