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 --- kbackgammon/engines/fibs/kbgfibs.cpp | 542 ++++++++++++++--------------- kbackgammon/engines/fibs/kbgfibs.h | 86 ++--- kbackgammon/engines/fibs/kbgfibschat.cpp | 246 ++++++------- kbackgammon/engines/fibs/kbgfibschat.h | 26 +- kbackgammon/engines/fibs/kbginvite.cpp | 60 ++-- kbackgammon/engines/fibs/kbginvite.h | 4 +- kbackgammon/engines/fibs/kplayerlist.cpp | 154 ++++---- kbackgammon/engines/fibs/kplayerlist.h | 24 +- kbackgammon/engines/generic/kbgengine.cpp | 12 +- kbackgammon/engines/generic/kbgengine.h | 16 +- kbackgammon/engines/gnubg/kbggnubg.cpp | 84 ++--- kbackgammon/engines/gnubg/kbggnubg.h | 26 +- kbackgammon/engines/nextgen/kbggame.cpp | 4 +- kbackgammon/engines/nextgen/kbggame.h | 4 +- kbackgammon/engines/nextgen/kbgng.cpp | 78 ++--- kbackgammon/engines/nextgen/kbgng.h | 20 +- kbackgammon/engines/nextgen/kbgplayer.cpp | 4 +- kbackgammon/engines/nextgen/kbgplayer.h | 6 +- kbackgammon/engines/offline/kbgoffline.cpp | 84 ++--- kbackgammon/engines/offline/kbgoffline.h | 6 +- 20 files changed, 743 insertions(+), 743 deletions(-) (limited to 'kbackgammon/engines') diff --git a/kbackgammon/engines/fibs/kbgfibs.cpp b/kbackgammon/engines/fibs/kbgfibs.cpp index 06fdaec7..4e7fd2f4 100644 --- a/kbackgammon/engines/fibs/kbgfibs.cpp +++ b/kbackgammon/engines/fibs/kbgfibs.cpp @@ -37,27 +37,27 @@ #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 +#include #include #include #include -#include +#include #include #include @@ -207,7 +207,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Main Widget */ - QVBox *vbp = nb->addVBoxPage(i18n("FIBS Engine"), i18n("Here you can configure the FIBS backgammon engine"), + TQVBox *vbp = nb->addVBoxPage(i18n("FIBS Engine"), i18n("Here you can configure the FIBS backgammon engine"), kapp->iconLoader()->loadIcon(PROG_NAME "_engine", KIcon::Desktop)); /* @@ -218,14 +218,14 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * FIBS, local options */ - QWidget *w = new QWidget(tc); - QGridLayout *gl = new QGridLayout(w, 3, 1, nb->spacingHint()); + TQWidget *w = new TQWidget(tc); + TQGridLayout *gl = new TQGridLayout(w, 3, 1, nb->spacingHint()); /* * Group boxes */ - QGroupBox *gbo = new QGroupBox(i18n("Options"), w); - QGroupBox *gbm = new QGroupBox(i18n("Automatic Messages"), w); + TQGroupBox *gbo = new TQGroupBox(i18n("Options"), w); + TQGroupBox *gbm = new TQGroupBox(i18n("Automatic Messages"), w); gl->addWidget(gbo, 0, 0); gl->addWidget(gbm, 1, 0); @@ -233,50 +233,50 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Options */ - cbp = new QCheckBox(i18n("Show copy of personal messages in main window"), gbo); - cbi = new QCheckBox(i18n("Automatically request player info on invitation"), gbo); + cbp = new TQCheckBox(i18n("Show copy of personal messages in main window"), gbo); + cbi = new TQCheckBox(i18n("Automatically request player info on invitation"), gbo); - QWhatsThis::add(cbp, i18n("Usually, all messages sent directly to you by other players " + TQWhatsThis::add(cbp, i18n("Usually, all messages sent directly to you by other players " "are displayed only in the chat window. Check this box if you " "would like to get a copy of these messages in the main window.")); - QWhatsThis::add(cbi, i18n("Check this box if you would like to receive information on " + TQWhatsThis::add(cbi, i18n("Check this box if you would like to receive information on " "players that invite you to games.")); cbp->setChecked(showMsg); cbi->setChecked(whoisInvite); - gl = new QGridLayout(gbo, 2, 1, 20); + gl = new TQGridLayout(gbo, 2, 1, 20); gl->addWidget(cbp, 0, 0); gl->addWidget(cbi, 1, 0); /* * Automatic messages */ - gl = new QGridLayout(gbm, NumMsg, 2, 20); + gl = new TQGridLayout(gbm, NumMsg, 2, 20); - cbm[MsgBeg] = new QCheckBox(i18n("Start match:"), gbm); - cbm[MsgWin] = new QCheckBox(i18n("Win match:"), gbm); - cbm[MsgLos] = new QCheckBox(i18n("Lose match:"), gbm); + cbm[MsgBeg] = new TQCheckBox(i18n("Start match:"), gbm); + cbm[MsgWin] = new TQCheckBox(i18n("Win match:"), gbm); + cbm[MsgLos] = new TQCheckBox(i18n("Lose match:"), gbm); - QWhatsThis::add(cbm[MsgBeg], i18n("If you want to send a standard greeting to your " + TQWhatsThis::add(cbm[MsgBeg], i18n("If you want to send a standard greeting to your " "opponent whenever you start a new match, check " "this box and write the message into the entry " "field.")); - QWhatsThis::add(cbm[MsgWin], i18n("If you want to send a standard message to your " + TQWhatsThis::add(cbm[MsgWin], i18n("If you want to send a standard message to your " "opponent whenever you won a match, check this box " "and write the message into the entry field.")); - QWhatsThis::add(cbm[MsgLos], i18n("If you want to send a standard message to your " + TQWhatsThis::add(cbm[MsgLos], i18n("If you want to send a standard message to your " "opponent whenever you lost a match, check this box " "and write the message into the entry field.")); for (int i = 0; i < NumMsg; i++) { - lem[i] = new QLineEdit(autoMsg[i], gbm); + lem[i] = new TQLineEdit(autoMsg[i], gbm); gl->addWidget(cbm[i], i, 0); gl->addWidget(lem[i], i, 1); - connect(cbm[i], SIGNAL(toggled(bool)), lem[i], SLOT(setEnabled(bool))); + connect(cbm[i], TQT_SIGNAL(toggled(bool)), lem[i], TQT_SLOT(setEnabled(bool))); cbm[i]->setChecked(useAutoMsg[i]); lem[i]->setEnabled(useAutoMsg[i]); - QWhatsThis::add(lem[i], QWhatsThis::textFor(cbm[i])); + TQWhatsThis::add(lem[i], TQWhatsThis::textFor(cbm[i])); } /* @@ -289,11 +289,11 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * FIBS, connection setup */ - w = new QWidget(tc); - gl = new QGridLayout(w, 3, 1, nb->spacingHint()); + w = new TQWidget(tc); + gl = new TQGridLayout(w, 3, 1, nb->spacingHint()); - QGroupBox *gbc = new QGroupBox(i18n("Server"), w); - QGroupBox *gbk = new QGroupBox(i18n("Other"), w); + TQGroupBox *gbc = new TQGroupBox(i18n("Server"), w); + TQGroupBox *gbk = new TQGroupBox(i18n("Other"), w); gl->addWidget(gbc, 0, 0); gl->addWidget(gbk, 1, 0); @@ -301,35 +301,35 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Server box */ - gl = new QGridLayout(gbc, 4, 2, 20); + gl = new TQGridLayout(gbc, 4, 2, 20); - QLabel *lbc[NumFIBS]; + TQLabel *lbc[NumFIBS]; - lbc[FIBSHost] = new QLabel(i18n("Server name:"), gbc); - lbc[FIBSPort] = new QLabel(i18n("Server port:"), gbc); - lbc[FIBSUser] = new QLabel(i18n("User name:"), gbc); - lbc[FIBSPswd] = new QLabel(i18n("Password:"), gbc); + lbc[FIBSHost] = new TQLabel(i18n("Server name:"), gbc); + lbc[FIBSPort] = new TQLabel(i18n("Server port:"), gbc); + lbc[FIBSUser] = new TQLabel(i18n("User name:"), gbc); + lbc[FIBSPswd] = new TQLabel(i18n("Password:"), gbc); for (int i = 0; i < NumFIBS; i++) { - lec[i] = new QLineEdit(infoFIBS[i], gbc); + lec[i] = new TQLineEdit(infoFIBS[i], gbc); gl->addWidget(lbc[i], i, 0); gl->addWidget(lec[i], i, 1); } - lec[FIBSPswd]->setEchoMode(QLineEdit::Password); + lec[FIBSPswd]->setEchoMode(TQLineEdit::Password); - QWhatsThis::add(lec[FIBSHost], i18n("Enter here the host name of FIBS. With almost " + TQWhatsThis::add(lec[FIBSHost], i18n("Enter here the host name of FIBS. With almost " "absolute certainty this should be \"fibs.com\". " "If you leave this blank, you will be asked again " "at connection time.")); - QWhatsThis::add(lec[FIBSPort], i18n("Enter here the port number of FIBS. With almost " + TQWhatsThis::add(lec[FIBSPort], i18n("Enter here the port number of FIBS. With almost " "absolute certainty this should be \"4321\". " "If you leave this blank, you will be asked again " "at connection time.")); - QWhatsThis::add(lec[FIBSUser], i18n("Enter your login on FIBS here. If you do not have a " + TQWhatsThis::add(lec[FIBSUser], i18n("Enter your login on FIBS here. If you do not have a " "login yet, you should first create an account using " "the corresponding menu entry. If you leave this blank, " "you will be asked again at connection time.")); - QWhatsThis::add(lec[FIBSPswd], i18n("Enter your password on FIBS here. If you do not have a " + TQWhatsThis::add(lec[FIBSPswd], i18n("Enter your password on FIBS here. If you do not have a " "login yet, you should first create an account using " "the corresponding menu entry. If you leave this blank, " "you will be asked again at connection time. The password " @@ -338,16 +338,16 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Connection keepalive */ - cbk = new QCheckBox(i18n("Keep connections alive"), gbk); + cbk = new TQCheckBox(i18n("Keep connections alive"), gbk); - QWhatsThis::add(cbk, i18n("Usually, FIBS drops the connection after one hour of inactivity. When " + TQWhatsThis::add(cbk, i18n("Usually, FIBS drops the connection after one hour of inactivity. When " "you check this box, %1 will try to keep the connection alive, even " "if you are not actually playing or chatting. Use this with caution " "if you do not have flat-rate Internet access.").arg(PROG_NAME)); cbk->setChecked(keepalive); - gl = new QGridLayout(gbk, 1, 1, nb->spacingHint()); + gl = new TQGridLayout(gbk, 1, 1, nb->spacingHint()); gl->addWidget(cbk, 0, 0); /* @@ -365,7 +365,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * TODO: future extensions */ - w = new QWidget(tc); + w = new TQWidget(tc); tc->addTab(w, i18n("&Buddy List")); } @@ -375,9 +375,9 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) /* * Remove a player from the invitation list in the join menu */ -void KBgEngineFIBS::cancelJoin(const QString &info) +void KBgEngineFIBS::cancelJoin(const TQString &info) { - QRegExp patt = QRegExp("^" + info + " "); + TQRegExp patt = TQRegExp("^" + info + " "); for (int i = 0; i <= numJoin; i++) { if (actJoin[i]->text().contains(patt)) { @@ -394,7 +394,7 @@ void KBgEngineFIBS::cancelJoin(const QString &info) * Parse the information in info for the purposes of the invitation * submenu */ -void KBgEngineFIBS::changeJoin(const QString &info) +void KBgEngineFIBS::changeJoin(const TQString &info) { char name_p[100], name_o[100]; float rate; @@ -407,13 +407,13 @@ void KBgEngineFIBS::changeJoin(const QString &info) sscanf(info.latin1(), "%99s %99s %*s %*s %*s %f %i %*s %*s %*s %*s %*s", name_p, name_o, &rate, &expi); - QString name = name_p; - QString oppo = name_o; + TQString name = name_p; + TQString oppo = name_o; - QString rate_s; rate_s.setNum(rate); - QString expi_s; expi_s.setNum(expi); + TQString rate_s; rate_s.setNum(rate); + TQString expi_s; expi_s.setNum(expi); - QRegExp patt = QRegExp("^" + name + " "); + TQRegExp patt = TQRegExp("^" + name + " "); /* * We have essentially two lists of names to check against: the ones @@ -424,20 +424,20 @@ void KBgEngineFIBS::changeJoin(const QString &info) if (numJoin > -1 && oppo != "-") cancelJoin(name); - for (QStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) { + for (TQStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) { if ((*it).contains(patt)) { - QString text, menu; + TQString text, menu; - if ((*it).contains(QRegExp(" r$"))) { + if ((*it).contains(TQRegExp(" r$"))) { menu = i18n("R means resume", "%1 (R)").arg(name); text = i18n("%1 (experience %2, rating %3) wants to resume a saved match with you. " "If you want to play, use the corresponding menu entry to join (or type " "'join %4').").arg(name).arg(expi_s).arg(rate_s).arg(name); KNotifyClient::event("invitation", i18n("%1 wants to resume a saved match with you"). arg(name)); - } else if ((*it).contains(QRegExp(" u$"))) { + } else if ((*it).contains(TQRegExp(" u$"))) { menu = i18n("U means unlimited", "%1 (U)").arg(name); text = i18n("%1 (experience %2, rating %3) wants to play an unlimited match with you. " "If you want to play, use the corresponding menu entry to join (or type " @@ -445,7 +445,7 @@ void KBgEngineFIBS::changeJoin(const QString &info) KNotifyClient::event("invitation", i18n("%1 has invited you to an unlimited match"). arg(name)); } else { - QString len = (*it).right((*it).length() - name.length() - 1); + TQString len = (*it).right((*it).length() - name.length() - 1); menu = i18n("If the format of the (U) and (R) strings is changed, it should also be changed here", "%1 (%2)").arg(name).arg(len); text = i18n("%1 (experience %2, rating %3) wants to play a %4 point match with you. " @@ -539,10 +539,10 @@ void KBgEngineFIBS::showChat() /* * Process the last move coming from the board */ -void KBgEngineFIBS::handleMove(QString *s) +void KBgEngineFIBS::handleMove(TQString *s) { lastMove = *s; - QString t = lastMove.left(1); + TQString t = lastMove.left(1); int moves = t.toInt(); emit allowCommand(Done, moves == toMove); @@ -629,7 +629,7 @@ void KBgEngineFIBS::rollDice(const int w) /* * This engine passes all commands unmodified to the server */ -void KBgEngineFIBS::handleCommand(QString const &cmd) +void KBgEngineFIBS::handleCommand(TQString const &cmd) { emit serverString(cmd); } @@ -639,10 +639,10 @@ void KBgEngineFIBS::handleCommand(QString const &cmd) */ bool KBgEngineFIBS::queryClose() { - if (connection->state() == QSocket::Idle) + if (connection->state() == TQSocket::Idle) return true; - switch (KMessageBox::warningYesNoCancel((QWidget *)parent(),i18n("Still connected. Log out first?"),QString::null,i18n("Log Out"), i18n("Stay Connected"))) { + switch (KMessageBox::warningYesNoCancel((TQWidget *)parent(),i18n("Still connected. Log out first?"),TQString::null,i18n("Log Out"), i18n("Stay Connected"))) { case KMessageBox::Yes : disconnectFIBS(); return true; @@ -660,7 +660,7 @@ bool KBgEngineFIBS::queryExit() { if( kapp->sessionSaving()) return true; - if (connection->state() != QSocket::Idle) + if (connection->state() != TQSocket::Idle) disconnectFIBS(); return true; } @@ -669,7 +669,7 @@ bool KBgEngineFIBS::queryExit() * This displays a copy of personal messages in the main window. * Normally, these only get displayed in the chat window. */ -void KBgEngineFIBS::personalMessage(const QString &msg) +void KBgEngineFIBS::personalMessage(const TQString &msg) { if (showMsg) emit infoText(msg); @@ -729,9 +729,9 @@ void KBgEngineFIBS::match_leave() void KBgEngineFIBS::away() { bool ret; - QString msg = KLineEditDlg::getText(i18n("Please type the message that should be displayed to other\n" + TQString msg = KLineEditDlg::getText(i18n("Please type the message that should be displayed to other\n" "users while you are away."), - lastAway, &ret, (QWidget *)parent()); + lastAway, &ret, (TQWidget *)parent()); if (ret) { lastAway = msg; emit serverString("away " + msg); @@ -807,7 +807,7 @@ void KBgEngineFIBS::load() * Handle the menu short cuts for joining. This is not as pretty as it * could or should be, but it works and is easy to understand. */ -void KBgEngineFIBS::join(const QString &msg) +void KBgEngineFIBS::join(const TQString &msg) { emit serverString("join " + msg.left(msg.find('('))); } @@ -834,13 +834,13 @@ void KBgEngineFIBS::inviteDialog() /* * Show the invitation dialog and set the name to player */ -void KBgEngineFIBS::fibsRequestInvitation(const QString &player) +void KBgEngineFIBS::fibsRequestInvitation(const TQString &player) { if (!invitationDlg) { - QString p = player; + TQString p = player; invitationDlg = new KBgInvite("invite"); - connect(invitationDlg, SIGNAL(inviteCommand(const QString &)), this, SLOT(handleCommand(const QString &))); - connect(invitationDlg, SIGNAL(dialogDone()), this, SLOT(invitationDone())); + connect(invitationDlg, TQT_SIGNAL(inviteCommand(const TQString &)), this, TQT_SLOT(handleCommand(const TQString &))); + connect(invitationDlg, TQT_SIGNAL(dialogDone()), this, TQT_SLOT(invitationDone())); } invitationDlg->setPlayer(player); invitationDlg->show(); @@ -897,13 +897,13 @@ void KBgEngineFIBS::hostFound() void KBgEngineFIBS::connError(int f) { switch (f) { - case QSocket::ErrConnectionRefused: + case TQSocket::ErrConnectionRefused: emit infoText(i18n("Error, connection has been refused")); break; - case QSocket::ErrHostNotFound: + case TQSocket::ErrHostNotFound: emit infoText(i18n("Error, nonexistent host or name server down.")); break; - case QSocket::ErrSocketRead: + case TQSocket::ErrSocketRead: emit infoText(i18n("Error, reading data from socket")); break; } @@ -913,7 +913,7 @@ void KBgEngineFIBS::connError(int f) void KBgEngineFIBS::readData() { - QString line; + TQString line; while(connection->canReadLine()) { line = connection->readLine(); if (line.length() > 2) { @@ -926,7 +926,7 @@ void KBgEngineFIBS::readData() /* * Transmit the string s to the server */ -void KBgEngineFIBS::sendData(const QString &s) +void KBgEngineFIBS::sendData(const TQString &s) { connection->writeBlock((s+"\r\n").latin1(),2+s.length()); } @@ -964,9 +964,9 @@ void KBgEngineFIBS::connected() /* * Login, using the autologin feature of FIBS, before we even receive anything. */ - QString entry; + TQString entry; entry.setNum(CLIP_VERSION); - emit serverString(QString("login ") + PROG_NAME + "-" + PROG_VERSION + " " + entry + " " + emit serverString(TQString("login ") + PROG_NAME + "-" + PROG_VERSION + " " + entry + " " + infoFIBS[FIBSUser] + " " + infoFIBS[FIBSPswd]); } else { @@ -1042,7 +1042,7 @@ void KBgEngineFIBS::connectionClosed() */ bool KBgEngineFIBS::queryConnection(const bool newlogin) { - QString text, msg; + TQString text, msg; bool first, ret = true; /* @@ -1052,7 +1052,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) msg = KLineEditDlg::getText(i18n("Enter the name of the server you want to connect to.\n" "This should almost always be \"fibs.com\"."), - infoFIBS[FIBSHost], &ret, (QWidget *)parent()); + infoFIBS[FIBSHost], &ret, (TQWidget *)parent()); if (ret) infoFIBS[FIBSHost] = msg; @@ -1064,7 +1064,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) msg = KLineEditDlg::getText(i18n("Enter the port number on the server. " "It should almost always be \"4321\"."), - infoFIBS[FIBSPort], &ret, (QWidget *)parent()); + infoFIBS[FIBSPort], &ret, (TQWidget *)parent()); if (ret) infoFIBS[FIBSPort] = msg; @@ -1088,7 +1088,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) first = true; do { msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, - (QWidget *)parent())).stripWhiteSpace(); + (TQWidget *)parent())).stripWhiteSpace(); if (first) { text += i18n("The login may not contain spaces or colons!"); first = false; @@ -1116,7 +1116,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) first = true; do { - QCString password; + TQCString password; if (newlogin) ret = (KPasswordDialog::getNewPassword(password, text) == KPasswordDialog::Accepted); else @@ -1152,91 +1152,91 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) */ void KBgEngineFIBS::initPattern() { - QString pattern; + TQString pattern; /* * Initialize the search pattern array */ - pat[Welcome] = QRegExp(pattern.sprintf("^%d ", CLIP_WELCOME)); - pat[OwnInfo] = QRegExp(pattern.sprintf("^%d ", CLIP_OWN_INFO)); - pat[WhoInfo] = QRegExp(pattern.sprintf("^%d ", CLIP_WHO_INFO)); - pat[WhoEnde] = QRegExp(pattern.sprintf("^%d$", CLIP_WHO_END)); - pat[MotdBeg] = QRegExp(pattern.sprintf("^%d" , CLIP_MOTD_BEGIN)); - pat[MotdEnd] = QRegExp(pattern.sprintf("^%d" , CLIP_MOTD_END)); - pat[MsgPers] = QRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE)); - pat[MsgDeli] = QRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE_DELIVERED)); - pat[MsgSave] = QRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE_SAVED)); - pat[ChatSay] = QRegExp(pattern.sprintf("^%d ", CLIP_SAYS)); - pat[ChatSht] = QRegExp(pattern.sprintf("^%d ", CLIP_SHOUTS)); - pat[ChatWis] = QRegExp(pattern.sprintf("^%d ", CLIP_WHISPERS)); - pat[ChatKib] = QRegExp(pattern.sprintf("^%d ", CLIP_KIBITZES)); - pat[SelfSay] = QRegExp(pattern.sprintf("^%d ", CLIP_YOU_SAY)); - pat[SelfSht] = QRegExp(pattern.sprintf("^%d ", CLIP_YOU_SHOUT)); - pat[SelfWis] = QRegExp(pattern.sprintf("^%d ", CLIP_YOU_WHISPER)); - pat[SelfKib] = QRegExp(pattern.sprintf("^%d ", CLIP_YOU_KIBITZ)); - pat[UserLin] = QRegExp(pattern.sprintf("^%d ", CLIP_LOGIN)); - pat[UserLot] = QRegExp(pattern.sprintf("^%d ", CLIP_LOGOUT)); - - pat[NoLogin] = QRegExp("\\*\\* Unknown command: 'login'"); - pat[BegRate] = QRegExp("^rating calculation:$"); - pat[EndRate] = QRegExp("^change for "); - pat[HTML_lt] = QRegExp("<"); - pat[HTML_gt] = QRegExp(">"); - pat[BoardSY] = QRegExp("^Value of 'boardstyle' set to 3"); - pat[BoardSN] = QRegExp("^Value of 'boardstyle' set to [^3]"); - pat[WhoisBG] = QRegExp("^Information about "); - pat[WhoisE1] = QRegExp("^ No email address\\.$"); - pat[WhoisE2] = QRegExp("^ Email address: "); - pat[SelfSlf] = QRegExp("^You say to yourself:"); - pat[Goodbye] = QRegExp("^ Goodbye\\."); - pat[GameSav] = QRegExp("The game was saved\\.$"); - pat[RawBord] = QRegExp("^board:"); - pat[YouTurn] = QRegExp("^It's your turn\\. Please roll or double"); - pat[PlsMove] = QRegExp("^Please move [1-6]+ pie"); - pat[EndWtch] = QRegExp("^You stop watching "); - pat[BegWtch] = QRegExp("^You're now watching "); - pat[BegGame] = QRegExp("^Starting a new game with "); - pat[Reload1] = QRegExp("^You are now playing with "); - pat[Reload2] = QRegExp(" has joined you. Your running match was loaded\\.$"); - pat[OneWave] = QRegExp(" waves goodbye.$"); - pat[TwoWave] = QRegExp(" waves goodbye again.$"); - pat[YouWave] = QRegExp("^You wave goodbye.$"); - pat[GameBG1] = QRegExp("start a [0-9]+ point match"); - pat[GameBG2] = QRegExp("start an unlimited match"); - pat[GameRE1] = QRegExp("are resuming their [0-9]+-point match"); - pat[GameRE2] = QRegExp("are resuming their unlimited match"); - pat[GameEnd] = QRegExp("point match against"); - pat[TabChar] = QRegExp("\\t"); - pat[PlsChar] = QRegExp("\\+"); - pat[Invite0] = QRegExp(" wants to play a [0-9]+ point match with you\\.$"); - pat[Invite1] = QRegExp("^.+ wants to play a "); - pat[Invite2] = QRegExp(" wants to resume a saved match with you\\.$"); - pat[Invite3] = QRegExp(" wants to play an unlimited match with you\\.$"); - pat[TypJoin] = QRegExp("^Type 'join "); - pat[OneName] = QRegExp("^ONE USERNAME PER PERSON ONLY!!!"); - pat[YouAway] = QRegExp("^You're away. Please type 'back'"); - pat[YouBack] = QRegExp("^Welcome back\\.$"); - pat[YouMove] = QRegExp("^It's your turn to move\\."); - pat[YouRoll] = QRegExp("^It's your turn to roll or double\\."); - pat[TwoStar] = QRegExp("^\\*\\* "); - pat[OthrNam] = QRegExp("^\\*\\* Please use another name\\. "); - pat[BoxHori] = QRegExp("^ *\\+-*\\+ *$"); - pat[BoxVer1] = QRegExp("^ *\\|"); - pat[BoxVer2] = QRegExp("\\| *$"); - pat[YourNam] = QRegExp("Your name will be "); - pat[GivePwd] = QRegExp("Please give your password:"); - pat[RetypeP] = QRegExp("Please retype your password:"); - pat[HelpTxt] = QRegExp("^NAME$"); - pat[MatchB1] = QRegExp(" has joined you for a [0-9]+ point match\\.$"); - pat[MatchB2] = QRegExp(" has joined you for an unlimited match\\.$"); - pat[EndLose] = QRegExp(" wins the [0-9]+ point match [0-9]+-[0-9]+"); - pat[EndVict] = QRegExp(" win the [0-9]+ point match [0-9]+-[0-9]+"); - pat[RejAcpt] = QRegExp("Type 'accept' or 'reject'\\.$"); - pat[YouAcpt] = QRegExp("^You accept the double\\. The cube shows [0-9]+\\."); - - pat[KeepAlv] = QRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"); - pat[RatingY] = QRegExp("You'll see how the rating changes are calculated\\.$"); - pat[RatingN] = QRegExp("You won't see how the rating changes are calculated\\.$"); + pat[Welcome] = TQRegExp(pattern.sprintf("^%d ", CLIP_WELCOME)); + pat[OwnInfo] = TQRegExp(pattern.sprintf("^%d ", CLIP_OWN_INFO)); + pat[WhoInfo] = TQRegExp(pattern.sprintf("^%d ", CLIP_WHO_INFO)); + pat[WhoEnde] = TQRegExp(pattern.sprintf("^%d$", CLIP_WHO_END)); + pat[MotdBeg] = TQRegExp(pattern.sprintf("^%d" , CLIP_MOTD_BEGIN)); + pat[MotdEnd] = TQRegExp(pattern.sprintf("^%d" , CLIP_MOTD_END)); + pat[MsgPers] = TQRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE)); + pat[MsgDeli] = TQRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE_DELIVERED)); + pat[MsgSave] = TQRegExp(pattern.sprintf("^%d ", CLIP_MESSAGE_SAVED)); + pat[ChatSay] = TQRegExp(pattern.sprintf("^%d ", CLIP_SAYS)); + pat[ChatSht] = TQRegExp(pattern.sprintf("^%d ", CLIP_SHOUTS)); + pat[ChatWis] = TQRegExp(pattern.sprintf("^%d ", CLIP_WHISPERS)); + pat[ChatKib] = TQRegExp(pattern.sprintf("^%d ", CLIP_KIBITZES)); + pat[SelfSay] = TQRegExp(pattern.sprintf("^%d ", CLIP_YOU_SAY)); + pat[SelfSht] = TQRegExp(pattern.sprintf("^%d ", CLIP_YOU_SHOUT)); + pat[SelfWis] = TQRegExp(pattern.sprintf("^%d ", CLIP_YOU_WHISPER)); + pat[SelfKib] = TQRegExp(pattern.sprintf("^%d ", CLIP_YOU_KIBITZ)); + pat[UserLin] = TQRegExp(pattern.sprintf("^%d ", CLIP_LOGIN)); + pat[UserLot] = TQRegExp(pattern.sprintf("^%d ", CLIP_LOGOUT)); + + pat[NoLogin] = TQRegExp("\\*\\* Unknown command: 'login'"); + pat[BegRate] = TQRegExp("^rating calculation:$"); + pat[EndRate] = TQRegExp("^change for "); + pat[HTML_lt] = TQRegExp("<"); + pat[HTML_gt] = TQRegExp(">"); + pat[BoardSY] = TQRegExp("^Value of 'boardstyle' set to 3"); + pat[BoardSN] = TQRegExp("^Value of 'boardstyle' set to [^3]"); + pat[WhoisBG] = TQRegExp("^Information about "); + pat[WhoisE1] = TQRegExp("^ No email address\\.$"); + pat[WhoisE2] = TQRegExp("^ Email address: "); + pat[SelfSlf] = TQRegExp("^You say to yourself:"); + pat[Goodbye] = TQRegExp("^ Goodbye\\."); + pat[GameSav] = TQRegExp("The game was saved\\.$"); + pat[RawBord] = TQRegExp("^board:"); + pat[YouTurn] = TQRegExp("^It's your turn\\. Please roll or double"); + pat[PlsMove] = TQRegExp("^Please move [1-6]+ pie"); + pat[EndWtch] = TQRegExp("^You stop watching "); + pat[BegWtch] = TQRegExp("^You're now watching "); + pat[BegGame] = TQRegExp("^Starting a new game with "); + pat[Reload1] = TQRegExp("^You are now playing with "); + pat[Reload2] = TQRegExp(" has joined you. Your running match was loaded\\.$"); + pat[OneWave] = TQRegExp(" waves goodbye.$"); + pat[TwoWave] = TQRegExp(" waves goodbye again.$"); + pat[YouWave] = TQRegExp("^You wave goodbye.$"); + pat[GameBG1] = TQRegExp("start a [0-9]+ point match"); + pat[GameBG2] = TQRegExp("start an unlimited match"); + pat[GameRE1] = TQRegExp("are resuming their [0-9]+-point match"); + pat[GameRE2] = TQRegExp("are resuming their unlimited match"); + pat[GameEnd] = TQRegExp("point match against"); + pat[TabChar] = TQRegExp("\\t"); + pat[PlsChar] = TQRegExp("\\+"); + pat[Invite0] = TQRegExp(" wants to play a [0-9]+ point match with you\\.$"); + pat[Invite1] = TQRegExp("^.+ wants to play a "); + pat[Invite2] = TQRegExp(" wants to resume a saved match with you\\.$"); + pat[Invite3] = TQRegExp(" wants to play an unlimited match with you\\.$"); + pat[TypJoin] = TQRegExp("^Type 'join "); + pat[OneName] = TQRegExp("^ONE USERNAME PER PERSON ONLY!!!"); + pat[YouAway] = TQRegExp("^You're away. Please type 'back'"); + pat[YouBack] = TQRegExp("^Welcome back\\.$"); + pat[YouMove] = TQRegExp("^It's your turn to move\\."); + pat[YouRoll] = TQRegExp("^It's your turn to roll or double\\."); + pat[TwoStar] = TQRegExp("^\\*\\* "); + pat[OthrNam] = TQRegExp("^\\*\\* Please use another name\\. "); + pat[BoxHori] = TQRegExp("^ *\\+-*\\+ *$"); + pat[BoxVer1] = TQRegExp("^ *\\|"); + pat[BoxVer2] = TQRegExp("\\| *$"); + pat[YourNam] = TQRegExp("Your name will be "); + pat[GivePwd] = TQRegExp("Please give your password:"); + pat[RetypeP] = TQRegExp("Please retype your password:"); + pat[HelpTxt] = TQRegExp("^NAME$"); + pat[MatchB1] = TQRegExp(" has joined you for a [0-9]+ point match\\.$"); + pat[MatchB2] = TQRegExp(" has joined you for an unlimited match\\.$"); + pat[EndLose] = TQRegExp(" wins the [0-9]+ point match [0-9]+-[0-9]+"); + pat[EndVict] = TQRegExp(" win the [0-9]+ point match [0-9]+-[0-9]+"); + pat[RejAcpt] = TQRegExp("Type 'accept' or 'reject'\\.$"); + pat[YouAcpt] = TQRegExp("^You accept the double\\. The cube shows [0-9]+\\."); + + pat[KeepAlv] = TQRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"); + pat[RatingY] = TQRegExp("You'll see how the rating changes are calculated\\.$"); + pat[RatingN] = TQRegExp("You won't see how the rating changes are calculated\\.$"); // FIXME same problem as in previous line // mpgnu accepts the double.5 arthur_tn - gnu 1 0 1243.32 365 6 983722411 adsl-61-168-141.bna.bellsouth.net - - @@ -1256,27 +1256,27 @@ void KBgEngineFIBS::initPattern() */ - pat[ConLeav] = QRegExp("^Type 'join' if you want to play the next game, type 'leave' if you don't\\.$"); - pat[GreedyY] = QRegExp("^\\*\\* Will use automatic greedy bearoffs\\."); - pat[GreedyN] = QRegExp("^\\*\\* Won't use automatic greedy bearoffs\\."); - pat[BegBlnd] = QRegExp("^\\*\\* You blind "); - pat[EndBlnd] = QRegExp("^\\*\\* You unblind "); - pat[MatchB3] = QRegExp("^\\*\\* You are now playing a [0-9]+ point match with "); - pat[MatchB4] = QRegExp("^\\*\\* You are now playing an unlimited match with "); - pat[RejCont] = QRegExp("^You reject\\. The game continues\\."); - pat[AcptWin] = QRegExp("^You accept and win "); - pat[YouGive] = QRegExp("^You give up\\."); - pat[DoubleY] = QRegExp("^\\*\\* You will be asked if you want to double\\."); - pat[DoubleN] = QRegExp("^\\*\\* You won't be asked if you want to double\\."); + pat[ConLeav] = TQRegExp("^Type 'join' if you want to play the next game, type 'leave' if you don't\\.$"); + pat[GreedyY] = TQRegExp("^\\*\\* Will use automatic greedy bearoffs\\."); + pat[GreedyN] = TQRegExp("^\\*\\* Won't use automatic greedy bearoffs\\."); + pat[BegBlnd] = TQRegExp("^\\*\\* You blind "); + pat[EndBlnd] = TQRegExp("^\\*\\* You unblind "); + pat[MatchB3] = TQRegExp("^\\*\\* You are now playing a [0-9]+ point match with "); + pat[MatchB4] = TQRegExp("^\\*\\* You are now playing an unlimited match with "); + pat[RejCont] = TQRegExp("^You reject\\. The game continues\\."); + pat[AcptWin] = TQRegExp("^You accept and win "); + pat[YouGive] = TQRegExp("^You give up\\."); + pat[DoubleY] = TQRegExp("^\\*\\* You will be asked if you want to double\\."); + pat[DoubleN] = TQRegExp("^\\*\\* You won't be asked if you want to double\\."); } /* * Parse an incoming line and notify all interested parties - first match * decides. */ -void KBgEngineFIBS::handleServerData(QString &line) +void KBgEngineFIBS::handleServerData(TQString &line) { - QString rawline = line; // contains the line before it is HTML'fied + TQString rawline = line; // contains the line before it is HTML'fied /* * Fix-up any HTML-like tags in the line @@ -1323,7 +1323,7 @@ void KBgEngineFIBS::handleServerData(QString &line) * Receive the logout sequence. The string will be flushed by the * disconnectFIBS() callback */ - rxCollect += QString("
") + line + "

