diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /kbackgammon/engines/offline | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-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 'kbackgammon/engines/offline')
-rw-r--r-- | kbackgammon/engines/offline/kbgoffline.cpp | 44 | ||||
-rw-r--r-- | kbackgammon/engines/offline/kbgoffline.h | 3 |
2 files changed, 24 insertions, 23 deletions
diff --git a/kbackgammon/engines/offline/kbgoffline.cpp b/kbackgammon/engines/offline/kbgoffline.cpp index 4a9e1755..14197f54 100644 --- a/kbackgammon/engines/offline/kbgoffline.cpp +++ b/kbackgammon/engines/offline/kbgoffline.cpp @@ -60,7 +60,7 @@ public: /* * Store two copies of the game: one backup and a working copy */ - KBgStatus mGame[2]; + KBgtqStatus mGame[2]; /* * Use the standard method of obtaining random numbers @@ -106,8 +106,8 @@ public: /* * Constructor */ -KBgEngineOffline::KBgEngineOffline(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineOffline::KBgEngineOffline(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { d = new KBgEngineOfflinePrivate(); @@ -282,10 +282,10 @@ void KBgEngineOffline::newGame() /* * If there is a game running we warn the user first */ - if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)parent(), + if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)tqparent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - TQString::null, i18n("Start New Game"), + TQString(), i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -318,14 +318,14 @@ void KBgEngineOffline::newGame() u = getRandom(); t = getRandom(); emit infoText(i18n("%1 rolls %2, %3 rolls %4."). - arg(d->mName[0]).arg(u).arg(d->mName[1]).arg(t)); + tqarg(d->mName[0]).tqarg(u).tqarg(d->mName[1]).tqarg(t)); } if (u > t) { - emit infoText(i18n("%1 makes the first move.").arg(d->mName[0])); + emit infoText(i18n("%1 makes the first move.").tqarg(d->mName[0])); d->mRoll = US; } else { - emit infoText(i18n("%1 makes the first move.").arg(d->mName[1])); + emit infoText(i18n("%1 makes the first move.").tqarg(d->mName[1])); d->mRoll = THEM; int n = u; u = t; t = n; } @@ -338,7 +338,7 @@ void KBgEngineOffline::newGame() /* * tell the user */ - emit statText(i18n("%1 vs. %2").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2").tqarg(d->mName[0]).tqarg(d->mName[1])); } /* @@ -397,7 +397,7 @@ bool KBgEngineOffline::queryPlayerName(int w) } do { - *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)parent()); + *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)tqparent()); if (!ret) break; } while (name->isEmpty()); @@ -484,7 +484,7 @@ void KBgEngineOffline::redo() void KBgEngineOffline::handleMove(TQString *s) { int index = 0; - TQString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->tqfind(' ', index)); index += 1 + t.length(); int moves = t.toInt(); @@ -510,22 +510,22 @@ void KBgEngineOffline::handleMove(TQString *s) */ for (int i = 0; i < moves; i++) { bool kick = false; - t = s->mid(index, s->find(' ', index) - index); + t = s->mid(index, s->tqfind(' ', index) - index); index += 1 + t.length(); char c = '-'; - if (t.contains('+')) { + if (t.tqcontains('+')) { c = '+'; kick = true; } - TQString r = t.left(t.find(c)); - if (r.contains("bar")) { + TQString r = t.left(t.tqfind(c)); + if (r.tqcontains("bar")) { d->mGame[0].setBar(d->mRoll, abs(d->mGame[0].bar(d->mRoll)) - 1); } else { int from = r.toInt(); d->mGame[0].setBoard(from, d->mRoll, abs(d->mGame[0].board(from)) - 1); } t.remove(0, 1 + r.length()); - if (t.contains("off")) { + if (t.tqcontains("off")) { d->mGame[0].setHome(d->mRoll, abs(d->mGame[0].home(d->mRoll)) + 1); } else { int to = t.toInt(); @@ -645,7 +645,7 @@ void KBgEngineOffline::cube() if (d->mRollFlag && d->mGame[0].cube(w) > 0) { emit allowCommand(Cube, false); - if (KMessageBox::questionYesNo((TQWidget *)parent(), + if (KMessageBox::questionYesNo((TQWidget *)tqparent(), i18n("%1 has doubled. %2, do you accept the double?"). arg((w == THEM) ? d->mName[1] : d->mName[0]). arg((w == US) ? d->mName[1] : d->mName[0]), @@ -695,9 +695,9 @@ bool KBgEngineOffline::queryClose() if (!d->mGameFlag) return true; - switch (KMessageBox::warningContinueCancel((TQWidget *)parent(), + switch (KMessageBox::warningContinueCancel((TQWidget *)tqparent(), i18n("In the middle of a game. " - "Really quit?"), TQString::null, KStdGuiItem::quit())) { + "Really quit?"), TQString(), KStdGuiItem::quit())) { case KMessageBox::Continue : return TRUE; case KMessageBox::Cancel : @@ -722,7 +722,7 @@ bool KBgEngineOffline::queryExit() void KBgEngineOffline::handleCommand(const TQString& cmd) { emit infoText(i18n("Text commands are not yet working. " - "The command '%1' has been ignored.").arg(cmd)); + "The command '%1' has been ignored.").tqarg(cmd)); } /* @@ -791,11 +791,11 @@ void KBgEngineOffline::toggleEditMode() emit allowCommand(Roll, false); emit allowCommand(Done, false); emit allowCommand(Cube, false); - emit statText(i18n("%1 vs. %2 - Edit Mode").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2 - Edit Mode").tqarg(d->mName[0]).tqarg(d->mName[1])); } else { d->mNew->setEnabled(true); d->mSwap->setEnabled(true); - emit statText(i18n("%1 vs. %2").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2").tqarg(d->mName[0]).tqarg(d->mName[1])); emit getState(&d->mGame[1]); d->mGame[0] = d->mGame[1]; emit allowCommand(Done, d->mDoneFlag); diff --git a/kbackgammon/engines/offline/kbgoffline.h b/kbackgammon/engines/offline/kbgoffline.h index 8a6448fb..a0217920 100644 --- a/kbackgammon/engines/offline/kbgoffline.h +++ b/kbackgammon/engines/offline/kbgoffline.h @@ -49,13 +49,14 @@ class KBgEngineOfflinePrivate; class KBgEngineOffline : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgEngineOffline(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineOffline(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor |