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 --- knetwalk/src/mainwindow.cpp | 82 ++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'knetwalk/src/mainwindow.cpp') diff --git a/knetwalk/src/mainwindow.cpp b/knetwalk/src/mainwindow.cpp index 15e615ed..17fa9b82 100644 --- a/knetwalk/src/mainwindow.cpp +++ b/knetwalk/src/mainwindow.cpp @@ -12,20 +12,20 @@ * GNU General Public License for more details. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -50,9 +50,9 @@ #include "cell.h" #include "mainwindow.h" -static QMap contrdirs; +static TQMap contrdirs; -MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : +MainWindow::MainWindow(TQWidget *parent, const char* name, WFlags /*fl*/) : KMainWindow(parent, name, WStyle_NoBorder) { m_clickcount = 0; @@ -64,14 +64,14 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : KNotifyClient::startDaemon(); - KStdGameAction::gameNew(this, SLOT(slotNewGame()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection()); - KStdGameAction::highscores(this, SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(this, SLOT(close()), actionCollection()); - KStdGameAction::configureHighscores(this, SLOT(configureHighscores()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()), actionCollection()); m_levels = KStdGameAction::chooseGameType(0, 0, actionCollection()); - QStringList lst; + TQStringList lst; lst += i18n("Novice"); lst += i18n("Normal"); lst += i18n("Expert"); @@ -83,10 +83,10 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : statusBar()->insertItem("abcdefghijklmnopqrst: 0 ",1); setAutoSaveSettings(); createGUI(); - connect(m_levels, SIGNAL(activated(int)), this, SLOT(newGame(int))); + connect(m_levels, TQT_SIGNAL(activated(int)), this, TQT_SLOT(newGame(int))); - QWhatsThis::add(this, i18n("

Rules of the Game

" + TQWhatsThis::add(this, i18n("

Rules of the Game

" "

You are the system administrator and your goal" " is to connect each computer to the central server." "

Click the right mouse button to turn the cable" @@ -98,8 +98,8 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : const int cellsize = 32; const int gridsize = cellsize * MasterBoardSize + 2; - QGrid* grid = new QGrid(MasterBoardSize, this); - grid->setFrameStyle(QFrame::Panel | QFrame::Sunken); + TQGrid* grid = new TQGrid(MasterBoardSize, this); + grid->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); grid->setFixedSize(gridsize, gridsize); setCentralWidget(grid); @@ -108,9 +108,9 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags /*fl*/) : { board[i] = new Cell(grid, i); board[i]->setFixedSize(cellsize, cellsize); - connect(board[i], SIGNAL(lClicked(int)), SLOT(lClicked(int))); - connect(board[i], SIGNAL(rClicked(int)), SLOT(rClicked(int))); - connect(board[i], SIGNAL(mClicked(int)), SLOT(mClicked(int))); + connect(board[i], TQT_SIGNAL(lClicked(int)), TQT_SLOT(lClicked(int))); + connect(board[i], TQT_SIGNAL(rClicked(int)), TQT_SLOT(rClicked(int))); + connect(board[i], TQT_SIGNAL(mClicked(int)), TQT_SLOT(mClicked(int))); } srand(time(0)); @@ -148,8 +148,8 @@ void MainWindow::newGame(int sk) Settings::writeConfig(); m_clickcount = 0; - QString clicks = i18n("Click: %1"); - statusBar()->changeItem(clicks.arg(QString::number(m_clickcount)),1); + TQString clicks = i18n("Click: %1"); + statusBar()->changeItem(clicks.arg(TQString::number(m_clickcount)),1); KNotifyClient::event(winId(), "startsound", i18n("New Game")); for(int i = 0; i < MasterBoardSize * MasterBoardSize; i++) @@ -276,7 +276,7 @@ void MainWindow::addRandomDir(CellList& list) Cell* dcell = dCell(cell); Cell* lcell = lCell(cell); - typedef QMap CellMap; + typedef TQMap CellMap; CellMap freecells; if(ucell && ucell->dirs() == Cell::Free) freecells[Cell::U] = ucell; @@ -359,9 +359,9 @@ void MainWindow::rotate(int index, bool toleft) updateConnections(); for(int i = 0; i < 14; i++) { - kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput); - QTimer::singleShot(20, board[index], SLOT(update())); - kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::WaitForMore); + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput); + TQTimer::singleShot(20, board[index], TQT_SLOT(update())); + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::WaitForMore); board[index]->rotate(toleft ? -6 : 6); } @@ -369,8 +369,8 @@ void MainWindow::rotate(int index, bool toleft) KNotifyClient::event(winId(), "connectsound"); m_clickcount++; - QString clicks = i18n("Click: %1"); - statusBar()->changeItem(clicks.arg(QString::number(m_clickcount)),1); + TQString clicks = i18n("Click: %1"); + statusBar()->changeItem(clicks.arg(TQString::number(m_clickcount)),1); if (isGameOver()) { @@ -388,10 +388,10 @@ void MainWindow::blink(int index) { for(int i = 0; i < board[index]->width() * 2; i += 2) { - kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput); - QTimer::singleShot(20, board[index], SLOT(update())); - kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput | - QEventLoop::WaitForMore); + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput); + TQTimer::singleShot(20, board[index], TQT_SLOT(update())); + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput | + TQEventLoop::WaitForMore); board[index]->setLight(i); } board[index]->setLight(0); @@ -408,7 +408,7 @@ bool MainWindow::isGameOver() return true; } -void MainWindow::closeEvent(QCloseEvent* event) +void MainWindow::closeEvent(TQCloseEvent* event) { event->accept(); } -- cgit v1.2.1