"; + rxCollect += TQString("
") + line + "

"; break; case RxNormal: @@ -1341,7 +1341,7 @@ void KBgEngineFIBS::handleServerData(QString &line) /* * Handle messages during the RxWhois state */ -void KBgEngineFIBS::handleMessageWhois(const QString &line) +void KBgEngineFIBS::handleMessageWhois(const TQString &line) { rxCollect += "
    " + line; if (line.contains(pat[WhoisE1]) || line.contains(pat[WhoisE2])) { @@ -1353,7 +1353,7 @@ void KBgEngineFIBS::handleMessageWhois(const QString &line) /* * Handle messages during the RxRating state */ -void KBgEngineFIBS::handleMessageRating(const QString &line) +void KBgEngineFIBS::handleMessageRating(const TQString &line) { rxCollect += "
" + line; if (line.contains(pat[EndRate]) && ++rxCount == 2) { @@ -1365,7 +1365,7 @@ void KBgEngineFIBS::handleMessageRating(const QString &line) /* * Handle messages during the RxMotd state */ -void KBgEngineFIBS::handleMessageMotd(const QString &line) +void KBgEngineFIBS::handleMessageMotd(const TQString &line) { if (line.contains(pat[MotdEnd])) { rxStatus = RxNormal; @@ -1377,7 +1377,7 @@ void KBgEngineFIBS::handleMessageMotd(const QString &line) */ emit serverString("set boardstyle 3"); } else { - QString tline = line; + TQString tline = line; tline.replace(pat[BoxHori], "

