QTfrontend/pages.cpp
changeset 1644 1e51e80c383c
parent 1621 d1ded2532d3f
child 1647 ab0c8c4be7b3
equal deleted inserted replaced
1643:434e28245dc0 1644:1e51e80c383c
   271 	QGridLayout * pageLayout = new QGridLayout(this);
   271 	QGridLayout * pageLayout = new QGridLayout(this);
   272 	pageLayout->setColumnStretch(0, 100);
   272 	pageLayout->setColumnStretch(0, 100);
   273 	pageLayout->setColumnStretch(1, 100);
   273 	pageLayout->setColumnStretch(1, 100);
   274 	pageLayout->setColumnStretch(2, 100);
   274 	pageLayout->setColumnStretch(2, 100);
   275 	pageLayout->setRowStretch(0, 0);
   275 	pageLayout->setRowStretch(0, 0);
   276 	pageLayout->setRowStretch(1, 0);
   276 	pageLayout->setRowStretch(1, 100);
   277 	pageLayout->setRowStretch(2, 0);
   277 	pageLayout->setRowStretch(2, 0);
   278 	pageLayout->setRowStretch(3, 100);
   278 	pageLayout->setContentsMargins(7, 7, 7, 0);
   279 	pageLayout->setRowStretch(4, 0);
   279 	pageLayout->setSpacing(0);
   280 
   280 
   281 
   281 
   282 	QGroupBox * gbTwoBoxes = new QGroupBox(this);
   282 	QGroupBox * gbTwoBoxes = new QGroupBox(this);
   283 	pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3);
   283 	pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3);
   284 	QHBoxLayout * gbTBLayout = new QHBoxLayout(gbTwoBoxes);
   284 	QGridLayout * gbTBLayout = new QGridLayout(gbTwoBoxes);
       
   285 	gbTBLayout->setMargin(0);
       
   286 	gbTBLayout->setSpacing(0);
   285 	{
   287 	{
   286 		teamsBox = new IconedGroupBox(this);
   288 		teamsBox = new IconedGroupBox(this);
   287 		teamsBox->setIcon(QIcon(":/res/teamicon.png"));
   289 		teamsBox->setIcon(QIcon(":/res/teamicon.png"));
   288 		teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   290 		teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   289 		teamsBox->setTitle(QGroupBox::tr("Teams"));
   291 		teamsBox->setTitle(QGroupBox::tr("Teams"));
   290 
   292 
   291 		QGridLayout * GBTlayout = new QGridLayout(teamsBox);
   293 		QVBoxLayout * GBTlayout = new QVBoxLayout(teamsBox);
   292 
       
   293 		BtnNewTeam = addButton(tr("New team"), GBTlayout, 1, 0);
       
   294 
   294 
   295 		CBTeamName = new QComboBox(teamsBox);
   295 		CBTeamName = new QComboBox(teamsBox);
   296 		GBTlayout->addWidget(CBTeamName, 0, 0, 1, 2);
   296 		GBTlayout->addWidget(CBTeamName);
   297 
   297 
   298 		BtnEditTeam = addButton(tr("Edit team"), GBTlayout, 1, 1);
   298 		QHBoxLayout * layout1 = new QHBoxLayout;
       
   299 		GBTlayout->addLayout(layout1);
       
   300 		BtnNewTeam = addButton(tr("New team"), layout1, 0);
       
   301 		BtnEditTeam = addButton(tr("Edit team"), layout1, 1);
       
   302 		layout1->setStretchFactor(BtnNewTeam, 100);
       
   303 		layout1->setStretchFactor(BtnEditTeam, 100);
       
   304 		
       
   305 		QHBoxLayout * layout2 = new QHBoxLayout;
       
   306 		GBTlayout->addLayout(layout2);
   299 		
   307 		
   300 		labelNN = new QLabel(teamsBox);
   308 		labelNN = new QLabel(teamsBox);
   301 		labelNN->setText(QLabel::tr("Net nick"));
   309 		labelNN->setText(QLabel::tr("Net nick"));
   302 		GBTlayout->addWidget(labelNN, 2, 0, 1, 2);
   310 		layout2->addWidget(labelNN);
   303 
   311 
   304 		editNetNick = new QLineEdit(teamsBox);
   312 		editNetNick = new QLineEdit(teamsBox);
   305 		editNetNick->setMaxLength(20);
   313 		editNetNick->setMaxLength(20);
   306 		editNetNick->setText(QLineEdit::tr("unnamed"));
   314 		editNetNick->setText(QLineEdit::tr("unnamed"));
   307 		GBTlayout->addWidget(editNetNick, 3, 0, 1, 2);
   315 		layout2->addWidget(editNetNick);
   308 		
   316 		
   309 		gbTBLayout->addWidget(teamsBox);
   317 		gbTBLayout->addWidget(teamsBox, 0, 0);
   310 	}
   318 	}
   311 
   319 
   312 	{
   320 	{
   313 		IconedGroupBox* groupWeapons = new IconedGroupBox(this);
   321 		IconedGroupBox* groupWeapons = new IconedGroupBox(this);
   314 		groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
   322 		groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
   319 
   327 
   320 		WeaponsButt = addButton(tr("Weapons set"), WeaponsLayout, 1, 0);
   328 		WeaponsButt = addButton(tr("Weapons set"), WeaponsLayout, 1, 0);
   321 		WeaponsName = new QComboBox(this);
   329 		WeaponsName = new QComboBox(this);
   322 		WeaponsLayout->addWidget(WeaponsName, 0, 0, 1, 2);
   330 		WeaponsLayout->addWidget(WeaponsName, 0, 0, 1, 2);
   323 		WeaponEdit = addButton(tr("Edit"), WeaponsLayout, 1, 1);
   331 		WeaponEdit = addButton(tr("Edit"), WeaponsLayout, 1, 1);
   324 		gbTBLayout->addWidget(groupWeapons);
   332 		gbTBLayout->addWidget(groupWeapons, 1, 0);
   325 	}
   333 	}
   326 
   334 
   327 	AGGroupBox = new IconedGroupBox(this);
   335 	{
   328 	AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png"));
   336 		AGGroupBox = new IconedGroupBox(this);
   329 	AGGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   337 		AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png"));
   330 	AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options"));
   338 		AGGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   331 	pageLayout->addWidget(AGGroupBox, 2, 1);
   339 		AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options"));
   332 
   340 
   333 	QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox);
   341 		QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox);
   334 	QHBoxLayout * GBAreslayout = new QHBoxLayout(0);
   342 		QHBoxLayout * GBAreslayout = new QHBoxLayout(0);
   335 	QLabel * resolution = new QLabel(AGGroupBox);
   343 		QLabel * resolution = new QLabel(AGGroupBox);
   336 	resolution->setText(QLabel::tr("Resolution"));
   344 		resolution->setText(QLabel::tr("Resolution"));
   337 	GBAreslayout->addWidget(resolution);
   345 		GBAreslayout->addWidget(resolution);
   338 
   346 
   339 	CBResolution = new QComboBox(AGGroupBox);
   347 		CBResolution = new QComboBox(AGGroupBox);
   340 	GBAreslayout->addWidget(CBResolution);
   348 		GBAreslayout->addWidget(CBResolution);
   341 	GBAlayout->addLayout(GBAreslayout);
   349 		GBAlayout->addLayout(GBAreslayout);
   342 
   350 
   343 	QHBoxLayout * GBAfpslayout = new QHBoxLayout(0);
   351 		QHBoxLayout * GBAfpslayout = new QHBoxLayout(0);
   344 	QLabel * maxfps = new QLabel(AGGroupBox);
   352 		QLabel * maxfps = new QLabel(AGGroupBox);
   345 	maxfps->setText(QLabel::tr("FPS limit"));
   353 		maxfps->setText(QLabel::tr("FPS limit"));
   346 	GBAfpslayout->addWidget(maxfps);
   354 		GBAfpslayout->addWidget(maxfps);
   347 	GBAlayout->addLayout(GBAfpslayout);
   355 		GBAlayout->addLayout(GBAfpslayout);
   348 
   356 
   349 	CBFullscreen = new QCheckBox(AGGroupBox);
   357 		CBFullscreen = new QCheckBox(AGGroupBox);
   350 	CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
   358 		CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
   351 	GBAlayout->addWidget(CBFullscreen);
   359 		GBAlayout->addWidget(CBFullscreen);
   352 
   360 
   353 	CBFrontendFullscreen = new QCheckBox(AGGroupBox);
   361 		CBFrontendFullscreen = new QCheckBox(AGGroupBox);
   354 	CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen"));
   362 		CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen"));
   355 	GBAlayout->addWidget(CBFrontendFullscreen);
   363 		GBAlayout->addWidget(CBFrontendFullscreen);
   356 
   364 
   357 	CBEnableSound = new QCheckBox(AGGroupBox);
   365 		CBEnableSound = new QCheckBox(AGGroupBox);
   358 	CBEnableSound->setText(QCheckBox::tr("Enable sound"));
   366 		CBEnableSound->setText(QCheckBox::tr("Enable sound"));
   359 	GBAlayout->addWidget(CBEnableSound);
   367 		GBAlayout->addWidget(CBEnableSound);
   360 
   368 
   361 	CBEnableMusic = new QCheckBox(AGGroupBox);
   369 		CBEnableMusic = new QCheckBox(AGGroupBox);
   362 	CBEnableMusic->setText(QCheckBox::tr("Enable music"));
   370 		CBEnableMusic->setText(QCheckBox::tr("Enable music"));
   363 	GBAlayout->addWidget(CBEnableMusic);
   371 		GBAlayout->addWidget(CBEnableMusic);
   364 
   372 
   365 	CBShowFPS = new QCheckBox(AGGroupBox);
   373 		CBShowFPS = new QCheckBox(AGGroupBox);
   366 	CBShowFPS->setText(QCheckBox::tr("Show FPS"));
   374 		CBShowFPS->setText(QCheckBox::tr("Show FPS"));
   367 	GBAlayout->addWidget(CBShowFPS);
   375 		GBAlayout->addWidget(CBShowFPS);
   368 
   376 
   369 	CBAltDamage = new QCheckBox(AGGroupBox);
   377 		CBAltDamage = new QCheckBox(AGGroupBox);
   370 	CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
   378 		CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
   371 	GBAlayout->addWidget(CBAltDamage);
   379 		GBAlayout->addWidget(CBAltDamage);
   372 
   380 
   373 	CBNameWithDate = new QCheckBox(AGGroupBox);
   381 		CBNameWithDate = new QCheckBox(AGGroupBox);
   374 	CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name"));
   382 		CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name"));
   375 	GBAlayout->addWidget(CBNameWithDate);
   383 		GBAlayout->addWidget(CBNameWithDate);
   376 
   384 
   377 	fpsedit = new FPSEdit(AGGroupBox);
   385 		fpsedit = new FPSEdit(AGGroupBox);
   378 	GBAfpslayout->addWidget(fpsedit);
   386 		GBAfpslayout->addWidget(fpsedit);
   379 
   387 		gbTBLayout->addWidget(AGGroupBox, 0, 1, 2, 1);
   380 	BtnSaveOptions = addButton(":/res/Save.png", pageLayout, 4, 2, true);
   388 	}
       
   389 
       
   390 	BtnSaveOptions = addButton(":/res/Save.png", pageLayout, 2, 2, true);
   381 	BtnSaveOptions->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}");
   391 	BtnSaveOptions->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}");
   382 
   392 
   383 	BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true);
   393 	BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true);
   384 }
   394 }
   385 
   395 
   386 PageNet::PageNet(QWidget* parent) : AbstractPage(parent)
   396 PageNet::PageNet(QWidget* parent) : AbstractPage(parent)
   387 {
   397 {
   388 	QFont * font14 = new QFont("MS Shell Dlg", 14);
   398 	QFont * font14 = new QFont("MS Shell Dlg", 14);