diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /ksnake/game.cpp | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksnake/game.cpp')
-rw-r--r-- | ksnake/game.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/ksnake/game.cpp b/ksnake/game.cpp index 0fa18df2..4817b3af 100644 --- a/ksnake/game.cpp +++ b/ksnake/game.cpp @@ -29,8 +29,8 @@ from KReversi. thanks. */ -#include <qdir.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqregexp.h> #include <klocale.h> @@ -54,7 +54,7 @@ #define SCORE 1 #define LIVES 2 -Game::Game(QWidget *parent, const char *name) : KMainWindow(parent,name) +Game::Game(TQWidget *parent, const char *name) : KMainWindow(parent,name) { // create statusbar statusBar()->insertItem(i18n("Score: 0"), SCORE); @@ -67,14 +67,14 @@ Game::Game(QWidget *parent, const char *name) : KMainWindow(parent,name) rattler->reloadRoomPixmap(); rattler->setFocus(); - connect(rattler, SIGNAL(setPoints(int)), this, SLOT(scoreChanged(int))); - connect(rattler, SIGNAL(setTrys(int)), this, SLOT(setTrys(int))); - connect(rattler, SIGNAL(rewind()), view->progress, SLOT(rewind())); - connect(rattler, SIGNAL(advance()), view->progress, SLOT(advance())); - connect(view->progress, SIGNAL(restart()), rattler, SLOT(restartTimer())); + connect(rattler, TQT_SIGNAL(setPoints(int)), this, TQT_SLOT(scoreChanged(int))); + connect(rattler, TQT_SIGNAL(setTrys(int)), this, TQT_SLOT(setTrys(int))); + connect(rattler, TQT_SIGNAL(rewind()), view->progress, TQT_SLOT(rewind())); + connect(rattler, TQT_SIGNAL(advance()), view->progress, TQT_SLOT(advance())); + connect(view->progress, TQT_SIGNAL(restart()), rattler, TQT_SLOT(restartTimer())); - connect(rattler, SIGNAL(togglePaused()), this, SLOT(togglePaused())); - connect(rattler, SIGNAL(setScore(int)), this, SLOT(gameEnd(int))); + connect(rattler, TQT_SIGNAL(togglePaused()), this, TQT_SLOT(togglePaused())); + connect(rattler, TQT_SIGNAL(setScore(int)), this, TQT_SLOT(gameEnd(int))); setCentralWidget(view); @@ -98,7 +98,7 @@ void Game::setTrys(int tries){ void Game::gameEnd(int score){ KScoreDialog di(KScoreDialog::Name | KScoreDialog::Score | KScoreDialog::Date, this); KScoreDialog::FieldInfo scoreInfo; - QString date = QDateTime::currentDateTime().toString(); + TQString date = TQDateTime::currentDateTime().toString(); scoreInfo.insert(KScoreDialog::Date, date); if (di.addScore(score, scoreInfo, true)) di.exec(); @@ -120,16 +120,16 @@ void Game::createMenu() actionCollection()->setAutoConnectShortcuts(true); rattler->setActionCollection(actionCollection()); - KStdGameAction::gameNew(rattler, SLOT(restart()), actionCollection()); - pause = KStdGameAction::pause(rattler, SLOT(pause()), actionCollection()); - KStdGameAction::highscores(this, SLOT(showHighScores()), actionCollection()); - KStdGameAction::quit( this, SLOT(close()), actionCollection()); + KStdGameAction::gameNew(rattler, TQT_SLOT(restart()), actionCollection()); + pause = KStdGameAction::pause(rattler, TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); + KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection()); - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); // TODO change and make custom function that pauses game or // modify widget to pause when loosing focus and remove this - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); } @@ -153,17 +153,17 @@ void Game::showSettings(){ Appearance *a = new Appearance(0, "Appearance"); - QStringList list; + TQStringList list; if (rattler->backgroundPixmaps.count() == 0) { list.append(i18n("none")); } else { - QStringList::ConstIterator it = rattler->backgroundPixmaps.begin(); + TQStringList::ConstIterator it = rattler->backgroundPixmaps.begin(); for(unsigned i = 0; it != rattler->backgroundPixmaps.end(); i++, it++) { // since the filename may contain underscore, they // are replaced with spaces in the menu entry - QString s = QFileInfo( *it ).baseName(); - s = s.replace(QRegExp("_"), " "); + TQString s = TQFileInfo( *it ).baseName(); + s = s.replace(TQRegExp("_"), " "); list.append(s); } } @@ -173,7 +173,7 @@ void Game::showSettings(){ dialog->addPage(a, i18n("Appearance"), "style"); dialog->addPage(new StartRoom(0, "StartRoom"), i18n("First Level"), "folder_home"); - connect(dialog, SIGNAL(settingsChanged()), rattler, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), rattler, TQT_SLOT(loadSettings())); dialog->show(); } |