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 /kenolaba/AbTop.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 'kenolaba/AbTop.cpp')
-rw-r--r-- | kenolaba/AbTop.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/kenolaba/AbTop.cpp b/kenolaba/AbTop.cpp index a2283f16..1820e591 100644 --- a/kenolaba/AbTop.cpp +++ b/kenolaba/AbTop.cpp @@ -1,8 +1,8 @@ /* Class AbTop */ -#include <qpopupmenu.h> -#include <qtimer.h> -#include <qclipboard.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> +#include <tqclipboard.h> #include <kaction.h> #include <kapplication.h> @@ -63,12 +63,12 @@ AbTop::AbTop() timer = new QTimer; - connect( timer, SIGNAL(timeout()), this, SLOT(timerDone()) ); + connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) ); board = new Board(); setMoveNo(0); - connect( board, SIGNAL(searchBreak()), this, SLOT(searchBreak()) ); + connect( board, TQT_SIGNAL(searchBreak()), this, TQT_SLOT(searchBreak()) ); Q_CHECK_PTR(board); boardWidget = new BoardWidget(*board,this); @@ -76,8 +76,8 @@ AbTop::AbTop() spy = new Spy(*board); #endif - connect( boardWidget, SIGNAL(updateSpy(QString)), - this, SLOT(updateSpy(QString)) ); + connect( boardWidget, TQT_SIGNAL(updateSpy(TQString)), + this, TQT_SLOT(updateSpy(TQString)) ); setCentralWidget(boardWidget); boardWidget->show(); @@ -88,17 +88,17 @@ AbTop::AbTop() setMinimumSize(200,300); // RMB context menu - connect( boardWidget, SIGNAL(rightButtonPressed(int,const QPoint&)), - this, SLOT(rightButtonPressed(int,const QPoint&)) ); + connect( boardWidget, TQT_SIGNAL(rightButtonPressed(int,const TQPoint&)), + this, TQT_SLOT(rightButtonPressed(int,const TQPoint&)) ); - connect( boardWidget, SIGNAL(edited(int)), - this, SLOT(edited(int)) ); + connect( boardWidget, TQT_SIGNAL(edited(int)), + this, TQT_SLOT(edited(int)) ); - connect( board, SIGNAL(updateBestMove(Move&,int)), - this, SLOT(updateBestMove(Move&,int)) ); + connect( board, TQT_SIGNAL(updateBestMove(Move&,int)), + this, TQT_SLOT(updateBestMove(Move&,int)) ); - connect( boardWidget, SIGNAL(moveChoosen(Move&)), - this, SLOT(moveChoosen(Move&)) ); + connect( boardWidget, TQT_SIGNAL(moveChoosen(Move&)), + this, TQT_SLOT(moveChoosen(Move&)) ); /* default */ setLevel(Easy); @@ -132,76 +132,76 @@ AbTop::~AbTop() void AbTop::setupActions() { - newAction = KStdGameAction::gameNew( this, SLOT(newGame()), actionCollection() ); - KStdGameAction::quit( this, SLOT(close()), actionCollection() ); + newAction = KStdGameAction::gameNew( this, TQT_SLOT(newGame()), actionCollection() ); + KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection() ); stopAction = new KAction( i18n("&Stop Search"), "stop", Key_S, this, - SLOT(stopSearch()), actionCollection(), "move_stop"); + TQT_SLOT(stopSearch()), actionCollection(), "move_stop"); backAction = new KAction( i18n("Take &Back"), "back", KStdAccel::shortcut(KStdAccel::Prior), this, - SLOT(back()), actionCollection(), "move_back"); + TQT_SLOT(back()), actionCollection(), "move_back"); forwardAction = new KAction( i18n("&Forward"), "forward", KStdAccel::shortcut(KStdAccel::Next), this, - SLOT(forward()), actionCollection(), "move_forward"); + TQT_SLOT(forward()), actionCollection(), "move_forward"); - hintAction = KStdGameAction::hint(this, SLOT(suggestion()), actionCollection()); + hintAction = KStdGameAction::hint(this, TQT_SLOT(suggestion()), actionCollection()); - KStdAction::copy( this, SLOT(copy()), actionCollection()); - pasteAction = KStdAction::paste( this, SLOT(paste()), actionCollection()); + KStdAction::copy( this, TQT_SLOT(copy()), actionCollection()); + pasteAction = KStdAction::paste( this, TQT_SLOT(paste()), actionCollection()); (void) new KAction( i18n("&Restore Position"), KStdAccel::shortcut(KStdAccel::Open), - this, SLOT(restorePosition()), + this, TQT_SLOT(restorePosition()), actionCollection(), "edit_restore" ); (void) new KAction( i18n("&Save Position"), KStdAccel::shortcut(KStdAccel::Save), - this, SLOT(savePosition()), + this, TQT_SLOT(savePosition()), actionCollection(), "edit_save" ); KToggleAction *ta; ta = new KToggleAction( i18n("&Network Play"), "network", Key_N, actionCollection(), "game_net"); - connect(ta, SIGNAL(toggled(bool)), this, SLOT(gameNetwork(bool))); + connect(ta, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(gameNetwork(bool))); editAction = new KToggleAction( i18n("&Modify"), "edit", CTRL+Key_Insert, actionCollection(), "edit_modify"); - connect(editAction, SIGNAL(toggled(bool)), this, SLOT( editModify(bool))); + connect(editAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT( editModify(bool))); - showMenubar = KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection()); - KStdAction::saveOptions( this, SLOT(writeConfig()), actionCollection()); + showMenubar = KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::saveOptions( this, TQT_SLOT(writeConfig()), actionCollection()); - KStdAction::preferences( this, SLOT(configure()), actionCollection()); + KStdAction::preferences( this, TQT_SLOT(configure()), actionCollection()); moveSlowAction = new KToggleAction( i18n("&Move Slow"), 0, actionCollection(), "options_moveSlow"); - connect(moveSlowAction, SIGNAL(toggled(bool)), this, SLOT(optionMoveSlow(bool))); + connect(moveSlowAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionMoveSlow(bool))); renderBallsAction = new KToggleAction( i18n("&Render Balls"), 0, actionCollection(), "options_renderBalls"); - connect(renderBallsAction, SIGNAL(toggled(bool)), this, SLOT(optionRenderBalls(bool))); + connect(renderBallsAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionRenderBalls(bool))); showSpyAction = new KToggleAction( i18n("&Spy"), 0, actionCollection(), "options_showSpy"); - connect(showSpyAction, SIGNAL(toggled(bool)), this, SLOT(optionShowSpy(bool))); + connect(showSpyAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionShowSpy(bool))); levelAction = KStdGameAction::chooseGameType(0, 0, actionCollection()); - QStringList list; + TQStringList list; for (uint i=0; i<Nb_Levels; i++) list.append( i18n(LEVEL[i].label) ); levelAction->setItems(list); - connect(levelAction, SIGNAL(activated(int)), SLOT(setLevel(int))); + connect(levelAction, TQT_SIGNAL(activated(int)), TQT_SLOT(setLevel(int))); iplayAction = new KSelectAction(i18n("&Computer Play"), 0, actionCollection(), "options_iplay"); list.clear(); for (uint i=0; i<Nb_IPlays; i++) list.append( i18n(IPLAY[i].label) ); iplayAction->setItems(list); - connect(iplayAction, SIGNAL(activated(int)), SLOT(setIPlay(int))); + connect(iplayAction, TQT_SIGNAL(activated(int)), TQT_SLOT(setIPlay(int))); } void AbTop::toggleMenubar() @@ -229,9 +229,9 @@ void AbTop::configure() } /* Right Mouse button pressed in BoardWidget area */ -void AbTop::rightButtonPressed(int /* field */, const QPoint& pos) +void AbTop::rightButtonPressed(int /* field */, const TQPoint& pos) { - QPopupMenu* rmbMenu = static_cast<QPopupMenu*> (factory()->container("rmbPopup",this)); + TQPopupMenu* rmbMenu = static_cast<TQPopupMenu*> (factory()->container("rmbPopup",this)); if (rmbMenu) rmbMenu->popup( pos ); } @@ -260,7 +260,7 @@ void AbTop::readConfig() void AbTop::readOptions(KConfig* config) { - QString entry = config->readEntry("Level"); + TQString entry = config->readEntry("Level"); for (uint i=0; i<Nb_Levels; i++) if ( entry==LEVEL[i].key ) setLevel(i); @@ -282,7 +282,7 @@ void AbTop::readOptions(KConfig* config) void AbTop::readProperties(KConfig *config) { - QString entry; + TQString entry; readOptions(config); @@ -361,7 +361,7 @@ void AbTop::restorePosition() { KConfig* config = kapp->config(); config->setGroup("SavedPosition"); - QString entry = config->readEntry("Position"); + TQString entry = config->readEntry("Position"); timerState = notStarted; timer->stop(); @@ -379,10 +379,10 @@ void AbTop::restorePosition() void AbTop::setupStatusBar() { - QString tmp; + TQString tmp; - QString t = i18n("Press %1 for a new game").arg( newAction->shortcut().toString()); - statusLabel = new QLabel( t, statusBar(), "statusLabel" ); + TQString t = i18n("Press %1 for a new game").arg( newAction->shortcut().toString()); + statusLabel = new TQLabel( t, statusBar(), "statusLabel" ); statusBar()->addWidget(statusLabel,1,false); // PERMANENT: Moving side + move No. @@ -390,7 +390,7 @@ void AbTop::setupStatusBar() // validPixmap, only visible in Modify mode: is position valid ? warningPix = BarIcon( "warning" ); okPix = BarIcon( "ok" ); - validLabel = new QLabel( "", statusBar(), "validLabel" ); + validLabel = new TQLabel( "", statusBar(), "validLabel" ); validLabel->setFixedSize( 18, statusLabel->sizeHint().height() ); validLabel->setAlignment( AlignCenter ); validLabel->hide(); @@ -399,20 +399,20 @@ void AbTop::setupStatusBar() redBall = BarIcon( "redball" ); yellowBall = BarIcon( "yellowball" ); noBall = BarIcon( "noball" ); - ballLabel = new QLabel( "", statusBar(), "ballLabel" ); + ballLabel = new TQLabel( "", statusBar(), "ballLabel" ); ballLabel->setPixmap(noBall); ballLabel->setFixedSize( 18, statusLabel->sizeHint().height() ); ballLabel->setAlignment( AlignCenter ); statusBar()->addWidget(ballLabel, 0, true); - moveLabel = new QLabel( i18n("Move %1").arg("--"), statusBar(), "moveLabel" ); + moveLabel = new TQLabel( i18n("Move %1").arg("--"), statusBar(), "moveLabel" ); statusBar()->addWidget(moveLabel, 0, true); #ifdef MYTRACE /* Create a toolbar menu for debugging output level */ KToolBar *tb = toolBar("mainToolBar"); if (tb) { - QPopupMenu* spyPopup = new QPopupMenu; + TQPopupMenu* spyPopup = new QPopupMenu; spy0 = BarIcon( "spy0" ); spy1 = BarIcon( "spy1" ); spy2 = BarIcon( "spy2" ); @@ -421,8 +421,8 @@ void AbTop::setupStatusBar() spyPopup->insertItem(spy1, 1); spyPopup->insertItem(spy2, 2); spyPopup->insertItem(spy3, 3); - connect( spyPopup, SIGNAL(activated(int)), - this, SLOT(setSpy(int)) ); + connect( spyPopup, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(setSpy(int)) ); tb->insertButton(spy0, 30, spyPopup, TRUE, i18n("Spy")); } @@ -432,7 +432,7 @@ void AbTop::setupStatusBar() -void AbTop::updateSpy(QString s) +void AbTop::updateSpy(TQString s) { if (showSpy) { if (s.isEmpty()) { @@ -450,7 +450,7 @@ void AbTop::updateBestMove(Move& m, int value) boardWidget->showMove(m,3); boardWidget->showMove(m,0,false); - QString tmp; + TQString tmp; tmp.sprintf("%s : %+d", (const char*) m.name().utf8(), value-actValue); updateSpy(tmp); kapp->processEvents(); @@ -460,7 +460,7 @@ void AbTop::updateBestMove(Move& m, int value) void AbTop::updateStatus() { - QString tmp; + TQString tmp; bool showValid = false; if (!editMode && timerState == noGame) { @@ -475,7 +475,7 @@ void AbTop::updateStatus() moveLabel->setText(tmp); if (editMode) { - tmp = QString("%1: %2 %3 - %4 %5") + tmp = TQString("%1: %2 %3 - %4 %5") .arg( i18n("Edit") ) .arg( i18n("Red") ).arg(boardWidget->getColor1Count()) .arg( i18n("Yellow") ).arg(boardWidget->getColor2Count()); @@ -494,7 +494,7 @@ void AbTop::updateStatus() showValid = true; } else { - tmp = QString("%1 - %2") + tmp = TQString("%1 - %2") .arg( (board->actColor() == Board::color1) ? i18n("Red"):i18n("Yellow") ) .arg( iPlayNow() ? @@ -733,7 +733,7 @@ void AbTop::newGame() /* Copy ASCII representation into Clipboard */ void AbTop::copy() { - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); cb->setText( board->getASCIIState( moveNo ).ascii() ); } @@ -741,7 +741,7 @@ void AbTop::paste() { if (!pastePossible) return; - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); pastePosition( cb->text().ascii() ); /* don't do this in pastePosition: RECURSION !! */ @@ -800,8 +800,8 @@ void AbTop::gameNetwork(bool on) h2[i]=0; net->addListener(h2, p); } - QObject::connect(net, SIGNAL(gotPosition(const char *)), - this, SLOT(pastePosition(const char *)) ); + TQObject::connect(net, TQT_SIGNAL(gotPosition(const char *)), + this, TQT_SLOT(pastePosition(const char *)) ); } |