summaryrefslogtreecommitdiffstats
path: root/konquest/gameboard.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /konquest/gameboard.cc
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz
tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konquest/gameboard.cc')
-rw-r--r--konquest/gameboard.cc102
1 files changed, 51 insertions, 51 deletions
diff --git a/konquest/gameboard.cc b/konquest/gameboard.cc
index 75e440d7..47f77faa 100644
--- a/konquest/gameboard.cc
+++ b/konquest/gameboard.cc
@@ -1,14 +1,14 @@
-#include <qlayout.h>
-#include <qcolor.h>
-#include <qlabel.h>
-#include <qslider.h>
-#include <qevent.h>
-#include <qkeycode.h>
-#include <qlistbox.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
-#include <qvalidator.h>
-#include <qtextedit.h>
+#include <tqlayout.h>
+#include <tqcolor.h>
+#include <tqlabel.h>
+#include <tqslider.h>
+#include <tqevent.h>
+#include <tqkeycode.h>
+#include <tqlistbox.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqvalidator.h>
+#include <tqtextedit.h>
#include <kapplication.h>
#include <klocale.h>
@@ -33,11 +33,11 @@
/*********************************************************************
Game Board
*********************************************************************/
-GameBoard::GameBoard( QWidget *parent )
- : QWidget( parent ), gameInProgress( false ), gameState( NONE )
+GameBoard::GameBoard( TQWidget *parent )
+ : TQWidget( parent ), gameInProgress( false ), gameState( NONE )
{
- QColorGroup cg( white, black, green.light(), green.dark(), green, green.dark(75), green.dark() );
- QPalette palette( cg, cg, cg );
+ TQColorGroup cg( white, black, green.light(), green.dark(), green, green.dark(75), green.dark() );
+ TQPalette palette( cg, cg, cg );
neutralPlayer = Player::createNeutralPlayer();
map = new Map;
@@ -49,34 +49,34 @@ GameBoard::GameBoard( QWidget *parent )
// Create the widgets in the main window
//********************************************************************
mapWidget = new ConquestMap( map, this );
- msgWidget = new QTextEdit( this );
+ msgWidget = new TQTextEdit( this );
msgWidget->setTextFormat(LogText);
msgWidget->setMinimumHeight(100);
- msgWidget->setHScrollBarMode(QScrollView::AlwaysOff);
- msgWidget->setPaper(QBrush(Qt::black));
+ msgWidget->setHScrollBarMode(TQScrollView::AlwaysOff);
+ msgWidget->setPaper(TQBrush(Qt::black));
planetInfo = new PlanetInfo( this, palette );
- gameMessage = new QLabel( this );
+ gameMessage = new TQLabel( this );
gameMessage->setPalette( palette );
- turnCounter = new QLabel( this );
+ turnCounter = new TQLabel( this );
turnCounter->setPalette( palette );
turnCounter->setText( "Turn" );
turnCounter->setMaximumHeight( turnCounter->sizeHint().height() );
- endTurn = new QPushButton( i18n("End Turn"), this );
+ endTurn = new TQPushButton( i18n("End Turn"), this );
endTurn->setFixedSize( endTurn->sizeHint() );
endTurn->setPalette( palette );
- shipCountEdit = new QLineEdit( this );
+ shipCountEdit = new TQLineEdit( this );
IntValidator *v = new IntValidator( 1, 32767, this );
shipCountEdit->setValidator( v );
shipCountEdit->setMinimumSize( 40, 0 );
shipCountEdit->setMaximumSize( 32767, 40 );
shipCountEdit->setEnabled(false);
shipCountEdit->setPalette( palette );
- shipCountEdit->setEchoMode( QLineEdit::Password );
+ shipCountEdit->setEchoMode( TQLineEdit::Password );
- splashScreen = new QLabel( this );
- splashScreen->setPixmap(QPixmap(IMAGE_SPLASH));
+ splashScreen = new TQLabel( this );
+ splashScreen->setPixmap(TQPixmap(IMAGE_SPLASH));
splashScreen->setGeometry( 0, 0, 600, 550 );
setMinimumSize( 600, 600 );
@@ -88,10 +88,10 @@ GameBoard::GameBoard( QWidget *parent )
//********************************************************************
// Layout the main window
//********************************************************************
- QHBoxLayout *layout1 = new QHBoxLayout( this );
- QVBoxLayout *layout2 = new QVBoxLayout;
- QHBoxLayout *layout3 = new QHBoxLayout;
- QVBoxLayout *layout4 = new QVBoxLayout;
+ TQHBoxLayout *layout1 = new TQHBoxLayout( this );
+ TQVBoxLayout *layout2 = new QVBoxLayout;
+ TQHBoxLayout *layout3 = new QHBoxLayout;
+ TQVBoxLayout *layout4 = new QVBoxLayout;
layout1->addLayout( layout2 );
layout2->addLayout( layout3 );
@@ -119,10 +119,10 @@ GameBoard::GameBoard( QWidget *parent )
//**********************************************************************
// Set up signal/slot connections
//**********************************************************************
- connect( mapWidget, SIGNAL( planetSelected(Planet *) ), this, SLOT(planetSelected(Planet *)) );
- connect( shipCountEdit, SIGNAL(returnPressed()), this, SLOT(newShipCount()) );
- connect( endTurn, SIGNAL( clicked() ), this, SLOT( nextPlayer() ) );
- connect( mapWidget, SIGNAL( planetHighlighted(Planet *)), planetInfo, SLOT(showPlanet(Planet *)) );
+ connect( mapWidget, TQT_SIGNAL( planetSelected(Planet *) ), this, TQT_SLOT(planetSelected(Planet *)) );
+ connect( shipCountEdit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(newShipCount()) );
+ connect( endTurn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( nextPlayer() ) );
+ connect( mapWidget, TQT_SIGNAL( planetHighlighted(Planet *)), planetInfo, TQT_SLOT(showPlanet(Planet *)) );
changeGameBoard( false );
}
@@ -137,9 +137,9 @@ GameBoard::~GameBoard()
}
#if 0
-QSize GameBoard::sizeHint() const
+TQSize GameBoard::sizeHint() const
{
- return QSize( 600, 550 );
+ return TQSize( 600, 550 );
}
#endif
@@ -147,7 +147,7 @@ QSize GameBoard::sizeHint() const
// Keyboard Event handlers
//************************************************************************
void
-GameBoard::keyPressEvent( QKeyEvent *e )
+GameBoard::keyPressEvent( TQKeyEvent *e )
{
// Check for the escape key
if( e->key() == Key_Escape ) {
@@ -173,7 +173,7 @@ GameBoard::keyPressEvent( QKeyEvent *e )
}
PlanetListIterator planetSearch( planets );
- QString planetName;
+ TQString planetName;
planetName += toupper( e->ascii() );
@@ -312,7 +312,7 @@ GameBoard::turn()
CoreLogic cl;
double dist = cl.distance( sourcePlanet, destPlanet );
- QString msg;
+ TQString msg;
msg = i18n("The distance from Planet %1 to Planet %2 is %3 light years.\n"
"A ship leaving this turn will arrive on turn %4")
.arg(sourcePlanet->getName())
@@ -430,7 +430,7 @@ GameBoard::turn()
break;
}
- QString turnStr;
+ TQString turnStr;
turnStr = i18n("Turn #: %1 of %2").arg(turnNumber).arg(lastTurn);
turnCounter->setText( turnStr );
@@ -553,13 +553,13 @@ GameBoard::findWinner()
}
void
-GameBoard::gameMsg(const QString &msg, Player *player, Planet *planet, Player *planetPlayer)
+GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player *planetPlayer)
{
bool isHumanInvolved = false;
- QString color = "white";
- QString colorMsg = msg;
- QString plainMsg = msg;
+ TQString color = "white";
+ TQString colorMsg = msg;
+ TQString plainMsg = msg;
if (player)
{
@@ -576,8 +576,8 @@ GameBoard::gameMsg(const QString &msg, Player *player, Planet *planet, Player *p
if (!planetPlayer->isAiPlayer() && !planetPlayer->isNeutral())
isHumanInvolved = true;
- QString color = planetPlayer->getColor().name();
- colorMsg = colorMsg.arg(QString("<font color=\"%1\">%2</font>").arg(color, planet->getName()));
+ TQString color = planetPlayer->getColor().name();
+ colorMsg = colorMsg.arg(TQString("<font color=\"%1\">%2</font>").arg(color, planet->getName()));
plainMsg = plainMsg.arg(planet->getName());
}
msgWidget->append(("<qt><font color=\"white\">Turn %1:</font> <font color=\""+color+"\">").arg(turnNumber)+colorMsg+"</font></qt>");
@@ -627,7 +627,7 @@ GameBoard::scanForSurvivors()
while( (plr = nextActivePlayer()) ) {
if( !plr->isInPlay() ) {
// Player has bitten the dust
- QString msg;
+ TQString msg;
msg = i18n("The once mighty empire of %1 has fallen in ruins.");
gameMsg(msg, plr);
}
@@ -637,7 +637,7 @@ GameBoard::scanForSurvivors()
while( (plr = nextInactivePlayer()) ) {
if( plr->isInPlay() ) {
// Player has bitten the dust
- QString msg;
+ TQString msg;
msg = i18n("The fallen empire of %1 has staggered back to life.");
gameMsg(msg, plr);
}
@@ -658,7 +658,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet )
if (!arrivingFleet->owner->isAiPlayer()) {
arrivingFleet->destination->getFleet().absorb(arrivingFleet);
- QString msg;
+ TQString msg;
msg = i18n("Reinforcements (%1 ships) have arrived for planet %2.")
.arg(arrivingFleet->getShipCount());
gameMsg(msg, 0, arrivingFleet->destination);
@@ -702,7 +702,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet )
if( planetHolds ) {
prizePlanet.getPlayer()->statEnemyFleetsDestroyed(1);
- QString msg;
+ TQString msg;
msg = i18n("Planet %2 has held against an attack from %1.");
gameMsg(msg, attacker.owner, &prizePlanet);
} else {
@@ -711,7 +711,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet )
arrivingFleet->destination->conquer( arrivingFleet );
- QString msg;
+ TQString msg;
msg = i18n("Planet %2 has fallen to %1.");
gameMsg(msg, attacker.owner, &prizePlanet, defender);
}
@@ -865,7 +865,7 @@ GameBoard::planetSelected( Planet *planet )
void
GameBoard::newShipCount()
{
- QString temp( shipCountEdit->text() );
+ TQString temp( shipCountEdit->text() );
bool ok;
switch( gameState ) {