QTfrontend/pages.cpp
changeset 1153 825931b81ad4
parent 1152 c72b939c00df
child 1157 c2e02c52dcad
--- a/QTfrontend/pages.cpp	Tue Aug 05 20:57:08 2008 +0000
+++ b/QTfrontend/pages.cpp	Tue Aug 05 21:12:26 2008 +0000
@@ -117,7 +117,7 @@
 	}
 	pageLayout->addWidget(GBoxHedgehogs, 1, 0, 2, 1);
 
-	BtnTeamDiscard = addButton(tr("Discard"), pageLayout, 4, 0);
+	BtnTeamDiscard = addButton(":/res/Exit.png", pageLayout, 4, 0, true);
 
 	GBoxBinds = new QGroupBox(this);
 	GBoxBinds->setTitle(QGroupBox::tr("Key binds"));
@@ -245,7 +245,7 @@
 {
 	QGridLayout * pageLayout = new QGridLayout(this);
 
-	BtnBack = addButton(tr("Back"), pageLayout, 1, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 
 	gameCFG = new GameCFGWidget(this);
 	pageLayout->addWidget(gameCFG, 0, 0, 1, 2);
@@ -331,7 +331,7 @@
 
 	BtnSaveOptions = addButton(tr("Save"), pageLayout, 4, 2);
 
-	BtnBack = addButton(tr("Back"), pageLayout, 4, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true);
 
 	QGroupBox* groupWeapons = new QGroupBox(this);
 	groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -360,7 +360,7 @@
 	GBNlayout->addWidget(editNetNick, 0, 1);
 }
 
-PageNet::PageNet(QWidget* parent) : QWidget(parent)
+PageNet::PageNet(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -414,10 +414,7 @@
 	BtnSpecifyServer->setText(QPushButton::tr("Specify"));
 	GBClayout->addWidget(BtnSpecifyServer, 2, 1);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 3, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 3, 0, true);
 
 	connect(rbLocalGame, SIGNAL(toggled(bool)), this, SLOT(updateServersList()));
 	connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect()));
@@ -453,7 +450,7 @@
 	emit connectClicked(host, port);
 }
 
-PageNetServer::PageNetServer(QWidget* parent) : QWidget(parent)
+PageNetServer::PageNetServer(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -464,10 +461,7 @@
 	pageLayout->setRowStretch(0, 1);
 	pageLayout->setRowStretch(1, 0);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 1, 0);
+	BtnBack =addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 
 	BtnStart = new QPushButton(this);
 	BtnStart->setFont(*font14);
@@ -518,7 +512,7 @@
 	sbPort->setValue(46631);
 }
 
-PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent)
+PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -540,10 +534,7 @@
 	pNetTeamsWidget->setAcceptOuter(true);
 	pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 2, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true);
 
 	BtnGo = new QPushButton(this);
 	BtnGo->setFont(*font14);
@@ -552,7 +543,7 @@
 	pageLayout->addWidget(BtnGo, 2, 1);
 }
 
-PageInfo::PageInfo(QWidget* parent) : QWidget(parent)
+PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -560,16 +551,13 @@
 	pageLayout->setColumnStretch(1, 1);
 	pageLayout->setColumnStretch(2, 1);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 1, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 
 	about = new About(this);
 	pageLayout->addWidget(about, 0, 0, 1, 3);
 }
 
-PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent)
+PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -577,10 +565,7 @@
 	pageLayout->setColumnStretch(1, 1);
 	pageLayout->setColumnStretch(2, 1);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 1, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 
 	labelGameStats = new QLabel(this);
 	labelGameStats->setTextFormat(Qt::RichText);
@@ -604,10 +589,10 @@
 	BtnLoad = addButton(tr("Saved games"), pageLayout, 4, 1);
 	BtnDemos = addButton(tr("Demos"), pageLayout, 5, 1);
 
-	BtnBack = addButton(tr("Back"), pageLayout, 7, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 7, 0, true);
 }
 
-PageTraining::PageTraining(QWidget* parent) : QWidget(parent)
+PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
 	QGridLayout * pageLayout = new QGridLayout(this);
@@ -621,10 +606,7 @@
 	BtnStartTrain->setText(QPushButton::tr("Go!"));
 	pageLayout->addWidget(BtnStartTrain, 1, 2);
 
-	BtnBack = new QPushButton(this);
-	BtnBack->setFont(*font14);
-	BtnBack->setText(QPushButton::tr("Back"));
-	pageLayout->addWidget(BtnBack, 1, 0);
+	BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
 }
 
 PageSelectWeapon::PageSelectWeapon(QWidget* parent) :