Move game starting action outside menu
authorunc0rr
Fri, 10 Apr 2009 18:44:36 +0000
changeset 1951 47f38d84ac72
parent 1950 09ad18a1be11
child 1952 aed76eabb846
Move game starting action outside menu
QTfrontend/hwform.cpp
QTfrontend/pages.cpp
QTfrontend/pages.h
--- a/QTfrontend/hwform.cpp	Fri Apr 10 18:38:01 2009 +0000
+++ b/QTfrontend/hwform.cpp	Fri Apr 10 18:44:36 2009 +0000
@@ -95,7 +95,7 @@
 
 	connect(ui.pagePlayDemo->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
 	connect(ui.pagePlayDemo->BtnPlayDemo, SIGNAL(clicked()), this, SLOT(PlayDemo()));
-	connect(ui.pagePlayDemo->DemosList, SIGNAL(doubleClicked (const QModelIndex &)),	this, SLOT(PlayDemo()));
+	connect(ui.pagePlayDemo->DemosList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(PlayDemo()));
 
 	connect(ui.pageOptions->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
 	connect(ui.pageOptions->BtnNewTeam, SIGNAL(clicked()), this, SLOT(NewTeam()));
@@ -118,6 +118,8 @@
 	connect(ui.pageNetGame->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)),
 		ui.pageNetGame->BtnGo, SLOT(setEnabled(bool)));
+	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)),
+		ui.pageNetGame->BtnStart, SLOT(setEnabled(bool)));
 	connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup()));
 	connect(ui.pageNetGame->pGameCFG, SIGNAL(goToSchemes()), this, SLOT(GoToSchemes()));
 
@@ -844,10 +846,10 @@
 	if (hwnet)
 	{
 		// disconnect connections first to ensure their inexistance and not to connect twice
-		ui.pageNetGame->startGame->disconnect(hwnet);
+		ui.pageNetGame->BtnStart->disconnect(hwnet);
 		ui.pageNetGame->restrictJoins->disconnect(hwnet);
 		ui.pageNetGame->restrictTeamAdds->disconnect(hwnet);
-		connect(ui.pageNetGame->startGame, SIGNAL(triggered()), hwnet, SLOT(startGame()));
+		connect(ui.pageNetGame->BtnStart, SIGNAL(clicked()), hwnet, SLOT(startGame()));
 		connect(ui.pageNetGame->restrictJoins, SIGNAL(triggered()), hwnet, SLOT(toggleRestrictJoins()));
 		connect(ui.pageNetGame->restrictTeamAdds, SIGNAL(triggered()), hwnet, SLOT(toggleRestrictTeamAdds()));
 	}
--- a/QTfrontend/pages.cpp	Fri Apr 10 18:38:01 2009 +0000
+++ b/QTfrontend/pages.cpp	Fri Apr 10 18:44:36 2009 +0000
@@ -590,7 +590,6 @@
 
 PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent)
 {
-	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
 	pageLayout->setSizeConstraint(QLayout::SetMinimumSize);
 	//pageLayout->setSpacing(1);
@@ -616,28 +615,28 @@
 	BtnBack = addButton(":/res/Exit.png", bottomLayout, 0, true);
 	
 	BtnGo = new QPushButton(this);
-	BtnGo->setFont(*font14);
 	BtnGo->setToolTip(QPushButton::tr("Ready"));
 	BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
 	BtnGo->setIconSize(QSize(25, 34));
 	BtnGo->setMinimumWidth(50);
 	BtnGo->setMinimumHeight(50);
-	bottomLayout->addWidget(BtnGo, 2);
+	bottomLayout->addWidget(BtnGo, 4);
 
 
-	BtnMaster = addButton(tr("Control"), bottomLayout, 3);
+	BtnMaster = addButton(tr("Control"), bottomLayout, 2);
 	QMenu * menu = new QMenu(BtnMaster);
-	startGame = new QAction(QAction::tr("Start"), menu);
 	restrictJoins = new QAction(QAction::tr("Restrict Joins"), menu);
 	restrictJoins->setCheckable(true);
 	restrictTeamAdds = new QAction(QAction::tr("Restrict Team Additions"), menu);
 	restrictTeamAdds->setCheckable(true);
-	menu->addAction(startGame);
+	//menu->addAction(startGame);
 	menu->addAction(restrictJoins);
 	menu->addAction(restrictTeamAdds);
 	
 	BtnMaster->setMenu(menu);
 
+	BtnStart = addButton(QAction::tr("Start"), bottomLayout, 3);
+
 	bottomLayout->insertStretch(1, 100);
 }
 
@@ -652,6 +651,7 @@
 void PageNetGame::setMasterMode(bool isMaster)
 {
 	BtnMaster->setVisible(isMaster);
+	BtnStart->setVisible(isMaster);
 }
 
 PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent)
--- a/QTfrontend/pages.h	Fri Apr 10 18:38:01 2009 +0000
+++ b/QTfrontend/pages.h	Fri Apr 10 18:44:36 2009 +0000
@@ -286,8 +286,8 @@
 	QPushButton *BtnBack;
 	QPushButton *BtnGo;
 	QPushButton *BtnMaster;
+	QPushButton *BtnStart;
 	
-	QAction * startGame;
 	QAction * restrictJoins;
 	QAction * restrictTeamAdds;