summaryrefslogtreecommitdiffstats
path: root/konquest/gameboard.cc
diff options
context:
space:
mode:
Diffstat (limited to 'konquest/gameboard.cc')
-rw-r--r--konquest/gameboard.cc86
1 files changed, 43 insertions, 43 deletions
diff --git a/konquest/gameboard.cc b/konquest/gameboard.cc
index 9f1d1a7f..f4b0e25a 100644
--- a/konquest/gameboard.cc
+++ b/konquest/gameboard.cc
@@ -1,4 +1,4 @@
-#include <tqlayout.h>
+#include <layout.h>
#include <tqcolor.h>
#include <tqlabel.h>
#include <tqslider.h>
@@ -8,7 +8,7 @@
#include <tqpushbutton.h>
#include <tqlineedit.h>
#include <tqvalidator.h>
-#include <tqtextedit.h>
+#include <textedit.h>
#include <kapplication.h>
#include <klocale.h>
@@ -60,10 +60,10 @@ GameBoard::GameBoard( TQWidget *parent )
turnCounter = new TQLabel( this );
turnCounter->setPalette( palette );
turnCounter->setText( "Turn" );
- turnCounter->setMaximumHeight( turnCounter->tqsizeHint().height() );
+ turnCounter->setMaximumHeight( turnCounter->sizeHint().height() );
endTurn = new TQPushButton( i18n("End Turn"), this );
- endTurn->setFixedSize( endTurn->tqsizeHint() );
+ endTurn->setFixedSize( endTurn->sizeHint() );
endTurn->setPalette( palette );
shipCountEdit = new TQLineEdit( this );
@@ -88,33 +88,33 @@ GameBoard::GameBoard( TQWidget *parent )
//********************************************************************
// Layout the main window
//********************************************************************
- TQHBoxLayout *tqlayout1 = new TQHBoxLayout( this );
- TQVBoxLayout *tqlayout2 = new TQVBoxLayout;
- TQHBoxLayout *tqlayout3 = new TQHBoxLayout;
- TQVBoxLayout *tqlayout4 = new TQVBoxLayout;
+ TQHBoxLayout *layout1 = new TQHBoxLayout( this );
+ TQVBoxLayout *layout2 = new TQVBoxLayout;
+ TQHBoxLayout *layout3 = new TQHBoxLayout;
+ TQVBoxLayout *layout4 = new TQVBoxLayout;
- tqlayout1->addLayout( tqlayout2 );
- tqlayout2->addLayout( tqlayout3 );
+ layout1->addLayout( layout2 );
+ layout2->addLayout( layout3 );
- tqlayout3->addSpacing( 5 );
- tqlayout3->addWidget( gameMessage, 10 );
- tqlayout3->addWidget( shipCountEdit, 1 );
- tqlayout3->addWidget( endTurn, 1 );
+ layout3->addSpacing( 5 );
+ layout3->addWidget( gameMessage, 10 );
+ layout3->addWidget( shipCountEdit, 1 );
+ layout3->addWidget( endTurn, 1 );
- tqlayout2->addSpacing( 5 );
- tqlayout2->addWidget( mapWidget, 0, AlignTop );
- tqlayout2->addWidget( msgWidget );
- tqlayout2->addStretch( 1 );
+ layout2->addSpacing( 5 );
+ layout2->addWidget( mapWidget, 0, AlignTop );
+ layout2->addWidget( msgWidget );
+ layout2->addStretch( 1 );
- tqlayout1->addSpacing( 5 );
- tqlayout1->addLayout( tqlayout4, 10 );
+ layout1->addSpacing( 5 );
+ layout1->addLayout( layout4, 10 );
- tqlayout4->addWidget( planetInfo, 1 );
- tqlayout4->addSpacing( 10 );
- tqlayout4->addWidget( turnCounter, 1 );
- tqlayout4->addStretch( 1 );
+ layout4->addWidget( planetInfo, 1 );
+ layout4->addSpacing( 10 );
+ layout4->addWidget( turnCounter, 1 );
+ layout4->addStretch( 1 );
- tqlayout1->addStretch( 1 );
+ layout1->addStretch( 1 );
//**********************************************************************
// Set up signal/slot connections
@@ -137,7 +137,7 @@ GameBoard::~GameBoard()
}
#if 0
-TQSize GameBoard::tqsizeHint() const
+TQSize GameBoard::sizeHint() const
{
return TQSize( 600, 550 );
}
@@ -315,10 +315,10 @@ GameBoard::turn()
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")
- .tqarg(sourcePlanet->getName())
- .tqarg(destPlanet->getName())
- .tqarg(KGlobal::locale()->formatNumber( dist, 2 ))
- .tqarg(KGlobal::locale()->formatNumber( turnNumber + (int)dist, 0 ));
+ .arg(sourcePlanet->getName())
+ .arg(destPlanet->getName())
+ .arg(KGlobal::locale()->formatNumber( dist, 2 ))
+ .arg(KGlobal::locale()->formatNumber( turnNumber + (int)dist, 0 ));
KMessageBox::information( this, msg, i18n("Distance"));
gameState = NONE;
@@ -431,7 +431,7 @@ GameBoard::turn()
}
TQString turnStr;
- turnStr = i18n("Turn #: %1 of %2").tqarg(turnNumber).tqarg(lastTurn);
+ turnStr = i18n("Turn #: %1 of %2").arg(turnNumber).arg(lastTurn);
turnCounter->setText( turnStr );
@@ -470,15 +470,15 @@ GameBoard::nextTurn()
Player *winner = findWinner();
if (winner)
{
- mapWidget->tqrepaint(true);
+ mapWidget->repaint(true);
KMessageBox::information(this,
- i18n("The mighty %1 has conquered the galaxy!").tqarg(winner->getName()),
+ i18n("The mighty %1 has conquered the galaxy!").arg(winner->getName()),
i18n("Game Over"));
}
if( (turnNumber == lastTurn) && !winner )
{
- mapWidget->tqrepaint(true);
+ mapWidget->repaint(true);
GameEndDlg *dlg = new GameEndDlg( this );
if( dlg->exec() == KDialogBase::Yes ) {
@@ -492,7 +492,7 @@ GameBoard::nextTurn()
{
// Game over, man! Game over.
- mapWidget->tqrepaint(true);
+ mapWidget->repaint(true);
gameOver();
};
@@ -565,8 +565,8 @@ GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player *
{
if (!player->isAiPlayer())
isHumanInvolved = true;
- colorMsg = colorMsg.tqarg(playerString(player));
- plainMsg = plainMsg.tqarg(player->getName());
+ colorMsg = colorMsg.arg(playerString(player));
+ plainMsg = plainMsg.arg(player->getName());
}
if (planet)
@@ -577,15 +577,15 @@ GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player *
isHumanInvolved = true;
TQString color = planetPlayer->getColor().name();
- colorMsg = colorMsg.tqarg(TQString("<font color=\"%1\">%2</font>").tqarg(color, planet->getName()));
- plainMsg = plainMsg.tqarg(planet->getName());
+ 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+"\">").tqarg(turnNumber)+colorMsg+"</font></qt>");
+ msgWidget->append(("<qt><font color=\"white\">Turn %1:</font> <font color=\""+color+"\">").arg(turnNumber)+colorMsg+"</font></qt>");
msgWidget->scrollToBottom();
if (isHumanInvolved)
{
- mapWidget->tqrepaint(true);
+ mapWidget->repaint(true);
KMessageBox::information(this, plainMsg);
}
}
@@ -660,7 +660,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet )
TQString msg;
msg = i18n("Reinforcements (%1 ships) have arrived for planet %2.")
- .tqarg(arrivingFleet->getShipCount());
+ .arg(arrivingFleet->getShipCount());
gameMsg(msg, 0, arrivingFleet->destination);
}
} else {
@@ -717,7 +717,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet )
}
}
- mapWidget->tqrepaint(true);
+ mapWidget->repaint(true);
}
//************************************************************************