"); tline.replace(pat[BoxVer1], ""); tline.replace(pat[BoxVer2], ""); @@ -1388,7 +1388,7 @@ void KBgEngineFIBS::handleMessageMotd(const QString &line) /* * Handle messages during the RxConnect state */ -void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &rawline) +void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &rawline) { /* * Two possibilities: either we are logged in or we sent bad password/login @@ -1400,7 +1400,7 @@ void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &raw if (rxCollect.isEmpty()) { rxStatus = RxIgnore; int ret = KMessageBox::warningContinueCancel - ((QWidget *)parent(), i18n("There was a problem with " + ((TQWidget *)parent(), i18n("There was a problem with " "your login and password. " "You can reenter\n" "your login and password and " @@ -1434,8 +1434,8 @@ void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &raw // Using latin1() is okay, since the string comes from FIBS. int words = sscanf (line.latin1(), "%255s%255s%li%255s", p[0], p[1], &tmp, p[2]); if (words >= 4) { - QDateTime d; d.setTime_t(tmp); - QString text = i18n("%1, last logged in from %2 at %3.").arg(p[1]).arg(p[2]).arg(d.toString()); + TQDateTime d; d.setTime_t(tmp); + TQString text = i18n("%1, last logged in from %2 at %3.").arg(p[1]).arg(p[2]).arg(d.toString()); emit infoText("

" + text); playerlist->setName(p[1]); } @@ -1539,9 +1539,9 @@ void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &raw */ if (line.contains(pat[OneName])) { rxStatus = RxNewLogin; - emit infoText(QString("") + rxCollect + ""); + emit infoText(TQString("") + rxCollect + ""); rxCollect = ""; - QString tmp = rawline; + TQString tmp = rawline; handleServerData(tmp); return; } @@ -1555,26 +1555,26 @@ void KBgEngineFIBS::handleMessageConnect(const QString &line, const QString &raw /* * Handle messages during the RxNewLogin state */ -void KBgEngineFIBS::handleMessageNewLogin(const QString &line) +void KBgEngineFIBS::handleMessageNewLogin(const TQString &line) { /* * Request the new login */ if (line.contains(pat[OneName])) { - emit serverString(QString("name ") + infoFIBS[FIBSUser]); + emit serverString(TQString("name ") + infoFIBS[FIBSUser]); return; } /* * Ooops, user name already exists */ if (line.contains(pat[OthrNam])) { - QString text = i18n("The selected login is alreay in use! Please select another one."); + TQString text = i18n("The selected login is alreay in use! Please select another one."); bool ret, first = true; - QString msg; + TQString msg; do { msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, - (QWidget *)parent())).stripWhiteSpace(); + (TQWidget *)parent())).stripWhiteSpace(); if (first) { text += i18n("\n\nThe login may not contain spaces or colons!"); first = false; @@ -1608,7 +1608,7 @@ void KBgEngineFIBS::handleMessageNewLogin(const QString &line) */ if (line.contains(pat[RetypeP])) { - QString text = i18n("Your account has been created. Your new login is %1. To fully activate " + TQString text = i18n("Your account has been created. Your new login is %1. To fully activate " "this account, I will now close the connection. Once you reconnect, you can start " "playing backgammon on FIBS.").arg(infoFIBS[FIBSUser]); emit infoText("

" + text + "

