summaryrefslogtreecommitdiffstats
path: root/kpoker/kpoker.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /kpoker/kpoker.cpp
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz
tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpoker/kpoker.cpp')
-rw-r--r--kpoker/kpoker.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/kpoker/kpoker.cpp b/kpoker/kpoker.cpp
index 0a293118..0c826c14 100644
--- a/kpoker/kpoker.cpp
+++ b/kpoker/kpoker.cpp
@@ -88,7 +88,7 @@ PokerGame::dealCards(PokerPlayer *player, bool skip[])
void
PokerGame::activatePlayer(PokerPlayer *player)
{
- if (!m_activePlayers.contains(player)) {
+ if (!m_activePlayers.tqcontains(player)) {
m_activePlayers.append(player);
m_removedPlayers.remove(player);
}
@@ -98,7 +98,7 @@ PokerGame::activatePlayer(PokerPlayer *player)
void
PokerGame::inactivatePlayer(PokerPlayer *player)
{
- if (m_activePlayers.contains(player)) {
+ if (m_activePlayers.tqcontains(player)) {
m_activePlayers.remove(player);
m_removedPlayers.append(player);
}
@@ -159,8 +159,8 @@ CardImages *cardImages;
// Class kpok
-kpok::kpok(TQWidget *parent, const char *name)
- : TQWidget(parent, name),
+kpok::kpok(TQWidget *tqparent, const char *name)
+ : TQWidget(tqparent, name),
m_game(&m_random)
{
TQString version;
@@ -178,7 +178,7 @@ kpok::kpok(TQWidget *parent, const char *name)
// ...and the rest to computer players.
for (int unsigned i = 1; i < m_numPlayers; i++)
- m_players[i].setName(TQString("Computer %1").arg(i-1));
+ m_players[i].setName(TQString("Computer %1").tqarg(i-1));
lastHandText = "";
@@ -269,13 +269,13 @@ void kpok::initWindow()
mWonWidget = new TQWidget(this);
inputLayout->addWidget(mWonWidget, 2);
mWonWidget->setMinimumHeight(50); //FIXME hardcoded value for the wave
- mWonWidget->setMinimumWidth(tmp.width(i18n("You won %1").arg(KGlobal::locale()->formatMoney(100))) + 20); // workaround for width problem in wave
+ mWonWidget->setMinimumWidth(tmp.width(i18n("You won %1").tqarg(KGlobal::locale()->formatMoney(100))) + 20); // workaround for width problem in wave
TQHBoxLayout* wonLayout = new TQHBoxLayout(mWonWidget);
wonLayout->setAutoAdd(true);
wonLabel = new TQLabel(mWonWidget);
wonLabel->setFont(wonFont);
- wonLabel->setAlignment(AlignCenter);
+ wonLabel->tqsetAlignment(AlignCenter);
wonLabel->hide();
inputLayout->addStretch(1);
@@ -554,7 +554,7 @@ void kpok::bet()
// Check if player 1 is out -> for players > 2
- // TODO: maybe if (!m_activePlayers.contains(humanPlayer))
+ // TODO: maybe if (!m_activePlayers.tqcontains(humanPlayer))
// {exchangeCards(); bet(); displayerWinner_computer();return;}
@@ -674,7 +674,7 @@ void kpok::initPoker(unsigned int numPlayers)
m_game.clearPot();
drawAllDecks();
for (unsigned int i = 0; i < m_numPlayers; i++) {
- playerBox[i]->repaintCard();
+ playerBox[i]->tqrepaintCard();
}
paintCash();
playerBox[0]->setHeldEnabled(false);
@@ -686,7 +686,7 @@ void kpok::paintCash()
for (unsigned int i = 0; i < m_numPlayers; i++) {
playerBox[i]->showCash();
}
- potLabel->setText(i18n("Pot: %1").arg(KGlobal::locale()->formatMoney(m_game.getPot())));
+ potLabel->setText(i18n("Pot: %1").tqarg(KGlobal::locale()->formatMoney(m_game.getPot())));
}
@@ -805,9 +805,9 @@ void kpok::displayWinner_Computer(PokerPlayer* winner, bool othersPassed)
// Generate a string with winner info and show it.
TQString label;
if (winner->getHuman())
- label = i18n("You won %1").arg(KGlobal::locale()->formatMoney(m_game.getPot()));
+ label = i18n("You won %1").tqarg(KGlobal::locale()->formatMoney(m_game.getPot()));
else
- label = i18n("%1 won %2").arg(winner->getName()).arg(KGlobal::locale()->formatMoney(m_game.getPot()));
+ label = i18n("%1 won %2").tqarg(winner->getName()).tqarg(KGlobal::locale()->formatMoney(m_game.getPot()));
wonLabel->setText(label);
// Start the waving motion of the text.
@@ -1028,7 +1028,7 @@ void kpok::stopWave()
{
waveTimer->stop();
fCount = -1; /* clear image */
- repaint ( FALSE );
+ tqrepaint ( FALSE );
waveActive = false;
}
@@ -1042,7 +1042,7 @@ void kpok::stopDrawing()
void kpok::waveTimerEvent()
{
fCount = (fCount + 1) & 15;
- repaint( FALSE );
+ tqrepaint( FALSE );
}
@@ -1072,7 +1072,7 @@ void kpok::displayWin(const TQString& hand, int cashWon)
if (cashWon) {
playSound("win.wav");
- buf = i18n("You won %1!").arg(KGlobal::locale()->formatMoney(cashWon));
+ buf = i18n("You won %1!").tqarg(KGlobal::locale()->formatMoney(cashWon));
} else {
playSound("lose.wav");
buf = i18n("Game Over"); // locale
@@ -1093,7 +1093,7 @@ void kpok::displayWin(const TQString& hand, int cashWon)
void kpok::paintEvent( TQPaintEvent *)
{
/* NOTE: This was shamelessy stolen from the "hello world" example
- * coming with Qt Thanks to the Qt-Guys for doing such a cool
+ * coming with TQt Thanks to the TQt-Guys for doing such a cool
* example 8-)
*/
@@ -1307,9 +1307,9 @@ void kpok::saveGame(KConfig* conf)
conf->writeEntry("lastHandText", lastHandText);
for (int i = 0; i < players; i++) {
- conf->writeEntry(TQString("Name_%1").arg(i), m_players[i].getName());
- conf->writeEntry(TQString("Human_%1").arg(i), m_players[i].getHuman());
- conf->writeEntry(TQString("Cash_%1").arg(i), m_players[i].getCash());
+ conf->writeEntry(TQString("Name_%1").tqarg(i), m_players[i].getName());
+ conf->writeEntry(TQString("Human_%1").tqarg(i), m_players[i].getHuman());
+ conf->writeEntry(TQString("Cash_%1").tqarg(i), m_players[i].getCash());
}
m_game.clearDirty();
@@ -1407,14 +1407,14 @@ bool kpok::loadGame(KConfig* conf)
if (numPlayers > 0) {
for (int i = 0; i < numPlayers; i++) {
- TQString buf = conf->readEntry(TQString("Name_%1").arg(i),
+ TQString buf = conf->readEntry(TQString("Name_%1").tqarg(i),
"Player");
m_players[i].setName(buf);
- bool human = conf->readBoolEntry(TQString("Human_%1").arg(i),
+ bool human = conf->readBoolEntry(TQString("Human_%1").tqarg(i),
false);
if (human)
m_players[i].setHuman(); // i == 0
- int cash = conf->readNumEntry(TQString("Cash_%1").arg(i),
+ int cash = conf->readNumEntry(TQString("Cash_%1").tqarg(i),
START_MONEY);
m_players[i].setCash(cash);
m_game.setDirty();
@@ -1469,7 +1469,7 @@ void kpok::slotCardDeck()
cardImages->loadCards(cardPath);
for (int i = 0; i < m_game.getNumActivePlayers(); i++) {
- playerBox[i]->repaintCard();
+ playerBox[i]->tqrepaintCard();
}
// Save selected stuff in the configuration.