Implement two buttons
authorunc0rr
Fri, 10 Apr 2009 18:38:01 +0000
changeset 1950 09ad18a1be11
parent 1949 9f3ea865f00c
child 1951 47f38d84ac72
Implement two buttons
QTfrontend/hwform.cpp
QTfrontend/hwform.h
QTfrontend/pages.cpp
QTfrontend/pages.h
QTfrontend/ui_hwform.cpp
QTfrontend/ui_hwform.h
--- a/QTfrontend/hwform.cpp	Tue Apr 07 16:52:01 2009 +0000
+++ b/QTfrontend/hwform.cpp	Fri Apr 10 18:38:01 2009 +0000
@@ -75,7 +75,7 @@
 
 	connect(ui.pageMain->BtnSinglePlayer, SIGNAL(clicked()), this, SLOT(GoToSinglePlayer()));
 	connect(ui.pageMain->BtnSetup, SIGNAL(clicked()), this, SLOT(GoToSetup()));
-	connect(ui.pageMain->BtnNet, SIGNAL(clicked()), this, SLOT(GoToNet()));
+	connect(ui.pageMain->BtnNet, SIGNAL(clicked()), this, SLOT(GoToNetType()));
 	connect(ui.pageMain->BtnInfo, SIGNAL(clicked()), this, SLOT(GoToInfo()));
 	connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed()));
 	connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked()));
@@ -93,15 +93,15 @@
 	connect(ui.pageMultiplayer->teamsSelect, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup()));
 	connect(ui.pageMultiplayer->gameCFG, SIGNAL(goToSchemes()), this, SLOT(GoToSchemes()));
 
-	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->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.pageOptions->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
-	connect(ui.pageOptions->BtnNewTeam,	SIGNAL(clicked()),	this, SLOT(NewTeam()));
-	connect(ui.pageOptions->BtnEditTeam,	SIGNAL(clicked()),	this, SLOT(EditTeam()));
-	connect(ui.pageOptions->BtnSaveOptions,	SIGNAL(clicked()),	config, SLOT(SaveOptions()));
-	connect(ui.pageOptions->BtnSaveOptions,	SIGNAL(clicked()),	this, SLOT(GoBack()));
+	connect(ui.pageOptions->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
+	connect(ui.pageOptions->BtnNewTeam, SIGNAL(clicked()), this, SLOT(NewTeam()));
+	connect(ui.pageOptions->BtnEditTeam, SIGNAL(clicked()), this, SLOT(EditTeam()));
+	connect(ui.pageOptions->BtnSaveOptions, SIGNAL(clicked()), config, SLOT(SaveOptions()));
+	connect(ui.pageOptions->BtnSaveOptions, SIGNAL(clicked()), this, SLOT(GoBack()));
 
 	connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon()));
 	connect(ui.pageOptions->WeaponsButt, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon()));
@@ -109,14 +109,13 @@
 
 	connect(ui.pageNet->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
 	connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect()));
-	connect(ui.pageNet->BtnOfficialServer, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer()));
 	connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), this, SLOT(GoToNetServer()));
 	connect(ui.pageNet, SIGNAL(connectClicked(const QString &, quint16)), this, SLOT(NetConnectServer(const QString &, quint16)));
 	
