- Header cleanup in game.cpp
- Page 'in game' to hide frontend interface during the game
--- a/QTfrontend/game.cpp Wed Dec 26 21:08:25 2007 +0000
+++ b/QTfrontend/game.cpp Wed Dec 26 22:16:22 2007 +0000
@@ -16,14 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <QMessageBox>
-#include <QProcess>
-#include <QTimer>
#include <QString>
#include <QByteArray>
-#include <QFile>
-#include <QTextStream>
-#include <QApplication>
#include "game.h"
#include "hwconsts.h"
@@ -46,6 +40,7 @@
HWGame::~HWGame()
{
+ SetGameState(gsDestroyed);
}
void HWGame::onClientDisconnect()
--- a/QTfrontend/game.h Wed Dec 26 21:08:25 2007 +0000
+++ b/QTfrontend/game.h Wed Dec 26 22:16:22 2007 +0000
@@ -33,7 +33,8 @@
gsStarted = 1,
gsInterrupted = 2,
gsFinished = 3,
- gsStopped = 4
+ gsStopped = 4,
+ gsDestroyed = 5
};
--- a/QTfrontend/hwform.cpp Wed Dec 26 21:08:25 2007 +0000
+++ b/QTfrontend/hwform.cpp Wed Dec 26 22:16:22 2007 +0000
@@ -509,10 +509,15 @@
break;
}
case gsFinished: {
+ GoBack();
GoToPage(ID_PAGE_GAMESTATS);
break;
}
- default: ;
+ default: {
+ quint8 id = ui.Pages->currentIndex();
+qDebug() << id;
+ if (id == ID_PAGE_INGAME) GoBack();
+ };
}
if (hwnet)
@@ -557,6 +562,8 @@
connect(game, SIGNAL(GameStats(char, const QString &)), this, SLOT(GameStats(char, const QString &)));
connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection);
connect(game, SIGNAL(HaveRecord(bool, const QByteArray &)), this, SLOT(GetRecord(bool, const QByteArray &)));
+
+ GoToPage(ID_PAGE_INGAME);
}
void HWForm::ShowErrorMessage(const QString & msg)
--- a/QTfrontend/hwform.h Wed Dec 26 21:08:25 2007 +0000
+++ b/QTfrontend/hwform.h Wed Dec 26 22:16:22 2007 +0000
@@ -101,7 +101,8 @@
ID_PAGE_SINGLEPLAYER = 10,
ID_PAGE_TRAINING = 11,
ID_PAGE_SELECTWEAPON = 12,
- ID_PAGE_NETSERVER = 13
+ ID_PAGE_NETSERVER = 13,
+ ID_PAGE_INGAME = 14
};
HWGame * game;
HWTeam * editedTeam;
--- a/QTfrontend/pages.cpp Wed Dec 26 21:08:25 2007 +0000
+++ b/QTfrontend/pages.cpp Wed Dec 26 22:16:22 2007 +0000
@@ -687,3 +687,9 @@
BtnSave = addButton("Save", pageLayout, 1, 2);
}
+PageInGame::PageInGame(QWidget* parent) :
+ AbstractPage(parent)
+{
+ QLabel * label = new QLabel(this);
+ label->setText("In game...");
+}
--- a/QTfrontend/pages.h Wed Dec 26 21:08:25 2007 +0000
+++ b/QTfrontend/pages.h Wed Dec 26 22:16:22 2007 +0000
@@ -308,4 +308,12 @@
SelWeaponWidget* pWeapons;
};
+class PageInGame : public AbstractPage
+{
+ Q_OBJECT
+
+public:
+ PageInGame(QWidget* parent = 0);
+};
+
#endif // PAGES_H
--- a/QTfrontend/ui_hwform.cpp Wed Dec 26 21:08:25 2007 +0000
+++ b/QTfrontend/ui_hwform.cpp Wed Dec 26 22:16:22 2007 +0000
@@ -95,4 +95,7 @@
pageNetServer = new PageNetServer();
Pages->addWidget(pageNetServer);
+
+ pageInGame = new PageInGame();
+ Pages->addWidget(pageInGame);
}
--- a/QTfrontend/ui_hwform.h Wed Dec 26 21:08:25 2007 +0000
+++ b/QTfrontend/ui_hwform.h Wed Dec 26 22:16:22 2007 +0000
@@ -34,6 +34,7 @@
class PageSinglePlayer;
class PageTraining;
class PageSelectWeapon;
+class PageInGame;
class QStackedLayout;
class QFont;
class QWidget;
@@ -59,6 +60,7 @@
PageSinglePlayer *pageSinglePlayer;
PageTraining *pageTraining;
PageSelectWeapon *pageSelectWeapon;
+ PageInGame *pageInGame;
QStackedLayout *Pages;
QFont *font14;