From 576eb4299a00bc053db35414406f46372a0f70f2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:42:31 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kreversi/kreversi.cpp | 76 +++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'kreversi/kreversi.cpp') diff --git a/kreversi/kreversi.cpp b/kreversi/kreversi.cpp index b0a5ddc8..d01c2f6e 100644 --- a/kreversi/kreversi.cpp +++ b/kreversi/kreversi.cpp @@ -39,9 +39,9 @@ #include -#include -#include -#include +#include +#include +#include #include #include @@ -74,7 +74,7 @@ #ifndef PICDATA #define PICDATA(x) \ - KGlobal::dirs()->findResource("appdata", QString("pics/") + x) + KGlobal::dirs()->findResource("appdata", TQString("pics/") + x) #endif @@ -82,8 +82,8 @@ KReversi::KReversi() : KZoomMainWindow(10, 300, 5, "kreversi"), m_gameOver(false) { - QWidget *w; - QGridLayout *top; + TQWidget *w; + TQGridLayout *top; KNotifyClient::startDaemon(); @@ -98,10 +98,10 @@ KReversi::KReversi() setStrength(1); // The visual stuff - w = new QWidget(this); + w = new TQWidget(this); setCentralWidget(w); - top = new QGridLayout(w, 2, 2); + top = new TQGridLayout(w, 2, 2); // The reversi game view. m_gameView = new QReversiGameView(w, m_game); @@ -116,15 +116,15 @@ KReversi::KReversi() // The only part of the view that is left in this class is the // indicator of whose turn it is in the status bar. The rest is // in the game view. - connect(m_game, SIGNAL(sig_newGame()), this, SLOT(showTurn())); - connect(m_game, SIGNAL(sig_move(uint, Move&)), - this, SLOT(handleMove(uint, Move&))); // Calls showTurn(). - connect(m_game, SIGNAL(sig_update()), this, SLOT(showTurn())); - connect(m_game, SIGNAL(sig_gameOver()), this, SLOT(slotGameOver())); + connect(m_game, TQT_SIGNAL(sig_newGame()), this, TQT_SLOT(showTurn())); + connect(m_game, TQT_SIGNAL(sig_move(uint, Move&)), + this, TQT_SLOT(handleMove(uint, Move&))); // Calls showTurn(). + connect(m_game, TQT_SIGNAL(sig_update()), this, TQT_SLOT(showTurn())); + connect(m_game, TQT_SIGNAL(sig_gameOver()), this, TQT_SLOT(slotGameOver())); // Signal that is sent when the user clicks on the board. - connect(m_gameView, SIGNAL(signalSquareClicked(int, int)), - this, SLOT(slotSquareClicked(int, int))); + connect(m_gameView, TQT_SIGNAL(signalSquareClicked(int, int)), + this, TQT_SLOT(slotSquareClicked(int, int))); loadSettings(); @@ -150,38 +150,38 @@ KReversi::~KReversi() void KReversi::createKActions() { // Standard Game Actions. - KStdGameAction::gameNew(this, SLOT(slotNewGame()), actionCollection(), + KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection(), "game_new"); - KStdGameAction::load(this, SLOT(slotOpenGame()), actionCollection()); - KStdGameAction::save(this, SLOT(slotSave()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); - KStdGameAction::hint(this, SLOT(slotHint()), actionCollection(), + KStdGameAction::load(this, TQT_SLOT(slotOpenGame()), actionCollection()); + KStdGameAction::save(this, TQT_SLOT(slotSave()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::hint(this, TQT_SLOT(slotHint()), actionCollection(), "game_hint"); - KStdGameAction::undo(this, SLOT(slotUndo()), actionCollection(), + KStdGameAction::undo(this, TQT_SLOT(slotUndo()), actionCollection(), "game_undo"); // Non-standard Game Actions: Stop, Continue, Switch sides stopAction = new KAction(i18n("&Stop Thinking"), "game_stop", Qt::Key_Escape, - this, SLOT(slotInterrupt()), actionCollection(), + this, TQT_SLOT(slotInterrupt()), actionCollection(), "game_stop"); continueAction = new KAction(i18n("&Continue Thinking"), "reload", 0, - this, SLOT(slotContinue()), actionCollection(), + this, TQT_SLOT(slotContinue()), actionCollection(), "game_continue"); new KAction(i18n("S&witch Sides"), 0, 0, - this, SLOT(slotSwitchSides()), actionCollection(), + this, TQT_SLOT(slotSwitchSides()), actionCollection(), "game_switch_sides"); // Some more standard game actions: Highscores, Settings. - KStdGameAction::highscores(this, SLOT(showHighScoreDialog()), actionCollection()); - KStdAction::preferences(this, SLOT(slotEditSettings()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(showHighScoreDialog()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(slotEditSettings()), actionCollection()); // Actions for the view(s). showLastMoveAction = new KToggleAction(i18n("Show Last Move"), "lastmoves", 0, - this, SLOT(slotShowLastMove()), + this, TQT_SLOT(slotShowLastMove()), actionCollection(), "show_last_move"); showLegalMovesAction = new KToggleAction(i18n("Show Legal Moves"), "legalmoves", 0, - this, SLOT(slotShowLegalMoves()), + this, TQT_SLOT(slotShowLegalMoves()), actionCollection(), "show_legal_moves"); } @@ -392,7 +392,7 @@ void KReversi::slotSwitchSides() if (m_game->moveNumber() != 0) { int res = KMessageBox::warningContinueCancel(this, i18n("If you switch side, your score will not be added to the highscores."), - QString::null, QString::null, "switch_side_warning"); + TQString::null, TQString::null, "switch_side_warning"); if ( res==KMessageBox::Cancel ) return; @@ -465,7 +465,7 @@ void KReversi::showTurn(Color color) if (color == humanColor()) statusBar()->message(i18n("Your turn")); else if (color == computerColor()) { - QString message = i18n("Computer's turn"); + TQString message = i18n("Computer's turn"); // We can't use the interrupted() test here since we might be in a // middle state when called from slotInterrupt(). @@ -608,21 +608,21 @@ void KReversi::showGameOver(Color color) // Show the winner in a messagebox. if ( color == Nobody ) { KNotifyClient::event(winId(), "draw", i18n("Draw!")); - QString s = i18n("Game is drawn!\n\nYou : %1\nComputer: %2") + TQString s = i18n("Game is drawn!\n\nYou : %1\nComputer: %2") .arg(human).arg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Draw); } else if ( humanColor() == color ) { KNotifyClient::event(winId(), "won", i18n("Game won!")); - QString s = i18n("Congratulations, you have won!\n\nYou : %1\nComputer: %2") + TQString s = i18n("Congratulations, you have won!\n\nYou : %1\nComputer: %2") .arg(human).arg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Won); } else { KNotifyClient::event(winId(), "lost", i18n("Game lost!")); - QString s = i18n("You have lost the game!\n\nYou : %1\nComputer: %2") + TQString s = i18n("You have lost the game!\n\nYou : %1\nComputer: %2") .arg(human).arg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Lost); @@ -661,8 +661,8 @@ void KReversi::saveGame(KConfig *config) for (uint i = 0; i < m_game->moveNumber(); i++) { Move move = m_game->move(i); - QString moveString; - QString idx; + TQString moveString; + TQString idx; moveString.sprintf("%d %d %d", move.x(), move.y(), (int) move.color()); idx.sprintf("Move_%d", i + 1); @@ -691,10 +691,10 @@ bool KReversi::loadGame(KConfig *config) uint movenumber = 1; while (nmoves--) { // Read one move. - QString idx; + TQString idx; idx.sprintf("Move_%d", movenumber++); - QStringList s = config->readListEntry(idx, ' '); + TQStringList s = config->readListEntry(idx, ' '); uint x = (*s.at(0)).toUInt(); uint y = (*s.at(1)).toUInt(); Color color = (Color)(*s.at(2)).toInt(); @@ -755,7 +755,7 @@ void KReversi::slotEditSettings() Settings *general = new Settings(0, "General"); dialog->addPage(general, i18n("General"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); dialog->show(); } -- cgit v1.2.1