summaryrefslogtreecommitdiffstats
path: root/atlantik/libatlantikui/board.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'atlantik/libatlantikui/board.cpp')
-rw-r--r--atlantik/libatlantikui/board.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/atlantik/libatlantikui/board.cpp b/atlantik/libatlantikui/board.cpp
index a4fdf3ce..1b9ae0b5 100644
--- a/atlantik/libatlantikui/board.cpp
+++ b/atlantik/libatlantikui/board.cpp
@@ -16,8 +16,8 @@
#include <iostream>
-#include <qpainter.h>
-#include <qstring.h>
+#include <tqpainter.h>
+#include <tqstring.h>
#include <kdebug.h>
#include <klocale.h>
@@ -35,7 +35,7 @@
#include "board.h"
#include "board.moc"
-AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, QWidget *parent, const char *name) : QWidget(parent, name)
+AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *parent, const char *name) : TQWidget(parent, name)
{
m_atlanticCore = atlanticCore;
m_maxEstates = maxEstates;
@@ -43,17 +43,17 @@ AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, Display
m_animateTokens = false;
m_lastServerDisplay = 0;
- setMinimumSize(QSize(500, 500));
+ setMinimumSize(TQSize(500, 500));
int sideLen = maxEstates/4;
// Animated token movement
m_movingToken = 0;
- m_timer = new QTimer(this);
- connect(m_timer, SIGNAL(timeout()), this, SLOT(slotMoveToken()));
+ m_timer = new TQTimer(this);
+ connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotMoveToken()));
m_resumeTimer = false;
- m_gridLayout = new QGridLayout(this, sideLen+1, sideLen+1);
+ m_gridLayout = new TQGridLayout(this, sideLen+1, sideLen+1);
for(int i=0;i<=sideLen;i++)
{
if (i==0 || i==sideLen)
@@ -68,7 +68,7 @@ AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, Display
}
}
-// spacer = new QWidget(this);
+// spacer = new TQWidget(this);
// m_gridLayout->addWidget(spacer, sideLen, sideLen); // SE
m_displayQueue.setAutoDelete(true);
@@ -101,7 +101,7 @@ void AtlantikBoard::setViewProperties(bool indicateUnowned, bool highliteUnowned
// Update EstateViews
EstateView *estateView;
- for (QPtrListIterator<EstateView> it(m_estateViews); *it; ++it)
+ for (TQPtrListIterator<EstateView> it(m_estateViews); *it; ++it)
if ((estateView = dynamic_cast<EstateView*>(*it)))
estateView->setViewProperties(indicateUnowned, highliteUnowned, darkenMortgaged, quartzEffects);
}
@@ -114,7 +114,7 @@ int AtlantikBoard::heightForWidth(int width)
EstateView *AtlantikBoard::findEstateView(Estate *estate)
{
EstateView *estateView;
- for (QPtrListIterator<EstateView> i(m_estateViews); *i; ++i)
+ for (TQPtrListIterator<EstateView> i(m_estateViews); *i; ++i)
{
estateView = dynamic_cast<EstateView*>(*i);
if (estateView && estateView->estate() == estate)
@@ -125,7 +125,7 @@ EstateView *AtlantikBoard::findEstateView(Estate *estate)
void AtlantikBoard::addEstateView(Estate *estate, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects)
{
- QString icon = QString();
+ TQString icon = TQString();
int estateId = estate->id();
EstateOrientation orientation = North;
int sideLen = m_gridLayout->numRows() - 1;
@@ -142,16 +142,16 @@ void AtlantikBoard::addEstateView(Estate *estate, bool indicateUnowned, bool hig
EstateView *estateView = new EstateView(estate, orientation, icon, indicateUnowned, highliteUnowned, darkenMortgaged, quartzEffects, this, "estateview");
m_estateViews.append(estateView);
- connect(estate, SIGNAL(changed()), estateView, SLOT(estateChanged()));
- connect(estateView, SIGNAL(estateToggleMortgage(Estate *)), estate, SIGNAL(estateToggleMortgage(Estate *)));
- connect(estateView, SIGNAL(LMBClicked(Estate *)), estate, SIGNAL(LMBClicked(Estate *)));
- connect(estateView, SIGNAL(estateHouseBuy(Estate *)), estate, SIGNAL(estateHouseBuy(Estate *)));
- connect(estateView, SIGNAL(estateHouseSell(Estate *)), estate, SIGNAL(estateHouseSell(Estate *)));
- connect(estateView, SIGNAL(newTrade(Player *)), estate, SIGNAL(newTrade(Player *)));
+ connect(estate, TQT_SIGNAL(changed()), estateView, TQT_SLOT(estateChanged()));
+ connect(estateView, TQT_SIGNAL(estateToggleMortgage(Estate *)), estate, TQT_SIGNAL(estateToggleMortgage(Estate *)));
+ connect(estateView, TQT_SIGNAL(LMBClicked(Estate *)), estate, TQT_SIGNAL(LMBClicked(Estate *)));
+ connect(estateView, TQT_SIGNAL(estateHouseBuy(Estate *)), estate, TQT_SIGNAL(estateHouseBuy(Estate *)));
+ connect(estateView, TQT_SIGNAL(estateHouseSell(Estate *)), estate, TQT_SIGNAL(estateHouseSell(Estate *)));
+ connect(estateView, TQT_SIGNAL(newTrade(Player *)), estate, TQT_SIGNAL(newTrade(Player *)));
// Designer has its own LMBClicked slot
if (m_mode == Play)
- connect(estateView, SIGNAL(LMBClicked(Estate *)), this, SLOT(prependEstateDetails(Estate *)));
+ connect(estateView, TQT_SIGNAL(LMBClicked(Estate *)), this, TQT_SLOT(prependEstateDetails(Estate *)));
if (estateId<sideLen)
m_gridLayout->addWidget(estateView, sideLen, sideLen-estateId);
@@ -167,8 +167,8 @@ void AtlantikBoard::addEstateView(Estate *estate, bool indicateUnowned, bool hig
if (m_atlanticCore)
{
Player *player = 0;
- QPtrList<Player> playerList = m_atlanticCore->players();
- for (QPtrListIterator<Player> it(playerList); (player = *it) ; ++it)
+ TQPtrList<Player> playerList = m_atlanticCore->players();
+ for (TQPtrListIterator<Player> it(playerList); (player = *it) ; ++it)
if (player->location() == estate)
addToken(player);
}
@@ -181,13 +181,13 @@ void AtlantikBoard::addAuctionWidget(Auction *auction)
m_displayQueue.prepend(auctionW);
updateCenter();
- connect(auction, SIGNAL(completed()), this, SLOT(displayDefault()));
+ connect(auction, TQT_SIGNAL(completed()), this, TQT_SLOT(displayDefault()));
}
Token *AtlantikBoard::findToken(Player *player)
{
Token *token = 0;
- for (QPtrListIterator<Token> it(m_tokens); (token = *it) ; ++it)
+ for (TQPtrListIterator<Token> it(m_tokens); (token = *it) ; ++it)
if (token->player() == player)
return token;
return 0;
@@ -215,12 +215,12 @@ void AtlantikBoard::addToken(Player *player)
Token *token = new Token(player, this, "token");
m_tokens.append(token);
- connect(player, SIGNAL(changed(Player *)), token, SLOT(playerChanged()));
+ connect(player, TQT_SIGNAL(changed(Player *)), token, TQT_SLOT(playerChanged()));
jumpToken(token);
// Timer to reinit the gameboard _after_ event loop
- QTimer::singleShot(100, this, SLOT(slotResizeAftermath()));
+ TQTimer::singleShot(100, this, TQT_SLOT(slotResizeAftermath()));
}
void AtlantikBoard::playerChanged(Player *player)
@@ -305,7 +305,7 @@ void AtlantikBoard::jumpToken(Token *token)
kdDebug() << "jumpToken to " << token->location()->name() << endl;
- QPoint tGeom = calculateTokenDestination(token);
+ TQPoint tGeom = calculateTokenDestination(token);
token->setGeometry(tGeom.x(), tGeom.y(), token->width(), token->height());
Player *player = token->player();
@@ -339,14 +339,14 @@ void AtlantikBoard::moveToken(Token *token)
m_timer->start(15);
}
-QPoint AtlantikBoard::calculateTokenDestination(Token *token, Estate *eDest)
+TQPoint AtlantikBoard::calculateTokenDestination(Token *token, Estate *eDest)
{
if (!eDest)
eDest = token->location();
EstateView *evDest = findEstateView(eDest);
if (!evDest)
- return QPoint(0, 0);
+ return TQPoint(0, 0);
int x = 0, y = 0;
if (token->player()->inJail())
@@ -374,7 +374,7 @@ QPoint AtlantikBoard::calculateTokenDestination(Token *token, Estate *eDest)
}
*/
}
- return QPoint(x, y);
+ return TQPoint(x, y);
}
void AtlantikBoard::slotMoveToken()
@@ -399,7 +399,7 @@ void AtlantikBoard::slotMoveToken()
// Where do we want to go today?
Estate *eDest = m_atlanticCore->estateAfter(m_movingToken->location());
- QPoint tGeom = calculateTokenDestination(m_movingToken, eDest);
+ TQPoint tGeom = calculateTokenDestination(m_movingToken, eDest);
int xDest = tGeom.x();
int yDest = tGeom.y();
@@ -442,7 +442,7 @@ void AtlantikBoard::slotMoveToken()
}
}
-void AtlantikBoard::resizeEvent(QResizeEvent *)
+void AtlantikBoard::resizeEvent(TQResizeEvent *)
{
// Stop moving tokens, slotResizeAftermath will re-enable this
if (m_timer!=0 && m_timer->isActive())
@@ -456,17 +456,17 @@ void AtlantikBoard::resizeEvent(QResizeEvent *)
int q = e->size().width() - e->size().height();
if (q > 0)
{
- QSize s(q, 0);
+ TQSize s(q, 0);
spacer->setFixedSize(s);
}
else
{
- QSize s(0, -q);
+ TQSize s(0, -q);
spacer->setFixedSize(s);
}
*/
// Timer to reinit the gameboard _after_ resizeEvent
- QTimer::singleShot(0, this, SLOT(slotResizeAftermath()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotResizeAftermath()));
}
void AtlantikBoard::slotResizeAftermath()
@@ -477,7 +477,7 @@ void AtlantikBoard::slotResizeAftermath()
// adjusted estate geometries.
Token *token = 0;
- for (QPtrListIterator<Token> it(m_tokens); (token = *it) ; ++it)
+ for (TQPtrListIterator<Token> it(m_tokens); (token = *it) ; ++it)
jumpToken(token);
// Restart the timer that was stopped in resizeEvent
@@ -493,7 +493,7 @@ void AtlantikBoard::displayDefault()
switch(m_displayQueue.count())
{
case 0:
- m_displayQueue.prepend(new QWidget(this));
+ m_displayQueue.prepend(new TQWidget(this));
break;
case 1:
if (EstateDetails *display = dynamic_cast<EstateDetails*>(m_lastServerDisplay))
@@ -508,7 +508,7 @@ void AtlantikBoard::displayDefault()
updateCenter();
}
-void AtlantikBoard::displayButton(QString command, QString caption, bool enabled)
+void AtlantikBoard::displayButton(TQString command, TQString caption, bool enabled)
{
if (EstateDetails *display = dynamic_cast<EstateDetails*>(m_lastServerDisplay))
display->addButton(command, caption, enabled);
@@ -521,7 +521,7 @@ void AtlantikBoard::addCloseButton()
eDetails->addCloseButton();
}
-void AtlantikBoard::insertDetails(QString text, bool clearText, bool clearButtons, Estate *estate)
+void AtlantikBoard::insertDetails(TQString text, bool clearText, bool clearButtons, Estate *estate)
{
EstateDetails *eDetails = 0;
@@ -544,8 +544,8 @@ void AtlantikBoard::insertDetails(QString text, bool clearText, bool clearButton
eDetails = new EstateDetails(estate, text, this);
m_lastServerDisplay = eDetails;
- connect(eDetails, SIGNAL(buttonCommand(QString)), this, SIGNAL(buttonCommand(QString)));
- connect(eDetails, SIGNAL(buttonClose()), this, SLOT(displayDefault()));
+ connect(eDetails, TQT_SIGNAL(buttonCommand(TQString)), this, TQT_SIGNAL(buttonCommand(TQString)));
+ connect(eDetails, TQT_SIGNAL(buttonClose()), this, TQT_SLOT(displayDefault()));
m_displayQueue.insert(0, eDetails);
updateCenter();
@@ -560,11 +560,11 @@ void AtlantikBoard::prependEstateDetails(Estate *estate)
if (m_displayQueue.getFirst() == m_lastServerDisplay)
{
- eDetails = new EstateDetails(estate, QString::null, this);
+ eDetails = new EstateDetails(estate, TQString::null, this);
m_displayQueue.prepend(eDetails);
- connect(eDetails, SIGNAL(buttonCommand(QString)), this, SIGNAL(buttonCommand(QString)));
- connect(eDetails, SIGNAL(buttonClose()), this, SLOT(displayDefault()));
+ connect(eDetails, TQT_SIGNAL(buttonCommand(TQString)), this, TQT_SIGNAL(buttonCommand(TQString)));
+ connect(eDetails, TQT_SIGNAL(buttonClose()), this, TQT_SLOT(displayDefault()));
}
else
{
@@ -572,7 +572,7 @@ void AtlantikBoard::prependEstateDetails(Estate *estate)
if (eDetails)
{
eDetails->setEstate(estate);
- eDetails->setText( QString::null );
+ eDetails->setText( TQString::null );
// eDetails->clearButtons();
}
else
@@ -590,12 +590,12 @@ void AtlantikBoard::prependEstateDetails(Estate *estate)
void AtlantikBoard::updateCenter()
{
- QWidget *center = m_displayQueue.getFirst();
+ TQWidget *center = m_displayQueue.getFirst();
m_gridLayout->addMultiCellWidget(center, 1, m_gridLayout->numRows()-2, 1, m_gridLayout->numCols()-2);
center->show();
}
-QWidget *AtlantikBoard::centerWidget()
+TQWidget *AtlantikBoard::centerWidget()
{
return m_displayQueue.getFirst();
}