QTfrontend/pages.cpp
changeset 1951 47f38d84ac72
parent 1950 09ad18a1be11
child 1977 2284d7fefe4f
equal deleted inserted replaced
1950:09ad18a1be11 1951:47f38d84ac72
   588 	sbPort->setValue(46631);
   588 	sbPort->setValue(46631);
   589 }
   589 }
   590 
   590 
   591 PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent)
   591 PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent)
   592 {
   592 {
   593 	QFont * font14 = new QFont("MS Shell Dlg", 14);
       
   594 	QGridLayout * pageLayout = new QGridLayout(this);
   593 	QGridLayout * pageLayout = new QGridLayout(this);
   595 	pageLayout->setSizeConstraint(QLayout::SetMinimumSize);
   594 	pageLayout->setSizeConstraint(QLayout::SetMinimumSize);
   596 	//pageLayout->setSpacing(1);
   595 	//pageLayout->setSpacing(1);
   597 	pageLayout->setColumnStretch(0, 50);
   596 	pageLayout->setColumnStretch(0, 50);
   598 	pageLayout->setColumnStretch(1, 50);
   597 	pageLayout->setColumnStretch(1, 50);
   614 	pageLayout->addLayout(bottomLayout, 3, 0, 1, 2);
   613 	pageLayout->addLayout(bottomLayout, 3, 0, 1, 2);
   615 
   614 
   616 	BtnBack = addButton(":/res/Exit.png", bottomLayout, 0, true);
   615 	BtnBack = addButton(":/res/Exit.png", bottomLayout, 0, true);
   617 	
   616 	
   618 	BtnGo = new QPushButton(this);
   617 	BtnGo = new QPushButton(this);
   619 	BtnGo->setFont(*font14);
       
   620 	BtnGo->setToolTip(QPushButton::tr("Ready"));
   618 	BtnGo->setToolTip(QPushButton::tr("Ready"));
   621 	BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
   619 	BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
   622 	BtnGo->setIconSize(QSize(25, 34));
   620 	BtnGo->setIconSize(QSize(25, 34));
   623 	BtnGo->setMinimumWidth(50);
   621 	BtnGo->setMinimumWidth(50);
   624 	BtnGo->setMinimumHeight(50);
   622 	BtnGo->setMinimumHeight(50);
   625 	bottomLayout->addWidget(BtnGo, 2);
   623 	bottomLayout->addWidget(BtnGo, 4);
   626 
   624 
   627 
   625 
   628 	BtnMaster = addButton(tr("Control"), bottomLayout, 3);
   626 	BtnMaster = addButton(tr("Control"), bottomLayout, 2);
   629 	QMenu * menu = new QMenu(BtnMaster);
   627 	QMenu * menu = new QMenu(BtnMaster);
   630 	startGame = new QAction(QAction::tr("Start"), menu);
       
   631 	restrictJoins = new QAction(QAction::tr("Restrict Joins"), menu);
   628 	restrictJoins = new QAction(QAction::tr("Restrict Joins"), menu);
   632 	restrictJoins->setCheckable(true);
   629 	restrictJoins->setCheckable(true);
   633 	restrictTeamAdds = new QAction(QAction::tr("Restrict Team Additions"), menu);
   630 	restrictTeamAdds = new QAction(QAction::tr("Restrict Team Additions"), menu);
   634 	restrictTeamAdds->setCheckable(true);
   631 	restrictTeamAdds->setCheckable(true);
   635 	menu->addAction(startGame);
   632 	//menu->addAction(startGame);
   636 	menu->addAction(restrictJoins);
   633 	menu->addAction(restrictJoins);
   637 	menu->addAction(restrictTeamAdds);
   634 	menu->addAction(restrictTeamAdds);
   638 	
   635 	
   639 	BtnMaster->setMenu(menu);
   636 	BtnMaster->setMenu(menu);
       
   637 
       
   638 	BtnStart = addButton(QAction::tr("Start"), bottomLayout, 3);
   640 
   639 
   641 	bottomLayout->insertStretch(1, 100);
   640 	bottomLayout->insertStretch(1, 100);
   642 }
   641 }
   643 
   642 
   644 void PageNetGame::setReadyStatus(bool isReady)
   643 void PageNetGame::setReadyStatus(bool isReady)
   650 }
   649 }
   651 
   650 
   652 void PageNetGame::setMasterMode(bool isMaster)
   651 void PageNetGame::setMasterMode(bool isMaster)
   653 {
   652 {
   654 	BtnMaster->setVisible(isMaster);
   653 	BtnMaster->setVisible(isMaster);
       
   654 	BtnStart->setVisible(isMaster);
   655 }
   655 }
   656 
   656 
   657 PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent)
   657 PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent)
   658 {
   658 {
   659 	QGridLayout * pageLayout = new QGridLayout(this);
   659 	QGridLayout * pageLayout = new QGridLayout(this);