"); @@ -1623,7 +1623,7 @@ void KBgEngineFIBS::handleMessageNewLogin(const QString &line) /* * Handle all normal messages - during the RxNormal state */ -void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) +void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) { // - ignored ---------------------------------------------------------------------- @@ -1728,7 +1728,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) pname[US ] = st->player(US); pname[THEM] = st->player(THEM); - playing = (QString("You") == pname[US]); + playing = (TQString("You") == pname[US]); toMove = st->moves(); @@ -1864,7 +1864,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) else if (line.contains(pat[WhoisBG])) { rxStatus = RxWhois; - rxCollect = QString("
") + line + ""; + rxCollect = TQString("
") + line + ""; return; } else if (line.contains(pat[MotdBeg])) { @@ -1904,7 +1904,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) */ else if (line.contains(pat[WhoInfo])) { rawline.replace(pat[WhoInfo], ""); - if (rawline.contains(QRegExp("^" + infoFIBS[FIBSUser] + " "))) { + if (rawline.contains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) { int ready; // Using latin1() is fine, since the string is coming from FIBS. sscanf(rawline.latin1(), "%*s %*s %*s %i %*s %*s %*s %*s %*s %*s %*s %*s", &ready); @@ -2015,7 +2015,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) if (playing) { KNotifyClient::event("game over l", i18n("Sorry, you lost the game.")); if (useAutoMsg[MsgLos] && !autoMsg[MsgLos].stripWhiteSpace().isEmpty()) - emit serverString(QString("tell ") + pname[THEM] + " " + autoMsg[MsgLos]); + emit serverString(TQString("tell ") + pname[THEM] + " " + autoMsg[MsgLos]); } emit gameOver(); } @@ -2023,7 +2023,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) if (playing) { KNotifyClient::event("game over w", i18n("Congratulations, you won the game!")); if (useAutoMsg[MsgWin] && !autoMsg[MsgWin].stripWhiteSpace().isEmpty()) - emit serverString(QString("tell ") + pname[THEM] + " " + autoMsg[MsgWin]); + emit serverString(TQString("tell ") + pname[THEM] + " " + autoMsg[MsgWin]); } emit gameOver(); } @@ -2058,7 +2058,7 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) } else if (line.contains(pat[BoardSN])) { emit serverString("set boardstyle 3"); - emit infoText(QString("
") + emit infoText(TQString("
") + i18n("You should never set the 'boardstyle' variable " "by hand! It is vital for proper functioning of " "this program that it remains set to 3. It has " @@ -2091,77 +2091,77 @@ void KBgEngineFIBS::handleMessageNormal(QString &line, QString &rawline) /* * Constructor */ -KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) +KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) : KBgEngine(parent, name, pmenu) { /* * No connection, not playing, ready for login */ - connection = new QSocket(parent, "fibs connection"); + connection = new TQSocket(parent, "fibs connection"); playing = false; login = true; - connect(connection, SIGNAL(hostFound()), this, SLOT(hostFound())); - connect(connection, SIGNAL(connected()), this, SLOT(connected())); - connect(connection, SIGNAL(error(int)), this, SLOT(connError(int))); - connect(connection, SIGNAL(connectionClosed()), this, SLOT(connectionClosed())); - connect(connection, SIGNAL(delayedCloseFinished()), this, SLOT(connectionClosed())); - connect(connection, SIGNAL(readyRead()), this, SLOT(readData())); + connect(connection, TQT_SIGNAL(hostFound()), this, TQT_SLOT(hostFound())); + connect(connection, TQT_SIGNAL(connected()), this, TQT_SLOT(connected())); + connect(connection, TQT_SIGNAL(error(int)), this, TQT_SLOT(connError(int))); + connect(connection, TQT_SIGNAL(connectionClosed()), this, TQT_SLOT(connectionClosed())); + connect(connection, TQT_SIGNAL(delayedCloseFinished()), this, TQT_SLOT(connectionClosed())); + connect(connection, TQT_SIGNAL(readyRead()), this, TQT_SLOT(readData())); - connect(this, SIGNAL(serverString(const QString &)), this, SLOT(sendData(const QString &))); + connect(this, TQT_SIGNAL(serverString(const TQString &)), this, TQT_SLOT(sendData(const TQString &))); /* * No invitation dialog */ invitationDlg = 0; - connect(this, SIGNAL(fibsWhoInfo(const QString &)), this, SLOT(changeJoin(const QString &))); - connect(this, SIGNAL(fibsLogout (const QString &)), this, SLOT(cancelJoin(const QString &))); - connect(this, SIGNAL(gameOver()), this, SLOT(endGame())); + connect(this, TQT_SIGNAL(fibsWhoInfo(const TQString &)), this, TQT_SLOT(changeJoin(const TQString &))); + connect(this, TQT_SIGNAL(fibsLogout (const TQString &)), this, TQT_SLOT(cancelJoin(const TQString &))); + connect(this, TQT_SIGNAL(gameOver()), this, TQT_SLOT(endGame())); /* * Creating, initializing and connecting the player list */ playerlist = new KFibsPlayerList(0, "fibs player list"); - connect(this, SIGNAL(fibsWhoInfo(const QString &)), playerlist, SLOT(changePlayer(const QString &))); - connect(this, SIGNAL(fibsLogout (const QString &)), playerlist, SLOT(deletePlayer(const QString &))); - connect(this, SIGNAL(fibsWhoEnd()), playerlist, SLOT(stopUpdate())); - connect(this, SIGNAL(fibsConnectionClosed()), playerlist, SLOT(stopUpdate())); - connect(this, SIGNAL(changePlayerStatus(const QString &, int, bool)), - playerlist, SLOT(changePlayerStatus(const QString &, int, bool))); - connect(playerlist, SIGNAL(fibsCommand(const QString &)), this, SLOT(handleCommand(const QString &))); - connect(playerlist, SIGNAL(fibsInvite(const QString &)), this, SLOT(fibsRequestInvitation(const QString &))); + connect(this, TQT_SIGNAL(fibsWhoInfo(const TQString &)), playerlist, TQT_SLOT(changePlayer(const TQString &))); + connect(this, TQT_SIGNAL(fibsLogout (const TQString &)), playerlist, TQT_SLOT(deletePlayer(const TQString &))); + connect(this, TQT_SIGNAL(fibsWhoEnd()), playerlist, TQT_SLOT(stopUpdate())); + connect(this, TQT_SIGNAL(fibsConnectionClosed()), playerlist, TQT_SLOT(stopUpdate())); + connect(this, TQT_SIGNAL(changePlayerStatus(const TQString &, int, bool)), + playerlist, TQT_SLOT(changePlayerStatus(const TQString &, int, bool))); + connect(playerlist, TQT_SIGNAL(fibsCommand(const TQString &)), this, TQT_SLOT(handleCommand(const TQString &))); + connect(playerlist, TQT_SIGNAL(fibsInvite(const TQString &)), this, TQT_SLOT(fibsRequestInvitation(const TQString &))); /* * Create, initialize and connect the chat window */ chatWindow = new KBgChat(0, "chat window"); - connect(this, SIGNAL(chatMessage(const QString &)), chatWindow, SLOT(handleData(const QString &))); - connect(this, SIGNAL(fibsStartNewGame(const QString &)), chatWindow, SLOT(startGame(const QString &))); - connect(this, SIGNAL(gameOver()), chatWindow, SLOT(endGame())); - connect(this, SIGNAL(fibsLogout (const QString &)), chatWindow, SLOT(deletePlayer(const QString &))); - connect(chatWindow, SIGNAL(fibsCommand(const QString &)), this, SLOT(handleCommand(const QString &))); - connect(chatWindow, SIGNAL(fibsRequestInvitation(const QString &)), this, SLOT(fibsRequestInvitation(const QString &))); - connect(chatWindow, SIGNAL(personalMessage(const QString &)), this, SLOT(personalMessage(const QString &))); - connect(playerlist, SIGNAL(fibsTalk(const QString &)), chatWindow, SLOT(fibsTalk(const QString &))); + connect(this, TQT_SIGNAL(chatMessage(const TQString &)), chatWindow, TQT_SLOT(handleData(const TQString &))); + connect(this, TQT_SIGNAL(fibsStartNewGame(const TQString &)), chatWindow, TQT_SLOT(startGame(const TQString &))); + connect(this, TQT_SIGNAL(gameOver()), chatWindow, TQT_SLOT(endGame())); + connect(this, TQT_SIGNAL(fibsLogout (const TQString &)), chatWindow, TQT_SLOT(deletePlayer(const TQString &))); + connect(chatWindow, TQT_SIGNAL(fibsCommand(const TQString &)), this, TQT_SLOT(handleCommand(const TQString &))); + connect(chatWindow, TQT_SIGNAL(fibsRequestInvitation(const TQString &)), this, TQT_SLOT(fibsRequestInvitation(const TQString &))); + connect(chatWindow, TQT_SIGNAL(personalMessage(const TQString &)), this, TQT_SLOT(personalMessage(const TQString &))); + connect(playerlist, TQT_SIGNAL(fibsTalk(const TQString &)), chatWindow, TQT_SLOT(fibsTalk(const TQString &))); /* * Creating, initializing and connecting the menu * ---------------------------------------------- */ - respMenu = new QPopupMenu(); - joinMenu = new QPopupMenu(); - cmdMenu = new QPopupMenu(); - optsMenu = new QPopupMenu(); + respMenu = new TQPopupMenu(); + joinMenu = new TQPopupMenu(); + cmdMenu = new TQPopupMenu(); + optsMenu = new TQPopupMenu(); /* * Initialize the FIBS submenu - this is also put in the play menu */ - conAction = new KAction(i18n("&Connect"), 0, this, SLOT( connectFIBS()), this); - newAction = new KAction(i18n("New Account"), 0, this, SLOT( newAccount()), this); - disAction = new KAction(i18n("&Disconnect"), 0, this, SLOT(disconnectFIBS()), this); + conAction = new KAction(i18n("&Connect"), 0, this, TQT_SLOT( connectFIBS()), this); + newAction = new KAction(i18n("New Account"), 0, this, TQT_SLOT( newAccount()), this); + disAction = new KAction(i18n("&Disconnect"), 0, this, TQT_SLOT(disconnectFIBS()), this); conAction->setEnabled(true ); conAction->plug(menu); disAction->setEnabled(false); disAction->plug(menu); @@ -2169,7 +2169,7 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) menu->insertSeparator(); - (invAction = new KAction(i18n("&Invite..."), 0, this, SLOT(inviteDialog()), this))->plug(menu); + (invAction = new KAction(i18n("&Invite..."), 0, this, TQT_SLOT(inviteDialog()), this))->plug(menu); /* * Create and fill the response menu. This is for all these: type this or @@ -2177,8 +2177,8 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) */ cmdMenuID = menu->insertItem(i18n("&Commands"), cmdMenu); { - (actAway = new KAction(i18n("Away"), 0, this, SLOT(away()), this))->plug(cmdMenu); - (actBack = new KAction(i18n("Back"), 0, this, SLOT(back()), this))->plug(cmdMenu); + (actAway = new KAction(i18n("Away"), 0, this, TQT_SLOT(away()), this))->plug(cmdMenu); + (actBack = new KAction(i18n("Back"), 0, this, TQT_SLOT(back()), this))->plug(cmdMenu); actAway->setEnabled(true); actBack->setEnabled(false); @@ -2195,14 +2195,14 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) fibsOpt[i] = 0; fibsOpt[OptReady] = new KToggleAction(i18n("Ready to Play"), - 0, this, SLOT(toggle_ready()), this); + 0, this, TQT_SLOT(toggle_ready()), this); fibsOpt[OptRatings] = new KToggleAction(i18n("Show Rating Computations"), - 0, this, SLOT(toggle_ratings()), this); + 0, this, TQT_SLOT(toggle_ratings()), this); fibsOpt[OptRatings]->setCheckedState(i18n("Hide Rating Computations")); fibsOpt[OptGreedy] = new KToggleAction(i18n("Greedy Bearoffs"), - 0, this, SLOT(toggle_greedy()), this); + 0, this, TQT_SLOT(toggle_greedy()), this); fibsOpt[OptDouble] = new KToggleAction(i18n("Ask for Doubles"), - 0, this, SLOT(toggle_double()), this); + 0, this, TQT_SLOT(toggle_double()), this); for (int i = 0; i < NumFIBSOpt; i++) if (fibsOpt[i]) @@ -2216,16 +2216,16 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) */ respMenuID = menu->insertItem(i18n("&Response"), respMenu); { - (actAccept = new KAction(i18n("Accept"), 0, this, SLOT(accept()), this))->plug(respMenu); - (actReject = new KAction(i18n("Reject"), 0, this, SLOT(reject()), this))->plug(respMenu); + (actAccept = new KAction(i18n("Accept"), 0, this, TQT_SLOT(accept()), this))->plug(respMenu); + (actReject = new KAction(i18n("Reject"), 0, this, TQT_SLOT(reject()), this))->plug(respMenu); actAccept->setEnabled(false); actReject->setEnabled(false); respMenu->insertSeparator(); - (actConti = new KAction(i18n("Join"), 0, this, SLOT(match_conti()), this))->plug(respMenu); - (actLeave = new KAction(i18n("Leave"), 0, this, SLOT(match_leave()), this))->plug(respMenu); + (actConti = new KAction(i18n("Join"), 0, this, TQT_SLOT(match_conti()), this))->plug(respMenu); + (actLeave = new KAction(i18n("Leave"), 0, this, TQT_SLOT(match_leave()), this))->plug(respMenu); actConti->setEnabled(false); actLeave->setEnabled(false); @@ -2238,14 +2238,14 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) joinMenuID = menu->insertItem(i18n("&Join"), joinMenu); { numJoin = -1; - actJoin[0] = new KAction("", 0, this, SLOT(join_0()), this); - actJoin[1] = new KAction("", 0, this, SLOT(join_1()), this); - actJoin[2] = new KAction("", 0, this, SLOT(join_2()), this); - actJoin[3] = new KAction("", 0, this, SLOT(join_3()), this); - actJoin[4] = new KAction("", 0, this, SLOT(join_4()), this); - actJoin[5] = new KAction("", 0, this, SLOT(join_5()), this); - actJoin[6] = new KAction("", 0, this, SLOT(join_6()), this); - actJoin[7] = new KAction("", 0, this, SLOT(join_7()), this); + actJoin[0] = new KAction("", 0, this, TQT_SLOT(join_0()), this); + actJoin[1] = new KAction("", 0, this, TQT_SLOT(join_1()), this); + actJoin[2] = new KAction("", 0, this, TQT_SLOT(join_2()), this); + actJoin[3] = new KAction("", 0, this, TQT_SLOT(join_3()), this); + actJoin[4] = new KAction("", 0, this, TQT_SLOT(join_4()), this); + actJoin[5] = new KAction("", 0, this, TQT_SLOT(join_5()), this); + actJoin[6] = new KAction("", 0, this, TQT_SLOT(join_6()), this); + actJoin[7] = new KAction("", 0, this, TQT_SLOT(join_7()), this); } menu->setItemEnabled(joinMenuID, false); @@ -2258,11 +2258,11 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) */ menu->insertSeparator(); - (listAct = new KToggleAction(i18n("&Player List"), 0, this, SLOT(showList()), this))->plug(menu); - (chatAct = new KToggleAction(i18n("&Chat"), 0, this, SLOT(showChat()), this))->plug(menu); + (listAct = new KToggleAction(i18n("&Player List"), 0, this, TQT_SLOT(showList()), this))->plug(menu); + (chatAct = new KToggleAction(i18n("&Chat"), 0, this, TQT_SLOT(showChat()), this))->plug(menu); - connect(playerlist, SIGNAL(windowVisible(bool)), listAct, SLOT(setChecked(bool))); - connect(chatWindow, SIGNAL(windowVisible(bool)), chatAct, SLOT(setChecked(bool))); + connect(playerlist, TQT_SIGNAL(windowVisible(bool)), listAct, TQT_SLOT(setChecked(bool))); + connect(chatWindow, TQT_SIGNAL(windowVisible(bool)), chatAct, TQT_SLOT(setChecked(bool))); /* * Create message IDs. This sets up a lot of regular expressions. @@ -2289,8 +2289,8 @@ KBgEngineFIBS::KBgEngineFIBS(QWidget *parent, QString *name, QPopupMenu *pmenu) // FIXME: move the start to connect... - keepaliveTimer = new QTimer(this); - connect(keepaliveTimer, SIGNAL(timeout()), this, SLOT(keepAlive())); + keepaliveTimer = new TQTimer(this); + connect(keepaliveTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(keepAlive())); keepaliveTimer->start(1200000); } diff --git a/kbackgammon/engines/fibs/kbgfibs.h b/kbackgammon/engines/fibs/kbgfibs.h index 1c14e0f3..23db44b2 100644 --- a/kbackgammon/engines/fibs/kbgfibs.h +++ b/kbackgammon/engines/fibs/kbgfibs.h @@ -35,9 +35,9 @@ #include "kbgfibschat.h" #include "kbginvite.h" // TODO -#include -#include -#include +#include +#include +#include #include @@ -66,7 +66,7 @@ public: /** * Constructor */ - KBgEngineFIBS(QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0); + KBgEngineFIBS(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor @@ -118,7 +118,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove(QString *s); + virtual void handleMove(TQString *s); /** * Undo the last move @@ -149,11 +149,11 @@ public slots: /* * Process the string cmd */ - void handleCommand(const QString &cmd); + void handleCommand(const TQString &cmd); - void fibsRequestInvitation(const QString &player); + void fibsRequestInvitation(const TQString &player); - void personalMessage(const QString &msg); + void personalMessage(const TQString &msg); @@ -165,20 +165,20 @@ public slots: signals: - void serverString(const QString &s); + void serverString(const TQString &s); - void fibsWhoInfo(const QString &line); + void fibsWhoInfo(const TQString &line); void fibsWhoEnd(); - void fibsLogout(const QString &p); - void fibsLogin(const QString &p); + void fibsLogout(const TQString &p); + void fibsLogin(const TQString &p); void fibsConnectionClosed(); - void changePlayerStatus(const QString &, int, bool); + void changePlayerStatus(const TQString &, int, bool); - void chatMessage(const QString &msg); + void chatMessage(const TQString &msg); - void fibsStartNewGame(const QString &msg); + void fibsStartNewGame(const TQString &msg); void gameOver(); protected slots: @@ -192,22 +192,22 @@ protected slots: private: - QTimer *keepaliveTimer; + TQTimer *keepaliveTimer; - QString pname[2]; + TQString pname[2]; - QString currBoard, caption; + TQString currBoard, caption; //KBgStatus *currBoard //KBgFIBSBoard *boardHandler; - QStringList invitations; + TQStringList invitations; /* * special menu entries */ int respMenuID, cmdMenuID, joinMenuID, optsMenuID; - QPopupMenu *respMenu, *cmdMenu, *joinMenu, *optsMenu; + TQPopupMenu *respMenu, *cmdMenu, *joinMenu, *optsMenu; /* * child windows @@ -219,10 +219,10 @@ private: /* * Other stuff */ - QString lastMove; + TQString lastMove; int toMove; - QString lastAway; + TQString lastAway; bool playing; bool redoPossible; int undoCounter; @@ -261,13 +261,13 @@ protected slots: * Handle rawwho information for the purposes of the invitation * submenu and the join entries */ - void changeJoin(const QString &info); + void changeJoin(const TQString &info); /** * A player will be removed from the menu of pending invitations * if necessary. */ - void cancelJoin(const QString &info); + void cancelJoin(const TQString &info); /** * We have up to 8 names in the join menu. They are the @@ -275,7 +275,7 @@ protected slots: * has its own slot and all slots call the common backend * join(). */ - void join(const QString &msg); + void join(const TQString &msg); void join_0(); void join_1(); @@ -337,7 +337,7 @@ public slots: void readData(); // send the string s to the server - void sendData(const QString &s); + void sendData(const TQString &s); protected: @@ -347,7 +347,7 @@ protected: private: // actual connection object - QSocket *connection; + TQSocket *connection; // flag if we have login information or new account bool login; @@ -395,7 +395,7 @@ protected slots: * made more efficient, but it is not time critical (and it appears to be * easier to understand this way). */ - void handleServerData(QString &line); + void handleServerData(TQString &line); protected: @@ -404,18 +404,18 @@ protected: int rxStatus, rxCount; - QString rxCollect; + TQString rxCollect; /* * The following functions handle the individual states * of the handleServerData() state machine, */ - void handleMessageWhois(const QString &line); - void handleMessageRating(const QString &line); - void handleMessageMotd(const QString &line); - void handleMessageNewLogin(const QString &line); - void handleMessageConnect(const QString &line, const QString &rawline); - void handleMessageNormal(QString &line, QString &rawline); + void handleMessageWhois(const TQString &line); + void handleMessageRating(const TQString &line); + void handleMessageMotd(const TQString &line); + void handleMessageNewLogin(const TQString &line); + void handleMessageConnect(const TQString &line, const TQString &rawline); + void handleMessageNormal(TQString &line, TQString &rawline); /* * The next enumeration and the array of regular expressions is needed for the @@ -436,7 +436,7 @@ protected: YouGive, DoubleY, DoubleN, KeepAlv, RatingY, RatingN, NumPattern}; - QRegExp pat[NumPattern]; + TQRegExp pat[NumPattern]; /* * This function is simply filling the pat[] array with the proper values. @@ -454,26 +454,26 @@ private: * Various options */ bool showMsg, whoisInvite; - QCheckBox *cbp, *cbi; + TQCheckBox *cbp, *cbi; - QCheckBox *cbk; + TQCheckBox *cbk; bool keepalive; /* * Connection setup */ enum FIBSInfo {FIBSHost, FIBSPort, FIBSUser, FIBSPswd, NumFIBS}; - QString infoFIBS[NumFIBS]; - QLineEdit *lec[NumFIBS]; + TQString infoFIBS[NumFIBS]; + TQLineEdit *lec[NumFIBS]; /* * Auto messages */ enum AutoMessages {MsgBeg, MsgLos, MsgWin, NumMsg}; - QLineEdit *lem[NumMsg]; - QCheckBox *cbm[NumMsg]; + TQLineEdit *lem[NumMsg]; + TQCheckBox *cbm[NumMsg]; bool useAutoMsg[NumMsg]; - QString autoMsg[NumMsg]; + TQString autoMsg[NumMsg]; }; #endif // __KBGFIBS_H diff --git a/kbackgammon/engines/fibs/kbgfibschat.cpp b/kbackgammon/engines/fibs/kbgfibschat.cpp index 45ba2bb7..7b34bae0 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.cpp +++ b/kbackgammon/engines/fibs/kbgfibschat.cpp @@ -26,25 +26,25 @@ #include "kbgfibschat.h" #include "kbgfibschat.moc" -#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 +#include +#include +#include +#include +#include +#include #include #include @@ -61,7 +61,7 @@ /* * Private utility class that might become more generally useful in - * the future. Basically, it implements rich text QListBox items. + * the future. Basically, it implements rich text TQListBox items. */ class KLBT : public QListBoxText { @@ -71,12 +71,12 @@ public: /* * Constructor */ - KLBT(QWidget *parent, const QString &text = QString::null, const QString &player = QString::null) - : QListBoxText(text) + KLBT(TQWidget *parent, const TQString &text = TQString::null, const TQString &player = TQString::null) + : TQListBoxText(text) { w = parent; - n = new QString(player); - t = new QSimpleRichText(text, w->font()); + n = new TQString(player); + t = new TQSimpleRichText(text, w->font()); // FIXME: this is not yet perfect t->setWidth(w->width()-20); @@ -94,7 +94,7 @@ public: /* * Overloaded required members returning height */ - virtual int height(const QListBox *) const + virtual int height(const TQListBox *) const { return (1+t->height()); } @@ -102,7 +102,7 @@ public: /* * Overloaded required members returning width */ - virtual int width(const QListBox *) const + virtual int width(const TQListBox *) const { return t->width(); } @@ -111,7 +111,7 @@ public: * The context menu needs the name of the player. It's easier * than extracting it from the text. */ - QString player() const + TQString player() const { return *n; } @@ -121,16 +121,16 @@ protected: /* * Required overloaded member to paint the text on the painter p. */ - virtual void paint(QPainter *p) + virtual void paint(TQPainter *p) { - t->draw(p, 1, 1, QRegion(p->viewport()), w->colorGroup()); + t->draw(p, 1, 1, TQRegion(p->viewport()), w->colorGroup()); } private: - QSimpleRichText *t; - QWidget *w; - QString *n; + TQSimpleRichText *t; + TQWidget *w; + TQString *n; }; @@ -142,12 +142,12 @@ public: /* * Name of the users */ - QString mName[2]; + TQString mName[2]; /* * Hold and assemble info text */ - QString mText; + TQString mText; /* * Numbers of the private action list. @@ -164,22 +164,22 @@ public: /* * Context menu and invitation menu */ - QPopupMenu *mChat, *mInvt; + TQPopupMenu *mChat, *mInvt; /* * list of users we do not want to hear shouting */ - QStringList mGag; + TQStringList mGag; /* * Listbox needed by the setup dialog */ - QListBox *mLb; + TQListBox *mLb; /* * Internal ID to name mapping */ - QDict *mName2ID; + TQDict *mName2ID; }; @@ -189,15 +189,15 @@ public: /* * Constructor of the chat window. */ -KBgChat::KBgChat(QWidget *parent, const char *name) +KBgChat::KBgChat(TQWidget *parent, const char *name) : KChat(parent, false) { d = new KBgChatPrivate(); KActionCollection* actions = new KActionCollection(this); - d->mName[0] = QString::null; + d->mName[0] = TQString::null; d->mChat = 0; - d->mInvt = new QPopupMenu(); + d->mInvt = new TQPopupMenu(); setAutoAddMessages(false); // we get an echo from FIBS setFromNickname(i18n("%1 user").arg(PROG_NAME)); @@ -207,12 +207,12 @@ KBgChat::KBgChat(QWidget *parent, const char *name) if (!addSendingEntry(i18n("Whisper to watchers only"), CLIP_YOU_WHISPER)) kdDebug(10500) << "adding whisper" << endl; - connect(this, SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), - this, SLOT(contextMenu(QListBoxItem *, const QPoint &))); - connect(this, SIGNAL(signalSendMessage(int, const QString &)), - this, SLOT(handleCommand(int, const QString &))); + connect(this, TQT_SIGNAL(rightButtonClicked(TQListBoxItem *, const TQPoint &)), + this, TQT_SLOT(contextMenu(TQListBoxItem *, const TQPoint &))); + connect(this, TQT_SIGNAL(signalSendMessage(int, const TQString &)), + this, TQT_SLOT(handleCommand(int, const TQString &))); - d->mName2ID = new QDict(17, true); + d->mName2ID = new TQDict(17, true); d->mName2ID->setAutoDelete(true); /* @@ -221,7 +221,7 @@ KBgChat::KBgChat(QWidget *parent, const char *name) setIcon(kapp->miniIcon()); setCaption(i18n("Chat Window")); - QWhatsThis::add(this, i18n("This is the chat window.\n\n" + TQWhatsThis::add(this, i18n("This is the chat window.\n\n" "The text in this window is colored depending on whether " "it is directed at you personally, shouted to the general " "FIBS population, has been said by you, or is of general " @@ -231,34 +231,34 @@ KBgChat::KBgChat(QWidget *parent, const char *name) * Define set of available actions */ d->mAct[KBgChatPrivate::Inquire] = new KAction(i18n("Info On"), - QIconSet(kapp->iconLoader()->loadIcon( + TQIconSet(kapp->iconLoader()->loadIcon( "help.xpm", KIcon::Small)), - 0, this, SLOT(slotInquire()), actions); + 0, this, TQT_SLOT(slotInquire()), actions); d->mAct[KBgChatPrivate::Talk] = new KAction(i18n("Talk To"), - QIconSet(kapp->iconLoader()->loadIcon( + TQIconSet(kapp->iconLoader()->loadIcon( PROG_NAME "-chat.png", KIcon::Small)), - 0, this, SLOT(slotTalk()), actions); + 0, this, TQT_SLOT(slotTalk()), actions); d->mAct[KBgChatPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, - SLOT(slotInviteD()), actions); + TQT_SLOT(slotInviteD()), actions); d->mAct[KBgChatPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, - SLOT(slotInvite1()), actions); + TQT_SLOT(slotInvite1()), actions); d->mAct[KBgChatPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, - SLOT(slotInvite2()), actions); + TQT_SLOT(slotInvite2()), actions); d->mAct[KBgChatPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, - SLOT(slotInvite3()), actions); + TQT_SLOT(slotInvite3()), actions); d->mAct[KBgChatPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, - SLOT(slotInvite4()), actions); + TQT_SLOT(slotInvite4()), actions); d->mAct[KBgChatPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, - SLOT(slotInvite5()), actions); + TQT_SLOT(slotInvite5()), actions); d->mAct[KBgChatPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, - SLOT(slotInvite6()), actions); + TQT_SLOT(slotInvite6()), actions); d->mAct[KBgChatPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, - SLOT(slotInvite7()), actions); + TQT_SLOT(slotInvite7()), actions); d->mAct[KBgChatPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, - SLOT(slotInviteU()), actions); + TQT_SLOT(slotInviteU()), actions); d->mAct[KBgChatPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, - SLOT(slotInviteR()), actions); + TQT_SLOT(slotInviteR()), actions); d->mAct[KBgChatPrivate::InviteD]->plug(d->mInvt); @@ -277,13 +277,13 @@ KBgChat::KBgChat(QWidget *parent, const char *name) d->mAct[KBgChatPrivate::InviteU]->plug(d->mInvt); d->mAct[KBgChatPrivate::InviteR]->plug(d->mInvt); - d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, this, SLOT(slotGag()), actions); - d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, this, SLOT(slotUngag()), actions); - d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, this, SLOT(slotCleargag()), actions); - d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(this, SLOT(slotCopy()), actions); - d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, this, SLOT(slotClear()), actions); - d->mAct[KBgChatPrivate::Close] = KStdAction::close(this, SLOT(hide()), actions); - d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, this, SLOT(slotSilent()), actions); + d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, this, TQT_SLOT(slotGag()), actions); + d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, this, TQT_SLOT(slotUngag()), actions); + d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, this, TQT_SLOT(slotCleargag()), actions); + d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(this, TQT_SLOT(slotCopy()), actions); + d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, this, TQT_SLOT(slotClear()), actions); + d->mAct[KBgChatPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions); + d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, this, TQT_SLOT(slotSilent()), actions); } @@ -309,7 +309,7 @@ void KBgChat::readConfig() KConfig* config = kapp->config(); config->setGroup("chat window"); - QPoint pos(10, 10); + TQPoint pos(10, 10); pos = config->readPointEntry("ori", &pos); setGeometry(pos.x(), pos.y(), config->readNumEntry("wdt",460), config->readNumEntry("hgt",200)); @@ -344,7 +344,7 @@ void KBgChat::saveConfig() * Setup dialog page of the player list - allow the user to select the * columns to show * - * FIXME: need to be able to set font here KChatBase::setBothFont(const QFont& font) + * FIXME: need to be able to set font here KChatBase::setBothFont(const TQFont& font) */ void KBgChat::getSetupPages(KTabCtl *nb, int space) { @@ -352,18 +352,18 @@ void KBgChat::getSetupPages(KTabCtl *nb, int space) * Main Widget * =========== */ - QWidget *w = new QWidget(nb); - QGridLayout *gl = new QGridLayout(w, 2, 1, space); + TQWidget *w = new TQWidget(nb); + TQGridLayout *gl = new TQGridLayout(w, 2, 1, space); - d->mLb = new QListBox(w); + d->mLb = new TQListBox(w); d->mLb->setMultiSelection(true); d->mLb->insertStringList(d->mGag); - QLabel *info = new QLabel(w); + TQLabel *info = new TQLabel(w); info->setText(i18n("Select users to be removed from the gag list.")); - QWhatsThis::add(w, i18n("Select all the users you want " + TQWhatsThis::add(w, i18n("Select all the users you want " "to remove from the gag list " "and then click OK. Afterwards " "you will again hear what they shout.")); @@ -414,37 +414,37 @@ void KBgChat::setupDefault() // == various slots and functions ============================================== /* - * Overloaded member to create a QListBoxItem for the chat window. + * Overloaded member to create a TQListBoxItem for the chat window. */ -QListBoxItem* KBgChat::layoutMessage(const QString& fromName, const QString& text) +TQListBoxItem* KBgChat::layoutMessage(const TQString& fromName, const TQString& text) { - QListBoxText* message = new KLBT(this, text, fromName); + TQListBoxText* message = new KLBT(this, text, fromName); return message; } /* * Catch hide events, so the engine's menu can be update. */ -void KBgChat::showEvent(QShowEvent *e) +void KBgChat::showEvent(TQShowEvent *e) { - QFrame::showEvent(e); + TQFrame::showEvent(e); emit windowVisible(true); } /* * Catch hide events, so the engine's menu can be update. */ -void KBgChat::hideEvent(QHideEvent *e) +void KBgChat::hideEvent(TQHideEvent *e) { emit windowVisible(false); - QFrame::hideEvent(e); + TQFrame::hideEvent(e); } /* * At the beginning of a game, add the name to the list and switch to * kibitz mode. */ -void KBgChat::startGame(const QString &name) +void KBgChat::startGame(const TQString &name) { int *id = d->mName2ID->find(d->mName[1] = name); if (!id) { @@ -470,7 +470,7 @@ void KBgChat::endGame() /* * Set the chat window ready to talk to name */ -void KBgChat::fibsTalk(const QString &name) +void KBgChat::fibsTalk(const TQString &name) { int *id = d->mName2ID->find(name); if (!id) { @@ -484,7 +484,7 @@ void KBgChat::fibsTalk(const QString &name) /* * Remove the player from the combo box when he/she logs out. */ -void KBgChat::deletePlayer(const QString &name) +void KBgChat::deletePlayer(const TQString &name) { int *id = d->mName2ID->find(name); if (id) { @@ -496,7 +496,7 @@ void KBgChat::deletePlayer(const QString &name) /* * Take action when the user presses return in the line edit control. */ -void KBgChat::handleCommand(int id, const QString& msg) +void KBgChat::handleCommand(int id, const TQString& msg) { int realID = sendingEntry(); @@ -511,7 +511,7 @@ void KBgChat::handleCommand(int id, const QString& msg) emit fibsCommand("whisper " + msg); break; default: - QDictIterator it(*d->mName2ID); + TQDictIterator it(*d->mName2ID); while (it.current()) { if (*it.current() == realID) { emit fibsCommand("tell " + it.currentKey() + " " + msg); @@ -533,10 +533,10 @@ void KBgChat::handleCommand(int id, const QString& msg) * This function emits the string in rich text format with the signal * personalMessage - again: the string contains rich text! */ -void KBgChat::handleData(const QString &msg) +void KBgChat::handleData(const TQString &msg) { - QString clip = msg.left(msg.find(' ')), user, cMsg = msg; - QDateTime date; + TQString clip = msg.left(msg.find(' ')), user, cMsg = msg; + TQDateTime date; bool flag = false; int cmd = clip.toInt(&flag); @@ -549,7 +549,7 @@ void KBgChat::handleData(const QString &msg) switch (cmd) { case CLIP_SAYS: if (!d->mGag.contains(user)) { - cMsg = i18n("%1 tells you: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("%1 tells you: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -558,7 +558,7 @@ void KBgChat::handleData(const QString &msg) case CLIP_SHOUTS: if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.contains(user))) { - cMsg = i18n("%1 shouts: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("%1 shouts: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; } else cMsg = ""; @@ -566,7 +566,7 @@ void KBgChat::handleData(const QString &msg) case CLIP_WHISPERS: if (!d->mGag.contains(user)) { - cMsg = i18n("%1 whispers: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("%1 whispers: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -575,7 +575,7 @@ void KBgChat::handleData(const QString &msg) case CLIP_KIBITZES: if (!d->mGag.contains(user)) { - cMsg = i18n("%1 kibitzes: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("%1 kibitzes: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -583,31 +583,31 @@ void KBgChat::handleData(const QString &msg) break; case CLIP_YOU_SAY: - cMsg = i18n("You tell %1: %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), "")); + cMsg = i18n("You tell %1: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_SHOUT: cMsg = i18n("You shout: %1").arg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_WHISPER: cMsg = i18n("You whisper: %1").arg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_YOU_KIBITZ: cMsg = i18n("You kibitz: %1").arg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_MESSAGE: @@ -618,21 +618,21 @@ void KBgChat::handleData(const QString &msg) cMsg = i18n("User %1 left a message at %2: %3").arg(user).arg(date.toString()).arg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_MESSAGE_DELIVERED: cMsg = i18n("Your message for %1 has been delivered.").arg(user); - cMsg = QString("") + cMsg + ""; + cMsg = TQString("") + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; case CLIP_MESSAGE_SAVED: cMsg = i18n("Your message for %1 has been saved.").arg(user); - cMsg = QString("") + cMsg + ""; + cMsg = TQString("") + cMsg + ""; emit personalMessage(cMsg); - user = QString::null; + user = TQString::null; break; default: // ignore the message @@ -644,8 +644,8 @@ void KBgChat::handleData(const QString &msg) /* * Special treatment for non-CLIP messages */ - if (cMsg.contains(QRegExp("^You say to yourself: "))) { - cMsg.replace(QRegExp("^You say to yourself: "), + if (cMsg.contains(TQRegExp("^You say to yourself: "))) { + cMsg.replace(TQRegExp("^You say to yourself: "), i18n("You say to yourself: ")); } else { kdDebug(user.isNull(), 10500) << "KBgChat::handleData unhandled message: " @@ -664,19 +664,19 @@ void KBgChat::handleData(const QString &msg) /* * RMB opens a context menu. */ -void KBgChat::contextMenu(QListBoxItem *i, const QPoint &p) +void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p) { /* - * Even if i is non-null, user might still be QString::null + * Even if i is non-null, user might still be TQString::null */ - d->mName[0] = (i == 0) ? QString::null : ((KLBT *)i)->player(); - d->mText = (i == 0) ? QString::null : ((KLBT *)i)->text(); + d->mName[0] = (i == 0) ? TQString::null : ((KLBT *)i)->player(); + d->mText = (i == 0) ? TQString::null : ((KLBT *)i)->text(); /* * Get a new context menu every time. Safe to delete the 0 * pointer. */ - delete d->mChat; d->mChat = new QPopupMenu(); + delete d->mChat; d->mChat = new TQPopupMenu(); /* * Fill the context menu with actions @@ -726,11 +726,11 @@ void KBgChat::slotCleargag() { d->mGag.clear(); - QString msg(""); + TQString msg(""); msg += i18n("The gag list is now empty."); msg += ""; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -740,11 +740,11 @@ void KBgChat::slotGag() { d->mGag.append(d->mName[0]); - QString msg(""); + TQString msg(""); msg += i18n("You won't hear what %1 says and shouts.").arg(d->mName[0]); msg += ""; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -762,11 +762,11 @@ void KBgChat::slotUngag() { d->mGag.remove(d->mName[0]); - QString msg(""); + TQString msg(""); msg += i18n("You will again hear what %1 says and shouts.").arg(d->mName[0]); msg += ""; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -783,12 +783,12 @@ void KBgChat::slotInquire() */ void KBgChat::slotSilent() { - QString msg; + TQString msg; if (((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) msg = "" + i18n("You will not hear what people shout.") + ""; else msg = "" + i18n("You will hear what people shout.") + ""; - addMessage(QString::null, msg); + addMessage(TQString::null, msg); } /* @@ -797,10 +797,10 @@ void KBgChat::slotSilent() */ void KBgChat::slotCopy() { - d->mText.replace(QRegExp(""), ""); - d->mText.replace(QRegExp(""), ""); - d->mText.replace(QRegExp(""), ""); - d->mText.replace(QRegExp("^.*\">"), ""); + d->mText.replace(TQRegExp(""), ""); + d->mText.replace(TQRegExp(""), ""); + d->mText.replace(TQRegExp(""), ""); + d->mText.replace(TQRegExp("^.*\">"), ""); kapp->clipboard()->setText(d->mText); } diff --git a/kbackgammon/engines/fibs/kbgfibschat.h b/kbackgammon/engines/fibs/kbgfibschat.h index c3a1d670..491cf19b 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.h +++ b/kbackgammon/engines/fibs/kbgfibschat.h @@ -61,7 +61,7 @@ public: /** * Constructor */ - KBgChat(QWidget *parent = 0, const char *name = 0); + KBgChat(TQWidget *parent = 0, const char *name = 0); /** * Destructor @@ -74,7 +74,7 @@ public slots: * Catch the RMB signal to display a context menu at p. The * menu shows entries specific to the selected item i. */ - void contextMenu(QListBoxItem *i, const QPoint &p); + void contextMenu(TQListBoxItem *i, const TQPoint &p); /** * Add chat window specific pages to the setup dialog @@ -100,12 +100,12 @@ public slots: * Player name has logges out. Remove name from the chat * window combo box if necessary. */ - void deletePlayer(const QString &name); + void deletePlayer(const TQString &name); /** * Process and append msg to the text. */ - void handleData(const QString &msg); + void handleData(const TQString &msg); /** * Restore previously saved setting or provides defaults @@ -120,7 +120,7 @@ public slots: /** * Set the opponents name and select whisper */ - void startGame(const QString &name); + void startGame(const TQString &name); /** * Game is over. We won (or not) and have been playing (or not) @@ -130,24 +130,24 @@ public slots: /** * Start talking to name */ - void fibsTalk(const QString &name); + void fibsTalk(const TQString &name); signals: /** * Emits a string that can be sent to the server */ - void fibsCommand(const QString &cmd); + void fibsCommand(const TQString &cmd); /** * Request an invitation of player */ - void fibsRequestInvitation(const QString &player); + void fibsRequestInvitation(const TQString &player); /** * Text of a personal message */ - void personalMessage(const QString &msg); + void personalMessage(const TQString &msg); /** * Dialog is visible or not @@ -159,18 +159,18 @@ protected: /** * Catch show events, so the engine's menu can be updated. */ - virtual void showEvent(QShowEvent *e); + virtual void showEvent(TQShowEvent *e); /** * Catch hide events, so the engine's menu can be updated. */ - virtual void hideEvent(QHideEvent *e); + virtual void hideEvent(TQHideEvent *e); /** * Create a custom ListBoxItem that contains a formated string * for the chat window. */ - virtual QListBoxItem* layoutMessage(const QString& fromName, const QString& text); + virtual TQListBoxItem* layoutMessage(const TQString& fromName, const TQString& text); protected slots: @@ -262,7 +262,7 @@ protected slots: /** * Slot for return pressed. Time to send the text to FIBS. */ - void handleCommand(int id, const QString& msg); + void handleCommand(int id, const TQString& msg); private: diff --git a/kbackgammon/engines/fibs/kbginvite.cpp b/kbackgammon/engines/fibs/kbginvite.cpp index cb455f0a..f43c3b6a 100644 --- a/kbackgammon/engines/fibs/kbginvite.cpp +++ b/kbackgammon/engines/fibs/kbginvite.cpp @@ -24,11 +24,11 @@ #include "kbginvite.h" #include "kbginvite.moc" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -40,8 +40,8 @@ class KBgInvitePrivate { public: KLineEdit *mLe; - QSpinBox *mSb; - QPushButton *mInvite, *mResume, *mUnlimited, *mCancel, *mClose; + TQSpinBox *mSb; + TQPushButton *mInvite, *mResume, *mUnlimited, *mCancel, *mClose; }; @@ -56,14 +56,14 @@ KBgInvite::KBgInvite(const char *name) d = new KBgInvitePrivate(); - QLabel *info = new QLabel(this); + TQLabel *info = new TQLabel(this); d->mLe = new KLineEdit(this, "invitation dialog"); - d->mSb = new QSpinBox(1, 999, 1, this, "spin box"); + d->mSb = new TQSpinBox(1, 999, 1, this, "spin box"); - d->mInvite = new QPushButton(i18n("&Invite"), this); - d->mResume = new QPushButton(i18n("&Resume"), this); - d->mUnlimited = new QPushButton(i18n("&Unlimited"), this); + d->mInvite = new TQPushButton(i18n("&Invite"), this); + d->mResume = new TQPushButton(i18n("&Resume"), this); + d->mUnlimited = new TQPushButton(i18n("&Unlimited"), this); d->mClose = new KPushButton(KStdGuiItem::close(), this); d->mCancel = new KPushButton(KStdGuiItem::clear(), this); @@ -71,19 +71,19 @@ KBgInvite::KBgInvite(const char *name) info->setText(i18n("Type the name of the player you want to invite in the first entry\n" "field and select the desired match length in the spin box.")); - QFrame *hLine = new QFrame(this); - hLine->setFrameStyle(QFrame::Sunken|QFrame::HLine); + TQFrame *hLine = new TQFrame(this); + hLine->setFrameStyle(TQFrame::Sunken|TQFrame::HLine); /* * Set up layouts */ - QBoxLayout *vbox = new QVBoxLayout(this); + TQBoxLayout *vbox = new TQVBoxLayout(this); - QBoxLayout *hbox_1 = new QHBoxLayout(vbox); - QBoxLayout *hbox_2 = new QHBoxLayout(vbox); - QBoxLayout *hbox_3 = new QHBoxLayout(vbox); - QBoxLayout *hbox_4 = new QHBoxLayout(vbox); - QBoxLayout *hbox_5 = new QHBoxLayout(vbox); + TQBoxLayout *hbox_1 = new TQHBoxLayout(vbox); + TQBoxLayout *hbox_2 = new TQHBoxLayout(vbox); + TQBoxLayout *hbox_3 = new TQHBoxLayout(vbox); + TQBoxLayout *hbox_4 = new TQHBoxLayout(vbox); + TQBoxLayout *hbox_5 = new TQHBoxLayout(vbox); hbox_1->addWidget(info); @@ -117,11 +117,11 @@ KBgInvite::KBgInvite(const char *name) /* * Connect the buttons */ - connect(d->mUnlimited, SIGNAL(clicked()), SLOT(unlimitedClicked())); - connect(d->mResume, SIGNAL(clicked()), SLOT(resumeClicked())); - connect(d->mInvite, SIGNAL(clicked()), SLOT(inviteClicked())); - connect(d->mClose, SIGNAL(clicked()), SLOT(hide())); - connect(d->mCancel, SIGNAL(clicked()), SLOT(cancelClicked())); + connect(d->mUnlimited, TQT_SIGNAL(clicked()), TQT_SLOT(unlimitedClicked())); + connect(d->mResume, TQT_SIGNAL(clicked()), TQT_SLOT(resumeClicked())); + connect(d->mInvite, TQT_SIGNAL(clicked()), TQT_SLOT(inviteClicked())); + connect(d->mClose, TQT_SIGNAL(clicked()), TQT_SLOT(hide())); + connect(d->mCancel, TQT_SIGNAL(clicked()), TQT_SLOT(cancelClicked())); } /* @@ -143,7 +143,7 @@ void KBgInvite::hide() /* * Set player name */ -void KBgInvite::setPlayer(const QString &player) +void KBgInvite::setPlayer(const TQString &player) { d->mLe->setText(player); } @@ -153,8 +153,8 @@ void KBgInvite::setPlayer(const QString &player) */ void KBgInvite::inviteClicked() { - QString tmp; - emit inviteCommand(QString("invite ") + d->mLe->text() + " " + tmp.setNum(d->mSb->value())); + TQString tmp; + emit inviteCommand(TQString("invite ") + d->mLe->text() + " " + tmp.setNum(d->mSb->value())); } /* @@ -162,7 +162,7 @@ void KBgInvite::inviteClicked() */ void KBgInvite::unlimitedClicked() { - emit inviteCommand(QString("invite ") + d->mLe->text() + " unlimited"); + emit inviteCommand(TQString("invite ") + d->mLe->text() + " unlimited"); } /* @@ -170,7 +170,7 @@ void KBgInvite::unlimitedClicked() */ void KBgInvite::resumeClicked() { - emit inviteCommand(QString("invite ") + d->mLe->text()); + emit inviteCommand(TQString("invite ") + d->mLe->text()); } /* diff --git a/kbackgammon/engines/fibs/kbginvite.h b/kbackgammon/engines/fibs/kbginvite.h index 992ee445..7bc5f3f7 100644 --- a/kbackgammon/engines/fibs/kbginvite.h +++ b/kbackgammon/engines/fibs/kbginvite.h @@ -69,7 +69,7 @@ public slots: /** * Set the name of the player in the line editor */ - void setPlayer(const QString &name); + void setPlayer(const TQString &name); protected slots: @@ -98,7 +98,7 @@ signals: /** * Emits the text of an invitation */ - void inviteCommand(const QString &cmd); + void inviteCommand(const TQString &cmd); /** * Delete the dialog after it is closed. diff --git a/kbackgammon/engines/fibs/kplayerlist.cpp b/kbackgammon/engines/fibs/kplayerlist.cpp index 102c354d..06b724e5 100644 --- a/kbackgammon/engines/fibs/kplayerlist.cpp +++ b/kbackgammon/engines/fibs/kplayerlist.cpp @@ -24,15 +24,15 @@ #include "kplayerlist.moc" #include "kplayerlist.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -63,13 +63,13 @@ public: int index, width; bool show; - QCheckBox *cb; - QString key, name; + TQCheckBox *cb; + TQString key, name; }; /* - * Extension of the QListViewItem class that has a custom key function + * Extension of the TQListViewItem class that has a custom key function * that can deal with the different items of the player list. */ class KFibsPlayerListLVI : public KListViewItem { @@ -89,11 +89,11 @@ public: /* * Overloaded key function for sorting */ - virtual QString key(int col, bool) const + virtual TQString key(int col, bool) const { int real_col = _plist->cIndex(col); - QString s = text(col); + TQString s = text(col); switch (real_col) { case KFibsPlayerList::Player: @@ -155,7 +155,7 @@ public: /* * Context menus for player related commands */ - QPopupMenu *mPm[2]; + TQPopupMenu *mPm[2]; /* * ID of the invite menu in the context menu @@ -175,22 +175,22 @@ public: /* * Short abbreviations for Blind, Ready, and Away. */ - QString mAbrv[KFibsPlayerList::MaxStatus]; + TQString mAbrv[KFibsPlayerList::MaxStatus]; /* * Name of the last selected player - for internal purposes */ - QString mUser; + TQString mUser; /* * Our own name */ - QString mName; + TQString mName; /* * Email address of the last selected player - for internal purposes */ - QString mMail; + TQString mMail; }; @@ -200,7 +200,7 @@ public: /* * Construct the playerlist and do some initial setup */ -KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) +KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) : KListView(parent, name) { d = new KFibsPlayerListPrivate(); @@ -246,7 +246,7 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) d->mAbrv[Away ] = i18n("abreviate away", "A"); d->mAbrv[Ready] = i18n("abreviate ready", "R"); - d->mName = QString::null; + d->mName = TQString::null; d->mWatch = false; @@ -256,7 +256,7 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) */ updateCaption(); setIcon(kapp->miniIcon()); - QWhatsThis::add(this, i18n("This window contains the player list. It shows " + TQWhatsThis::add(this, i18n("This window contains the player list. It shows " "all players that are currently logged into FIBS." "Use the right mouse button to get a context " "menu with helpful information and commands.")); @@ -280,51 +280,51 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) /* * Create context menus */ - d->mPm[0] = new QPopupMenu(); - d->mPm[1] = new QPopupMenu(); + d->mPm[0] = new TQPopupMenu(); + d->mPm[1] = new TQPopupMenu(); /* * Create the whole set of actions */ d->mAct[KFibsPlayerListPrivate::Info] = new KAction(i18n("Info"), - QIconSet(kapp->iconLoader()->loadIcon + TQIconSet(kapp->iconLoader()->loadIcon ("help.xpm", KIcon::Small)), - 0, this, SLOT(slotInfo()), actions); + 0, this, TQT_SLOT(slotInfo()), actions); d->mAct[KFibsPlayerListPrivate::Talk] = new KAction(i18n("Talk"), - QIconSet(kapp->iconLoader()->loadIcon + TQIconSet(kapp->iconLoader()->loadIcon (PROG_NAME "-chat.png", KIcon::Small)), - 0, this, SLOT(slotTalk()), actions); + 0, this, TQT_SLOT(slotTalk()), actions); - d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, SLOT(slotLook()), actions); - d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, SLOT(slotWatch()), actions); - d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, SLOT(slotUnwatch()),actions); - d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, SLOT(slotBlind()), actions); - d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, SLOT(slotUpdate()), actions); + d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, TQT_SLOT(slotLook()), actions); + d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, TQT_SLOT(slotWatch()), actions); + d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, TQT_SLOT(slotUnwatch()),actions); + d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, TQT_SLOT(slotBlind()), actions); + d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, TQT_SLOT(slotUpdate()), actions); - d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, SLOT(slotReload()), actions); - d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, SLOT(slotMail()), actions); - d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, SLOT(hide()), actions); + d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, TQT_SLOT(slotReload()), actions); + d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, TQT_SLOT(slotMail()), actions); + d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions); d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, - SLOT(slotInviteD()), actions); + TQT_SLOT(slotInviteD()), actions); d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, - SLOT(slotInvite1()), actions); + TQT_SLOT(slotInvite1()), actions); d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, - SLOT(slotInvite2()), actions); + TQT_SLOT(slotInvite2()), actions); d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, - SLOT(slotInvite3()), actions); + TQT_SLOT(slotInvite3()), actions); d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, - SLOT(slotInvite4()), actions); + TQT_SLOT(slotInvite4()), actions); d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, - SLOT(slotInvite5()), actions); + TQT_SLOT(slotInvite5()), actions); d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, - SLOT(slotInvite6()), actions); + TQT_SLOT(slotInvite6()), actions); d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, - SLOT(slotInvite7()), actions); + TQT_SLOT(slotInvite7()), actions); d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, - SLOT(slotInviteU()), actions); + TQT_SLOT(slotInviteU()), actions); d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, - SLOT(slotInviteR()), actions); + TQT_SLOT(slotInviteR()), actions); /* * Fill normal context menu @@ -363,10 +363,10 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name) /* * Right mouse button gets context menu, double click gets player info */ - connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), - this, SLOT(showContextMenu(KListView *, QListViewItem *, const QPoint &))); - connect(this, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), - this, SLOT(getPlayerInfo(QListViewItem *, const QPoint &, int))); + connect(this, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint &)), + this, TQT_SLOT(showContextMenu(KListView *, TQListViewItem *, const TQPoint &))); + connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem *, const TQPoint &, int)), + this, TQT_SLOT(getPlayerInfo(TQListViewItem *, const TQPoint &, int))); } /* @@ -444,13 +444,13 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) /* * Main Widget */ - QWidget *w = new QWidget(nb); - QGridLayout *gl = new QGridLayout(w, 2, 1, space); + TQWidget *w = new TQWidget(nb); + TQGridLayout *gl = new TQGridLayout(w, 2, 1, space); /* * Label */ - QGroupBox *gbl = new QGroupBox(w); + TQGroupBox *gbl = new TQGroupBox(w); gbl->setTitle(i18n("Column Selection")); gl->addWidget(gbl, 0, 0); @@ -458,15 +458,15 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) /* * Note that the first column (Player == 0) is always there */ - QLabel *lb = new QLabel(i18n("Select all the columns that you would\n" + TQLabel *lb = new TQLabel(i18n("Select all the columns that you would\n" "like to be shown in the player list."), gbl); for (i = 1; i < LVEnd; i++) { - d->mCol[i]->cb = new QCheckBox(d->mCol[i]->name, gbl); + d->mCol[i]->cb = new TQCheckBox(d->mCol[i]->name, gbl); d->mCol[i]->cb->setChecked(d->mCol[i]->show); } - gl = new QGridLayout(gbl, LVEnd, 2, 20); + gl = new TQGridLayout(gbl, LVEnd, 2, 20); gl->addWidget(lb, 0, 0); // two column layout.... @@ -483,7 +483,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) */ nb->addTab(w, i18n("&Playerlist")); - connect(nb, SIGNAL(applyButtonPressed()), this, SLOT(setupOk())); + connect(nb, TQT_SIGNAL(applyButtonPressed()), this, TQT_SLOT(setupOk())); } /* @@ -525,7 +525,7 @@ void KFibsPlayerList::readConfig() KConfig* config = kapp->config(); config->setGroup(name()); - QPoint pos, defpos(10, 10); + TQPoint pos, defpos(10, 10); pos = config->readPointEntry("ori", &defpos); setGeometry(pos.x(), pos.y(), config->readNumEntry("wdt",460), config->readNumEntry("hgt",190)); @@ -562,12 +562,12 @@ void KFibsPlayerList::saveConfig() /* * Save selected player, update the menu entries and show the popup menu */ -void KFibsPlayerList::showContextMenu(KListView *, QListViewItem *i, const QPoint &p) +void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPoint &p) { /* * Get the name of the selected player */ - d->mUser = (i ? i->text(Player) : QString::null); + d->mUser = (i ? i->text(Player) : TQString::null); d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).arg(d->mUser)); d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).arg(d->mUser)); @@ -589,7 +589,7 @@ void KFibsPlayerList::showContextMenu(KListView *, QListViewItem *i, const QPoin d->mPm[0]->setItemEnabled(d->mInID, i && d->mName != d->mUser); d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").arg(d->mUser)); - d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : QString::null); + d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString::null); d->mAct[KFibsPlayerListPrivate::Mail]->setEnabled(!d->mMail.isEmpty()); if (i && d->mCol[Status]->show) @@ -657,7 +657,7 @@ void KFibsPlayerList::slotLook() */ void KFibsPlayerList::slotMail() { - kapp->invokeMailer(d->mMail, QString::null); + kapp->invokeMailer(d->mMail, TQString::null); } /* @@ -680,7 +680,7 @@ void KFibsPlayerList::slotWatch() /* * Request information about the selected user */ -void KFibsPlayerList::getPlayerInfo(QListViewItem *i, const QPoint &, int col) +void KFibsPlayerList::getPlayerInfo(TQListViewItem *i, const TQPoint &, int col) { int num = cIndex(col); if (col < 0 || num < 0 || num > 2 || i->text(num).isEmpty()) @@ -713,13 +713,13 @@ void KFibsPlayerList::slotInviteR() { emit fibsCommand("invite " + d->mUser); } * Add or change the entry of player with the corresponding string * from the server - rawwho */ -void KFibsPlayerList::changePlayer(const QString &line) +void KFibsPlayerList::changePlayer(const TQString &line) { char entry[LVEnd][100]; char ready[2], away[2]; - QListViewItem *i; - QDateTime fromEpoch; - QString str_entry[LVEnd], tmp; + TQListViewItem *i; + TQDateTime fromEpoch; + TQString str_entry[LVEnd], tmp; entry[Status][0] = '\0'; @@ -746,7 +746,7 @@ void KFibsPlayerList::changePlayer(const QString &line) setUpdatesEnabled(false); // try to find the item in the list - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(0) == str_entry[Player]) { i = it.current(); @@ -789,9 +789,9 @@ void KFibsPlayerList::changePlayer(const QString &line) /* * Remove player from the list */ -void KFibsPlayerList::deletePlayer(const QString &player) +void KFibsPlayerList::deletePlayer(const TQString &player) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(0) == player) { if (it.current()->text(Client).contains(PROG_NAME)) @@ -808,14 +808,14 @@ void KFibsPlayerList::deletePlayer(const QString &player) /* * Set/Unset the status stat in the corresponding column of the list */ -void KFibsPlayerList::changePlayerStatus(const QString &player, int stat, bool flag) +void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool flag) { - QListViewItem *i = 0; + TQListViewItem *i = 0; /* * Find the correct line */ - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(Player) == player) { i = it.current(); @@ -847,7 +847,7 @@ int KFibsPlayerList::cIndex(int col) /* * Catch hide events, so the engine's menu can be update. */ -void KFibsPlayerList::showEvent(QShowEvent *e) +void KFibsPlayerList::showEvent(TQShowEvent *e) { KListView::showEvent(e); emit windowVisible(true); @@ -856,7 +856,7 @@ void KFibsPlayerList::showEvent(QShowEvent *e) /* * Catch hide events, so the engine's menu can be update. */ -void KFibsPlayerList::hideEvent(QHideEvent *e) +void KFibsPlayerList::hideEvent(TQHideEvent *e) { emit windowVisible(false); KListView::hideEvent(e); @@ -875,7 +875,7 @@ void KFibsPlayerList::stopUpdate() * Knowing our own name allows us to disable certain menu entries for * ourselves. */ -void KFibsPlayerList::setName(const QString &name) +void KFibsPlayerList::setName(const TQString &name) { d->mName = name; } @@ -896,7 +896,7 @@ void KFibsPlayerList::clear() { d->mCount[0] = 0; d->mCount[1] = 0; - QListView::clear(); + TQListView::clear(); } // EOF diff --git a/kbackgammon/engines/fibs/kplayerlist.h b/kbackgammon/engines/fibs/kplayerlist.h index 701f9ace..27fd825f 100644 --- a/kbackgammon/engines/fibs/kplayerlist.h +++ b/kbackgammon/engines/fibs/kplayerlist.h @@ -63,7 +63,7 @@ public: /** * Constructor */ - KFibsPlayerList(QWidget *parent = 0, const char *name = 0); + KFibsPlayerList(TQWidget *parent = 0, const char *name = 0); /** * Destructor @@ -80,12 +80,12 @@ public slots: /** * Remove the player with the name given by the first word */ - void deletePlayer(const QString &player); + void deletePlayer(const TQString &player); /** * Change/Add the entry for the given player */ - void changePlayer(const QString &line); + void changePlayer(const TQString &line); /** * Enables list redraws after an update @@ -110,7 +110,7 @@ public slots: /** * Change the status of a player */ - void changePlayerStatus(const QString &player, int stat, bool flag); + void changePlayerStatus(const TQString &player, int stat, bool flag); /** * Fills the playerlist page into the notebook @@ -136,7 +136,7 @@ public slots: * Set our own name. This allows us to special case the context * menu. */ - void setName(const QString &name); + void setName(const TQString &name); /** * Return the column index @@ -148,24 +148,24 @@ protected: /** * Catch show events, so the engine's menu can be update. */ - virtual void showEvent(QShowEvent *e); + virtual void showEvent(TQShowEvent *e); /** * Catch hide events, so the engine's menu can be update. */ - virtual void hideEvent(QHideEvent *e); + virtual void hideEvent(TQHideEvent *e); protected slots: /** * Double click handler, requests information on a player */ - void getPlayerInfo(QListViewItem *i, const QPoint &p, int col); + void getPlayerInfo(TQListViewItem *i, const TQPoint &p, int col); /** * Display a popup menu for the current player */ - void showContextMenu(KListView *, QListViewItem *, const QPoint &); + void showContextMenu(KListView *, TQListViewItem *, const TQPoint &); /** * Reload the whole list @@ -272,17 +272,17 @@ signals: /** * Send a command to the server */ - void fibsCommand(const QString &); + void fibsCommand(const TQString &); /** * Initiate an invitation of a player */ - void fibsInvite(const QString &); + void fibsInvite(const TQString &); /** * Request talking to player user */ - void fibsTalk(const QString &); + void fibsTalk(const TQString &); /** * Allow the engine's menu to be updated diff --git a/kbackgammon/engines/generic/kbgengine.cpp b/kbackgammon/engines/generic/kbgengine.cpp index bbe528a6..59c19e2f 100644 --- a/kbackgammon/engines/generic/kbgengine.cpp +++ b/kbackgammon/engines/generic/kbgengine.cpp @@ -21,8 +21,8 @@ */ -#include -#include +#include +#include #include @@ -33,13 +33,13 @@ /* * Constructor initializes the QObject */ -KBgEngine::KBgEngine(QWidget *parent, QString *name, QPopupMenu *pmenu) - : QObject(parent, name->local8Bit()) +KBgEngine::KBgEngine(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) + : TQObject(parent, name->local8Bit()) { menu = pmenu; cl = -1; - ct = new QTimer(this); - connect(ct, SIGNAL(timeout()), this, SLOT(done())); + ct = new TQTimer(this); + connect(ct, TQT_SIGNAL(timeout()), this, TQT_SLOT(done())); } /* diff --git a/kbackgammon/engines/generic/kbgengine.h b/kbackgammon/engines/generic/kbgengine.h index ee672f40..2dd3a9a9 100644 --- a/kbackgammon/engines/generic/kbgengine.h +++ b/kbackgammon/engines/generic/kbgengine.h @@ -28,7 +28,7 @@ #include #endif -#include +#include class QTimer; class QPopupMenu; @@ -67,7 +67,7 @@ class KBgEngine:public QObject /** * Constructor */ - KBgEngine (QWidget * parent = 0, QString * name = 0, QPopupMenu * pmenu = 0); + KBgEngine (TQWidget * parent = 0, TQString * name = 0, TQPopupMenu * pmenu = 0); /** * Destructor @@ -179,7 +179,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove (QString * s) = 0; + virtual void handleMove (TQString * s) = 0; /** * Undo the last move @@ -214,7 +214,7 @@ public slots: /** * Process the string cmd */ - virtual void handleCommand (const QString & cmd) = 0; + virtual void handleCommand (const TQString & cmd) = 0; /** * Start a new game @@ -237,12 +237,12 @@ signals: * The text identifies the current game status - could be put * into the main window caption */ - void statText (const QString & msg); + void statText (const TQString & msg); /** * Text that should be displayed in the ongoing message window */ - void infoText (const QString & msg); + void infoText (const TQString & msg); /** * Emit the most recent game state @@ -285,12 +285,12 @@ protected: /** * Context menu for the board */ - QPopupMenu * menu; + TQPopupMenu * menu; /** * Commit timer */ - QTimer *ct; + TQTimer *ct; int cl; }; diff --git a/kbackgammon/engines/gnubg/kbggnubg.cpp b/kbackgammon/engines/gnubg/kbggnubg.cpp index eaaa4bdf..d17a6f88 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.cpp +++ b/kbackgammon/engines/gnubg/kbggnubg.cpp @@ -29,17 +29,17 @@ #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include #include #include -#include +#include #include #include @@ -75,17 +75,17 @@ void KBgEngineGNU::doubleCube(const int w) -void KBgEngineGNU::handleLine(const QString &l) +void KBgEngineGNU::handleLine(const TQString &l) { if (l.isEmpty()) return; - QString line(l); + TQString line(l); /* * Start of a new game/match */ - if (line.contains(QRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) { + if (line.contains(TQRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) { KRegExp e("^gnubg rolls ([1-6]), .* rolls ([1-6])\\."); e.match(line.latin1()); if (int r = strcmp(e.group(1), e.group(2))) @@ -95,14 +95,14 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Bug fixes for older versions of GNUBG - to be removed */ - if (line.contains(QRegExp("^.* cannot move\\..+$"))) { + if (line.contains(TQRegExp("^.* cannot move\\..+$"))) { KRegExp e("(^.* cannot move.)(.*$)"); e.match(line.latin1()); handleLine(e.group(1)); handleLine(e.group(2)); return; } - if (line.contains(QRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) { + if (line.contains(TQRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) { KRegExp e("(^Are you sure you want to start a new game, and discard the one in progress\\? )(.+$)"); e.match(line.latin1()); handleLine(e.group(1)); @@ -113,7 +113,7 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Cube handling */ - if (line.contains(QRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) { + if (line.contains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) { // redoubles mess up the game counter "turn" @@ -122,7 +122,7 @@ void KBgEngineGNU::handleLine(const QString &l) //emit newState(st); } - if (line.contains(QRegExp("^gnubg doubles\\.$"))) { + if (line.contains(TQRegExp("^gnubg doubles\\.$"))) { // TODO: we need some generic class for this. the class // can be shared between all engines @@ -155,14 +155,14 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Ignore the following messages */ - if (line.contains(QRegExp("^TTY boards will be given in raw format"))) { + if (line.contains(TQRegExp("^TTY boards will be given in raw format"))) { line = " "; } /* * Board messages */ - if (line.contains(QRegExp("^board:"))) { + if (line.contains(TQRegExp("^board:"))) { KBgStatus st(line); @@ -248,7 +248,7 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Show the line... */ - line.replace(QRegExp(" "), " "); + line.replace(TQRegExp(" "), " "); if (!line.isEmpty()) emit infoText(line); } @@ -257,7 +257,7 @@ void KBgEngineGNU::handleLine(const QString &l) /* * Handle textual commands. All commands are passed to gnubg. */ -void KBgEngineGNU::handleCommand(const QString& cmd) +void KBgEngineGNU::handleCommand(const TQString& cmd) { cmdList += cmd; nextCommand(); @@ -275,10 +275,10 @@ void KBgEngineGNU::newGame() /* * If there is a game running we warn the user first */ - if (gameRunning && (KMessageBox::warningYesNo((QWidget *)parent(), + if (gameRunning && (KMessageBox::warningYesNo((TQWidget *)parent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - QString::null, i18n("Start New Game"), i18n("Continue Old Game")) + TQString::null, i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -379,7 +379,7 @@ void KBgEngineGNU::getSetupPages(KDialogBase *nb) /* * Main Widget */ - QVBox *w = nb->addVBoxPage(i18n("GNU Engine"), i18n("Here you can configure the GNU backgammon engine"), + TQVBox *w = nb->addVBoxPage(i18n("GNU Engine"), i18n("Here you can configure the GNU backgammon engine"), kapp->iconLoader()->loadIcon(PROG_NAME "_engine", KIcon::Desktop)); } @@ -422,7 +422,7 @@ void KBgEngineGNU::saveConfig() /* * Constructor */ -KBgEngineGNU::KBgEngineGNU(QWidget *parent, QString *name, QPopupMenu *pmenu) +KBgEngineGNU::KBgEngineGNU(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) : KBgEngine(parent, name, pmenu) { // obsolete @@ -434,12 +434,12 @@ KBgEngineGNU::KBgEngineGNU(QWidget *parent, QString *name, QPopupMenu *pmenu) * internal statue variables */ rollingAllowed = undoPossible = gameRunning = donePossible = false; - connect(this, SIGNAL(allowCommand(int, bool)), this, SLOT(setAllowed(int, bool))); + connect(this, TQT_SIGNAL(allowCommand(int, bool)), this, TQT_SLOT(setAllowed(int, bool))); /* * Setup of menu */ - resAction = new KAction(i18n("&Restart GNU Backgammon"), 0, this, SLOT(startGNU()), this); + resAction = new KAction(i18n("&Restart GNU Backgammon"), 0, this, TQT_SLOT(startGNU()), this); resAction->setEnabled(false); resAction->plug(menu); /* @@ -468,8 +468,8 @@ void KBgEngineGNU::start() /* * Will be started later */ - cmdTimer = new QTimer(this); - connect(cmdTimer, SIGNAL(timeout()), SLOT(nextCommand()) ); + cmdTimer = new TQTimer(this); + connect(cmdTimer, TQT_SIGNAL(timeout()), TQT_SLOT(nextCommand()) ); emit infoText(i18n("This is experimental code which currently requires a specially " "patched version of GNU Backgammon.

")); @@ -484,12 +484,12 @@ void KBgEngineGNU::start() */ gnubg << "gnubg" << "--tty"; - connect(&gnubg, SIGNAL(processExited(KProcess *)), this, SLOT(gnubgExit(KProcess *))); - connect(&gnubg, SIGNAL(receivedStderr(KProcess *, char *, int)), - this, SLOT(receiveData(KProcess *, char *, int))); - connect(&gnubg, SIGNAL(receivedStdout(KProcess *, char *, int)), - this, SLOT(receiveData(KProcess *, char *, int))); - connect(&gnubg, SIGNAL(wroteStdin(KProcess *)), this, SLOT(wroteStdin(KProcess *))); + connect(&gnubg, TQT_SIGNAL(processExited(KProcess *)), this, TQT_SLOT(gnubgExit(KProcess *))); + connect(&gnubg, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), + this, TQT_SLOT(receiveData(KProcess *, char *, int))); + connect(&gnubg, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), + this, TQT_SLOT(receiveData(KProcess *, char *, int))); + connect(&gnubg, TQT_SIGNAL(wroteStdin(KProcess *)), this, TQT_SLOT(wroteStdin(KProcess *))); startGNU(); } @@ -503,7 +503,7 @@ void KBgEngineGNU::startGNU() resAction->setEnabled(false); if (!gnubg.start(KProcess::NotifyOnExit, KProcess::All)) - KMessageBox::information((QWidget *)parent(), + KMessageBox::information((TQWidget *)parent(), i18n("Could not start the GNU Backgammon process.\n" "Make sure the program is in your PATH and is " "called \"gnubg\".\n" @@ -532,7 +532,7 @@ void KBgEngineGNU::gnubgExit(KProcess *proc) emit allowMoving(false); - emit infoText(QString("
") + i18n("The GNU Backgammon process (%1) has exited. ") + emit infoText(TQString("
") + i18n("The GNU Backgammon process (%1) has exited. ") .arg(proc->pid()) + "
"); resAction->setEnabled(true); @@ -560,16 +560,16 @@ void KBgEngineGNU::nextCommand() if (!gnubg.isRunning()) return; - for (QStringList::Iterator it = cmdList.begin(); it != cmdList.end(); ++it) { - QString s = (*it) + "\n"; + for (TQStringList::Iterator it = cmdList.begin(); it != cmdList.end(); ++it) { + TQString s = (*it) + "\n"; if (!gnubg.writeStdin(s.latin1(), strlen(s.latin1()))) { cmdTimer->start(250, true); - cmdList.remove(QString::null); + cmdList.remove(TQString::null); return; } - (*it) = QString::null; + (*it) = TQString::null; } - cmdList.remove(QString::null); + cmdList.remove(TQString::null); cmdTimer->stop(); } @@ -587,7 +587,7 @@ void KBgEngineGNU::receiveData(KProcess *proc, char *buffer, int buflen) memcpy(buf, buffer, buflen); buf[buflen] = '\0'; - QStringList l(QStringList::split('\n', buf, true)); + TQStringList l(TQStringList::split('\n', buf, true)); /* * Restore partial lines from the previous time @@ -604,7 +604,7 @@ void KBgEngineGNU::receiveData(KProcess *proc, char *buffer, int buflen) /* * Handle the information from gnubg */ - for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) + for (TQStringList::Iterator it = l.begin(); it != l.end(); ++it) handleLine(*it); } @@ -626,8 +626,8 @@ void KBgEngineGNU::done() // Transform the string to FIBS format lastmove.replace(0, 2, "move "); - lastmove.replace(QRegExp("\\+"), " "); - lastmove.replace(QRegExp("\\-"), " "); + lastmove.replace(TQRegExp("\\+"), " "); + lastmove.replace(TQRegExp("\\-"), " "); // sent it to the server handleCommand(lastmove); @@ -664,12 +664,12 @@ void KBgEngineGNU::redo() * Take the move string and make the changes on the working copy * of the state. */ -void KBgEngineGNU::handleMove(QString *s) +void KBgEngineGNU::handleMove(TQString *s) { lastmove = *s; int index = 0; - QString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->find(' ', index)); index += 1 + t.length(); int moves = t.toInt(); diff --git a/kbackgammon/engines/gnubg/kbggnubg.h b/kbackgammon/engines/gnubg/kbggnubg.h index 3240b8b1..acb007f1 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.h +++ b/kbackgammon/engines/gnubg/kbggnubg.h @@ -30,12 +30,12 @@ #include -#include -#include +#include +#include #include #include #include -#include +#include /** * @@ -50,7 +50,7 @@ public: /* * Constructor and destructor */ - KBgEngineGNU(QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0); + KBgEngineGNU(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); virtual ~KBgEngineGNU(); /** @@ -96,7 +96,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove(QString *s); + virtual void handleMove(TQString *s); /** * Undo the last move @@ -136,7 +136,7 @@ public slots: /** * Process the string cmd */ - virtual void handleCommand(const QString& cmd); + virtual void handleCommand(const TQString& cmd); /** * Start a new game. @@ -163,7 +163,7 @@ private: /** * Player's names */ - QString nameUS, nameTHEM; + TQString nameUS, nameTHEM; /** * Who did the last roll @@ -192,15 +192,15 @@ private: KProcess gnubg; - QStringList cmdList; + TQStringList cmdList; - QTimer *cmdTimer; + TQTimer *cmdTimer; - QString partline; + TQString partline; - QString board; + TQString board; - QString lastmove; + TQString lastmove; int turn; @@ -212,7 +212,7 @@ protected slots: void receiveData(KProcess *, char *buffer, int buflen); - void handleLine(const QString &l); + void handleLine(const TQString &l); void gnubgExit(KProcess *proc); diff --git a/kbackgammon/engines/nextgen/kbggame.cpp b/kbackgammon/engines/nextgen/kbggame.cpp index 6ee709e1..13ae076a 100644 --- a/kbackgammon/engines/nextgen/kbggame.cpp +++ b/kbackgammon/engines/nextgen/kbggame.cpp @@ -31,13 +31,13 @@ /* * Constructor */ -KBgGame::KBgGame(int cookie, QObject *parent) +KBgGame::KBgGame(int cookie, TQObject *parent) : KGame(cookie, parent) { // do nothing... } -bool KBgGame::playerInput(QDataStream &msg,KPlayer *player) +bool KBgGame::playerInput(TQDataStream &msg,KPlayer *player) { Q_INT32 move; msg >> move; diff --git a/kbackgammon/engines/nextgen/kbggame.h b/kbackgammon/engines/nextgen/kbggame.h index fea5f516..1c045433 100644 --- a/kbackgammon/engines/nextgen/kbggame.h +++ b/kbackgammon/engines/nextgen/kbggame.h @@ -45,11 +45,11 @@ public: enum MsgID {Text, Cmd, MaxMsg}; - KBgGame(int cookie = 42, QObject *parent = 0); + KBgGame(int cookie = 42, TQObject *parent = 0); protected: - virtual bool playerInput(QDataStream &msg,KPlayer *player); + virtual bool playerInput(TQDataStream &msg,KPlayer *player); }; diff --git a/kbackgammon/engines/nextgen/kbgng.cpp b/kbackgammon/engines/nextgen/kbgng.cpp index 6518147c..302cbb58 100644 --- a/kbackgammon/engines/nextgen/kbgng.cpp +++ b/kbackgammon/engines/nextgen/kbgng.cpp @@ -29,19 +29,19 @@ #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #include @@ -51,30 +51,30 @@ /* * Constructor */ -KBgEngineNg::KBgEngineNg(QWidget *parent, QString *name, QPopupMenu *pmenu) +KBgEngineNg::KBgEngineNg(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) : KBgEngine(parent, name, pmenu) { // get a new game initGame(); // create actions and menus - QString label[MaxTypes]; + TQString label[MaxTypes]; label[Local ] = i18n("Local Games"); label[NetServer] = i18n("Offer Network Games"); label[NetClient] = i18n("Join Network Games"); - QStringList list; + TQStringList list; for (int i = 0; i < MaxTypes; i++) list.append(label[i]); - _gameSelect = new KSelectAction(i18n("&Types"), 0, this, SLOT(setGame()), this); + _gameSelect = new KSelectAction(i18n("&Types"), 0, this, TQT_SLOT(setGame()), this); _gameSelect->setItems(list); _gameSelect->plug(menu); menu->insertSeparator(); - _connectAction = new KAction(i18n("&Names..."), 0, this, SLOT(changeName()), this); + _connectAction = new KAction(i18n("&Names..."), 0, this, TQT_SLOT(changeName()), this); _connectAction->plug(menu); // Restore last settings @@ -123,7 +123,7 @@ void KBgEngineNg::setGame() // initialize a new game bool ret = false; - QString label, port_s, host_s; + TQString label, port_s, host_s; Q_UINT16 port; switch (_currGame = _gameSelect->currentItem()) { @@ -140,7 +140,7 @@ void KBgEngineNg::setGame() "65535."); port_s.setNum(_port); do { - port_s = KLineEditDlg::getText(label, port_s, &ret, (QWidget *)parent()); + port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent()); if (!ret) return; port = port_s.toUShort(&ret); @@ -159,7 +159,7 @@ void KBgEngineNg::setGame() label = i18n("Type the name of the server you want to connect to:"); host_s = _host; do { - host_s = KLineEditDlg::getText(label, host_s, &ret, (QWidget *)parent()); + host_s = KLineEditDlg::getText(label, host_s, &ret, (TQWidget *)parent()); if (!ret) return; } while (host_s.isEmpty()); @@ -168,7 +168,7 @@ void KBgEngineNg::setGame() "number should be between 1024 and 65535.").arg(host_s); port_s.setNum(_port); do { - port_s = KLineEditDlg::getText(label, port_s, &ret, (QWidget *)parent()); + port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent()); if (!ret) return; port = port_s.toUShort(&ret); @@ -311,7 +311,7 @@ void KBgEngineNg::redo() * Take the move string and make the changes on the working copy * of the state. */ -void KBgEngineNg::handleMove(QString *s) +void KBgEngineNg::handleMove(TQString *s) { Q_UNUSED(s) // TODO @@ -477,10 +477,10 @@ void KBgEngineNg::saveConfig() * players. Although the message gets the Cmd ID, it is currently * handled as a regular text message. */ -void KBgEngineNg::handleCommand(const QString& text) +void KBgEngineNg::handleCommand(const TQString& text) { - QByteArray msg; - QTextStream ts(msg, IO_WriteOnly); + TQByteArray msg; + TQTextStream ts(msg, IO_WriteOnly); ts << text; if (!_game->sendMessage(msg, KBgGame::Cmd)) kdDebug(true, PROG_COOKIE) << "couldn't send message: " @@ -539,17 +539,17 @@ void KBgEngineNg::slotPropertyChanged(KGamePropertyBase *p, KGame *me) void KBgEngineNg::changeName() { bool ok = false; - QString name; + TQString name; for (int i = 0; i < 2; i++) { - name = QString::null; + name = TQString::null; while (!_player[i]->isVirtual() && name.isEmpty()) { if (i == 0) name = KLineEditDlg::getText(i18n("Type the name of the first player:"), - _name[i], &ok, (QWidget *)parent()); + _name[i], &ok, (TQWidget *)parent()); else name = KLineEditDlg::getText(i18n("Type the name of the second player:"), - _name[i], &ok, (QWidget *)parent()); + _name[i], &ok, (TQWidget *)parent()); if (!ok) return; _player[i]->setName(name); } @@ -559,7 +559,7 @@ void KBgEngineNg::changeName() /* * Receive data sent via KBgGame::sendMessage(...) */ -void KBgEngineNg::slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 r, Q_UINT32 s) +void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 r, Q_UINT32 s) { Q_UNUSED(r); Q_UNUSED(s); @@ -580,7 +580,7 @@ void KBgEngineNg::slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 r, /* * Create the i-th player */ -KBgPlayer * KBgEngineNg::createPlayer(int i, QString name) +KBgPlayer * KBgEngineNg::createPlayer(int i, TQString name) { KBgPlayer *p = new KBgPlayer(); @@ -589,8 +589,8 @@ KBgPlayer * KBgEngineNg::createPlayer(int i, QString name) p->findProperty(KGamePropertyBase::IdName)->setEmittingSignal(true); - connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase *, KPlayer *)), - this, SLOT(slotPropertyChanged(KGamePropertyBase *, KPlayer *))); + connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KPlayer *)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase *, KPlayer *))); return (_player[i] = p); } @@ -603,20 +603,20 @@ void KBgEngineNg::initGame() _game = new KBgGame(PROG_COOKIE); _game->random()->setSeed(getpid()*time(NULL)); - connect(_game, SIGNAL(signalPlayerJoinedGame(KPlayer *)), - this, SLOT(slotPlayerJoinedGame(KPlayer *))); - connect(_game, SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)), - this, SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *))); + connect(_game, TQT_SIGNAL(signalPlayerJoinedGame(KPlayer *)), + this, TQT_SLOT(slotPlayerJoinedGame(KPlayer *))); + connect(_game, TQT_SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)), + this, TQT_SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *))); - connect(_game, SIGNAL(signalClientConnected(Q_UINT32)), - this, SLOT(slotClientConnected(Q_UINT32))); - connect(_game, SIGNAL(signalClientDisconnected(Q_UINT32, bool)), - this, SLOT(slotClientDisconnected(Q_UINT32, bool))); + connect(_game, TQT_SIGNAL(signalClientConnected(Q_UINT32)), + this, TQT_SLOT(slotClientConnected(Q_UINT32))); + connect(_game, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool)), + this, TQT_SLOT(slotClientDisconnected(Q_UINT32, bool))); - connect(_game, SIGNAL(signalPropertyChanged(KGamePropertyBase *, KGame *)), - this, SLOT(slotPropertyChanged(KGamePropertyBase *, KGame *))); - connect(_game, SIGNAL(signalNetworkData(int,const QByteArray &, Q_UINT32, Q_UINT32)), - this, SLOT(slotNetworkData(int,const QByteArray &, Q_UINT32, Q_UINT32))); + connect(_game, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KGame *)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase *, KGame *))); + connect(_game, TQT_SIGNAL(signalNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32)), + this, TQT_SLOT(slotNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32))); } // EOF diff --git a/kbackgammon/engines/nextgen/kbgng.h b/kbackgammon/engines/nextgen/kbgng.h index 149f3bf6..99ea82c1 100644 --- a/kbackgammon/engines/nextgen/kbgng.h +++ b/kbackgammon/engines/nextgen/kbgng.h @@ -29,10 +29,10 @@ #endif -#include -#include +#include +#include #include -#include +#include #include #include @@ -57,7 +57,7 @@ public: /* * Constructor and destructor */ - KBgEngineNg( QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0); + KBgEngineNg( TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); virtual ~KBgEngineNg(); /** @@ -107,7 +107,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove(QString *s); + virtual void handleMove(TQString *s); /** * Undo the last move @@ -142,7 +142,7 @@ public slots: /** * Process the string text */ - virtual void handleCommand(const QString& text); + virtual void handleCommand(const TQString& text); /** * Start a new game. @@ -152,7 +152,7 @@ public slots: void slotPlayerJoinedGame(KPlayer *p); - void slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender); + void slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender); void slotCreatePlayer(KPlayer *&, int, int, bool, KGame *); void slotClientDisconnected(Q_UINT32, bool); @@ -219,7 +219,7 @@ private: int _nplayers; - QString _host; + TQString _host; Q_UINT16 _port; // ************************************************************ @@ -248,13 +248,13 @@ private: * the player is @ref _player. That means that the players are * automatically deleted. */ - KBgPlayer * createPlayer(int i, QString name = QString::null); + KBgPlayer * createPlayer(int i, TQString name = TQString::null); private: KBgGame* _game; - QString _name[2]; + TQString _name[2]; KBgPlayer* _player[2]; diff --git a/kbackgammon/engines/nextgen/kbgplayer.cpp b/kbackgammon/engines/nextgen/kbgplayer.cpp index f0b3a7ed..d1d8b998 100644 --- a/kbackgammon/engines/nextgen/kbgplayer.cpp +++ b/kbackgammon/engines/nextgen/kbgplayer.cpp @@ -48,13 +48,13 @@ int KBgPlayer::rtti() const return 10500; } -bool KBgPlayer::load(QDataStream &stream) +bool KBgPlayer::load(TQDataStream &stream) { KPlayer::load(stream); cerr << "-------- KBgPlayer::load" << endl; return false; } -bool KBgPlayer::save(QDataStream &stream) +bool KBgPlayer::save(TQDataStream &stream) { KPlayer::save(stream); cerr << "-------- KBgPlayer::save" << endl; diff --git a/kbackgammon/engines/nextgen/kbgplayer.h b/kbackgammon/engines/nextgen/kbgplayer.h index 7c11d83c..8d6536de 100644 --- a/kbackgammon/engines/nextgen/kbgplayer.h +++ b/kbackgammon/engines/nextgen/kbgplayer.h @@ -29,7 +29,7 @@ #endif #include -#include +#include class KGame; @@ -49,8 +49,8 @@ public: virtual int rtti() const; - virtual bool load(QDataStream &stream); - virtual bool save(QDataStream &stream); + virtual bool load(TQDataStream &stream); + virtual bool save(TQDataStream &stream); }; diff --git a/kbackgammon/engines/offline/kbgoffline.cpp b/kbackgammon/engines/offline/kbgoffline.cpp index 920dc741..4a9e1755 100644 --- a/kbackgammon/engines/offline/kbgoffline.cpp +++ b/kbackgammon/engines/offline/kbgoffline.cpp @@ -24,14 +24,14 @@ #include "kbgoffline.moc" #include "kbgoffline.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -76,7 +76,7 @@ public: /* * Player's names */ - QString mName[2]; + TQString mName[2]; /* * Who did the last roll @@ -96,7 +96,7 @@ public: /* * Entry fields for the names */ - QLineEdit *mLe[2]; + TQLineEdit *mLe[2]; }; @@ -106,7 +106,7 @@ public: /* * Constructor */ -KBgEngineOffline::KBgEngineOffline(QWidget *parent, QString *name, QPopupMenu *pmenu) +KBgEngineOffline::KBgEngineOffline(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) : KBgEngine(parent, name, pmenu) { d = new KBgEngineOfflinePrivate(); @@ -120,11 +120,11 @@ KBgEngineOffline::KBgEngineOffline(QWidget *parent, QString *name, QPopupMenu *p /* * Create engine specific actions */ - d->mNew = new KAction(i18n("&New Game..."), 0, this, SLOT(newGame()), this); - d->mSwap = new KAction(i18n("&Swap Colors"), 0, this, SLOT(swapColors()), this); + d->mNew = new KAction(i18n("&New Game..."), 0, this, TQT_SLOT(newGame()), this); + d->mSwap = new KAction(i18n("&Swap Colors"), 0, this, TQT_SLOT(swapColors()), this); d->mEdit = new KToggleAction(i18n("&Edit Mode"), 0, this, - SLOT(toggleEditMode()), this); + TQT_SLOT(toggleEditMode()), this); d->mEdit->setChecked(false); /* @@ -143,14 +143,14 @@ KBgEngineOffline::KBgEngineOffline(QWidget *parent, QString *name, QPopupMenu *p /* * initialize the commit timeout */ - ct = new QTimer(this); - connect(ct, SIGNAL(timeout()), this, SLOT(done())); + ct = new TQTimer(this); + connect(ct, TQT_SIGNAL(timeout()), this, TQT_SLOT(done())); /* * internal statue variables */ d->mRollFlag = d->mUndoFlag = d->mGameFlag = d->mDoneFlag = false; - connect(this, SIGNAL(allowCommand(int, bool)), this, SLOT(setAllowed(int, bool))); + connect(this, TQT_SIGNAL(allowCommand(int, bool)), this, TQT_SLOT(setAllowed(int, bool))); /* * Restore last stored settings @@ -179,7 +179,7 @@ void KBgEngineOffline::getSetupPages(KDialogBase *nb) /* * Main Widget */ - QVBox *vbp = nb->addVBoxPage(i18n("Offline Engine"), i18n("Use this to configure the Offline engine"), + TQVBox *vbp = nb->addVBoxPage(i18n("Offline Engine"), i18n("Use this to configure the Offline engine"), kapp->iconLoader()->loadIcon(PROG_NAME "_engine", KIcon::Desktop)); /* @@ -190,32 +190,32 @@ void KBgEngineOffline::getSetupPages(KDialogBase *nb) /* * Player names */ - QWidget *w = new QWidget(tc); - QGridLayout *gl = new QGridLayout(w, 2, 1, nb->spacingHint()); + TQWidget *w = new TQWidget(tc); + TQGridLayout *gl = new TQGridLayout(w, 2, 1, nb->spacingHint()); /* * Group boxes */ - QGroupBox *gbn = new QGroupBox(i18n("Names"), w); + TQGroupBox *gbn = new TQGroupBox(i18n("Names"), w); gl->addWidget(gbn, 0, 0); - gl = new QGridLayout(gbn, 2, 2, 20); + gl = new TQGridLayout(gbn, 2, 2, 20); - d->mLe[0] = new QLineEdit(d->mName[0], gbn); - d->mLe[1] = new QLineEdit(d->mName[1], gbn); + d->mLe[0] = new TQLineEdit(d->mName[0], gbn); + d->mLe[1] = new TQLineEdit(d->mName[1], gbn); - QLabel *lb[2]; - lb[0] = new QLabel(i18n("First player:"), gbn); - lb[1] = new QLabel(i18n("Second player:"), gbn); + TQLabel *lb[2]; + lb[0] = new TQLabel(i18n("First player:"), gbn); + lb[1] = new TQLabel(i18n("Second player:"), gbn); for (int i = 0; i < 2; i++) { gl->addWidget(lb[i], i, 0); gl->addWidget(d->mLe[i], i, 1); } - QWhatsThis::add(d->mLe[0], i18n("Enter the name of the first player.")); - QWhatsThis::add(d->mLe[1], i18n("Enter the name of the second player.")); + TQWhatsThis::add(d->mLe[0], i18n("Enter the name of the first player.")); + TQWhatsThis::add(d->mLe[1], i18n("Enter the name of the second player.")); /* * Done with the page, put it in @@ -282,10 +282,10 @@ void KBgEngineOffline::newGame() /* * If there is a game running we warn the user first */ - if (d->mGameFlag && (KMessageBox::warningYesNo((QWidget *)parent(), + if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)parent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - QString::null, i18n("Start New Game"), + TQString::null, i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -383,8 +383,8 @@ void KBgEngineOffline::initGame() bool KBgEngineOffline::queryPlayerName(int w) { bool ret = false; - QString *name; - QString text; + TQString *name; + TQString text; if (w == US) { name = &d->mName[0]; @@ -397,7 +397,7 @@ bool KBgEngineOffline::queryPlayerName(int w) } do { - *name = KLineEditDlg::getText(text, *name, &ret, (QWidget *)parent()); + *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)parent()); if (!ret) break; } while (name->isEmpty()); @@ -481,10 +481,10 @@ void KBgEngineOffline::redo() * Take the move string and make the changes on the working copy * of the state. */ -void KBgEngineOffline::handleMove(QString *s) +void KBgEngineOffline::handleMove(TQString *s) { int index = 0; - QString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->find(' ', index)); index += 1 + t.length(); int moves = t.toInt(); @@ -517,7 +517,7 @@ void KBgEngineOffline::handleMove(QString *s) c = '+'; kick = true; } - QString r = t.left(t.find(c)); + TQString r = t.left(t.find(c)); if (r.contains("bar")) { d->mGame[0].setBar(d->mRoll, abs(d->mGame[0].bar(d->mRoll)) - 1); } else { @@ -626,7 +626,7 @@ void KBgEngineOffline::rollDiceBackend(const int w, const int a, const int b) break; // case 1: default: - emit infoText(QString((w == US) ? d->mName[0] : d->mName[1]) + + emit infoText(TQString((w == US) ? d->mName[0] : d->mName[1]) + i18n(", please move 1 piece.",", please move %n pieces.",d->mMove)); emit allowMoving(true); break; @@ -645,7 +645,7 @@ void KBgEngineOffline::cube() if (d->mRollFlag && d->mGame[0].cube(w) > 0) { emit allowCommand(Cube, false); - if (KMessageBox::questionYesNo((QWidget *)parent(), + if (KMessageBox::questionYesNo((TQWidget *)parent(), i18n("%1 has doubled. %2, do you accept the double?"). arg((w == THEM) ? d->mName[1] : d->mName[0]). arg((w == US) ? d->mName[1] : d->mName[0]), @@ -695,9 +695,9 @@ bool KBgEngineOffline::queryClose() if (!d->mGameFlag) return true; - switch (KMessageBox::warningContinueCancel((QWidget *)parent(), + switch (KMessageBox::warningContinueCancel((TQWidget *)parent(), i18n("In the middle of a game. " - "Really quit?"), QString::null, KStdGuiItem::quit())) { + "Really quit?"), TQString::null, KStdGuiItem::quit())) { case KMessageBox::Continue : return TRUE; case KMessageBox::Cancel : @@ -719,7 +719,7 @@ bool KBgEngineOffline::queryExit() /* * Handle textual commands. Right now, all commands are ignored */ -void KBgEngineOffline::handleCommand(const QString& cmd) +void KBgEngineOffline::handleCommand(const TQString& cmd) { emit infoText(i18n("Text commands are not yet working. " "The command '%1' has been ignored.").arg(cmd)); diff --git a/kbackgammon/engines/offline/kbgoffline.h b/kbackgammon/engines/offline/kbgoffline.h index db2bdc03..8a6448fb 100644 --- a/kbackgammon/engines/offline/kbgoffline.h +++ b/kbackgammon/engines/offline/kbgoffline.h @@ -55,7 +55,7 @@ public: /** * Constructor */ - KBgEngineOffline(QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0); + KBgEngineOffline(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor @@ -119,7 +119,7 @@ public slots: * A move has been made on the board - see the board class * for the format of the string s */ - virtual void handleMove(QString *s); + virtual void handleMove(TQString *s); /** * Undo the last move @@ -154,7 +154,7 @@ public slots: /** * Process the string cmd */ - virtual void handleCommand(const QString& cmd); + virtual void handleCommand(const TQString& cmd); /** * Start a new game. -- cgit v1.2.1