-	connect(ui.pageNetServer->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
-	connect(ui.pageNetServer->BtnStart,	SIGNAL(clicked()),	this, SLOT(NetStartServer()));
+	connect(ui.pageNetServer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
+	connect(ui.pageNetServer->BtnStart, SIGNAL(clicked()), this, SLOT(NetStartServer()));
 
-	connect(ui.pageNetGame->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
+	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(SetupClicked()), this, SLOT(IntermediateSetup()));
@@ -154,6 +153,10 @@
 
 	connect(ui.pageAdmin->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
 
+	connect(ui.pageNetType->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
+	connect(ui.pageNetType->BtnLAN, SIGNAL(clicked()), this, SLOT(GoToNet()));
+	connect(ui.pageNetType->BtnOfficialServer, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer()));
+
 
 	ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/schemes.ini");
 	ui.pageScheme->setModel(ammoSchemeModel);
@@ -289,6 +292,11 @@
 	GoToPage(ID_PAGE_NET);
 }
 
+void HWForm::GoToNetType()
+{
+	GoToPage(ID_PAGE_NETTYPE);
+}
+
 void HWForm::GoToNetServer()
 {
 	GoToPage(ID_PAGE_NETSERVER);
--- a/QTfrontend/hwform.h	Tue Apr 07 16:52:01 2009 +0000
+++ b/QTfrontend/hwform.h	Fri Apr 10 18:38:01 2009 +0000
@@ -53,6 +53,7 @@
 	void GoToSaves();
 	void GoToDemos();
 	void GoToNet();
+	void GoToNetType();
 	void GoToInfo();
 	void GoToTraining();
 	void GoToSelectWeapon();
@@ -122,7 +123,8 @@
 		ID_PAGE_ROOMSLIST       = 14,
 		ID_PAGE_CONNECTING      = 15,
 		ID_PAGE_SCHEME          = 16,
-		ID_PAGE_ADMIN           = 17
+		ID_PAGE_ADMIN           = 17,
+		ID_PAGE_NETTYPE         = 18
 		};
 	HWGame * game;
 	HWNetServer* pnetserver;
--- a/QTfrontend/pages.cpp	Tue Apr 07 16:52:01 2009 +0000
+++ b/QTfrontend/pages.cpp	Fri Apr 10 18:38:01 2009 +0000
@@ -496,11 +496,6 @@
 	BtnSpecifyServer->setText(QPushButton::tr("Specify"));
 	GBClayout->addWidget(BtnSpecifyServer, 2, 1);
 
-	BtnOfficialServer = new QPushButton(ConnGroupBox);
-	BtnOfficialServer->setFont(*font14);
-	BtnOfficialServer->setText(QPushButton::tr("Join official server"));
-	GBClayout->addWidget(BtnOfficialServer, 3, 0, 1, 3);
-
 	connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect()));
 }
 
@@ -709,7 +704,6 @@
 
 PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent)
 {
-	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
 	pageLayout->setColumnStretch(0, 1);
 	pageLayout->setColumnStretch(1, 2);
@@ -1087,3 +1081,17 @@
 {
 	leServerMessage->setText(str);
 }
+
+/////////////////////////////////////////////////
+
+PageNetType::PageNetType(QWidget* parent) : AbstractPage(parent)
+{
+	QGridLayout * pageLayout = new QGridLayout(this);
+	pageLayout->setRowStretch(0, 10);
+	pageLayout->setRowStretch(2, 10);
+
+	BtnLAN = addButton(tr("LAN game"), pageLayout, 1, 0);
+	BtnOfficialServer = addButton(tr("Official server"), pageLayout, 1, 1);
+
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 3, 0, true);
+}
--- a/QTfrontend/pages.h	Tue Apr 07 16:52:01 2009 +0000
+++ b/QTfrontend/pages.h	Fri Apr 10 18:38:01 2009 +0000
@@ -242,7 +242,6 @@
 	QPushButton * BtnNetConnect;
 	QPushButton * BtnNetSvrStart;
 	QPushButton * BtnSpecifyServer;
-	QPushButton * BtnOfficialServer;
 
 private:
 	QGroupBox * ConnGroupBox;
@@ -462,4 +461,17 @@
 	void setServerMessage(const QString & str);
 };
 
+
+class PageNetType : public AbstractPage
+{
+	Q_OBJECT
+
+public:
+	PageNetType(QWidget* parent = 0);
+
+	QPushButton * BtnBack;
+	QPushButton * BtnLAN;
+	QPushButton * BtnOfficialServer;
+};
+
 #endif // PAGES_H
--- a/QTfrontend/ui_hwform.cpp	Tue Apr 07 16:52:01 2009 +0000
+++ b/QTfrontend/ui_hwform.cpp	Fri Apr 10 18:38:01 2009 +0000
@@ -109,4 +109,7 @@
 
 	pageAdmin = new PageAdmin();
 	Pages->addWidget(pageAdmin);
+
+	pageNetType = new PageNetType();
+	Pages->addWidget(pageNetType);
 }
--- a/QTfrontend/ui_hwform.h	Tue Apr 07 16:52:01 2009 +0000
+++ b/QTfrontend/ui_hwform.h	Fri Apr 10 18:38:01 2009 +0000
@@ -38,6 +38,7 @@
 class PageConnecting;
 class PageScheme;
 class PageAdmin;
+class PageNetType;
 class QStackedLayout;
 class QFont;
 class QWidget;
@@ -67,6 +68,7 @@
 	PageConnecting *pageConnecting;
 	PageScheme *pageScheme;
 	PageAdmin *pageAdmin;
+	PageNetType *pageNetType;
 
 	QStackedLayout *Pages;
 	QFont *font14;