summaryrefslogtreecommitdiffstats
path: root/knetwalk/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'knetwalk/src/mainwindow.cpp')
-rw-r--r--knetwalk/src/mainwindow.cpp82
1 files changed, 41 insertions, 41 deletions
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 <qaction.h>
-#include <qapplication.h>
-#include <qeventloop.h>
-#include <qgrid.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qprocess.h>
-#include <qpushbutton.h>
-#include <qsettings.h>
-#include <qsound.h>
-#include <qtimer.h>
-#include <qtoolbutton.h>
-#include <qwhatsthis.h>
+#include <tqaction.h>
+#include <tqapplication.h>
+#include <tqeventloop.h>
+#include <tqgrid.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqprocess.h>
+#include <tqpushbutton.h>
+#include <tqsettings.h>
+#include <tqsound.h>
+#include <tqtimer.h>
+#include <tqtoolbutton.h>
+#include <tqwhatsthis.h>
#include <stdio.h>
#include <stdlib.h>
@@ -50,9 +50,9 @@
#include "cell.h"
#include "mainwindow.h"
-static QMap<Cell::Dirs, Cell::Dirs> contrdirs;
+static TQMap<Cell::Dirs, Cell::Dirs> 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("<h3>Rules of the Game</h3>"
+ TQWhatsThis::add(this, i18n("<h3>Rules of the Game</h3>"
"<p>You are the system administrator and your goal"
" is to connect each computer to the central server."
"<p>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<Cell::Dirs, Cell*> CellMap;
+ typedef TQMap<Cell::Dirs, Cell*> 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();
}