summaryrefslogtreecommitdiffstats
path: root/kbackgammon/engines/fibs/kbgfibs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbackgammon/engines/fibs/kbgfibs.cpp')
-rw-r--r--kbackgammon/engines/fibs/kbgfibs.cpp320
1 files changed, 160 insertions, 160 deletions
diff --git a/kbackgammon/engines/fibs/kbgfibs.cpp b/kbackgammon/engines/fibs/kbgfibs.cpp
index 4e7fd2f4..1492ad2c 100644
--- a/kbackgammon/engines/fibs/kbgfibs.cpp
+++ b/kbackgammon/engines/fibs/kbgfibs.cpp
@@ -81,7 +81,7 @@ void KBgEngineFIBS::start()
// == configuration handling ===================================================
/*
- * Restore settings and ask children to do the same
+ * Restore settings and ask tqchildren to do the same
*/
void KBgEngineFIBS::readConfig()
{
@@ -110,7 +110,7 @@ void KBgEngineFIBS::readConfig()
autoMsg[MsgLos] = config->readEntry("msg-los", "");
autoMsg[MsgWin] = config->readEntry("msg-win", "");
- // ask the children to read their config options
+ // ask the tqchildren to read their config options
playerlist->readConfig();
chatWindow->readConfig();
}
@@ -145,7 +145,7 @@ void KBgEngineFIBS::saveConfig()
config->writeEntry("msg-los", autoMsg[MsgLos]);
config->writeEntry("msg-win", autoMsg[MsgWin]);
- // ask the children to read their config options
+ // ask the tqchildren to read their config options
playerlist->saveConfig();
chatWindow->saveConfig();
}
@@ -343,7 +343,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb)
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));
+ "if you do not have flat-rate Internet access.").tqarg(PROG_NAME));
cbk->setChecked(keepalive);
@@ -357,7 +357,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb)
tc->addTab(w, i18n("&Connection"));
/*
- * Ask children for settings
+ * Ask tqchildren for settings
*/
chatWindow->getSetupPages(tc, nb->spacingHint());
playerlist->getSetupPages(tc, nb->spacingHint());
@@ -380,7 +380,7 @@ void KBgEngineFIBS::cancelJoin(const TQString &info)
TQRegExp patt = TQRegExp("^" + info + " ");
for (int i = 0; i <= numJoin; i++) {
- if (actJoin[i]->text().contains(patt)) {
+ if (actJoin[i]->text().tqcontains(patt)) {
// move all entries starting at i+1 up by one...
for (int j = i; j < numJoin; j++)
actJoin[j]->setText(actJoin[j+1]->text());
@@ -426,33 +426,33 @@ void KBgEngineFIBS::changeJoin(const TQString &info)
for (TQStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) {
- if ((*it).contains(patt)) {
+ if ((*it).tqcontains(patt)) {
TQString text, menu;
- if ((*it).contains(TQRegExp(" r$"))) {
- menu = i18n("R means resume", "%1 (R)").arg(name);
+ if ((*it).tqcontains(TQRegExp(" r$"))) {
+ menu = i18n("R means resume", "%1 (R)").tqarg(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);
+ "'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(name);
KNotifyClient::event("invitation", i18n("%1 wants to resume a saved match with you").
arg(name));
- } else if ((*it).contains(TQRegExp(" u$"))) {
- menu = i18n("U means unlimited", "%1 (U)").arg(name);
+ } else if ((*it).tqcontains(TQRegExp(" u$"))) {
+ menu = i18n("U means unlimited", "%1 (U)").tqarg(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 "
- "'join %4').").arg(name).arg(expi_s).arg(rate_s).arg(name);
+ "'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(name);
KNotifyClient::event("invitation", i18n("%1 has invited you to an unlimited match").
arg(name));
} else {
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);
+ "%1 (%2)").tqarg(name).tqarg(len);
text = i18n("%1 (experience %2, rating %3) wants to play a %4 point match with you. "
"If you want to play, use the corresponding menu entry to join (or type "
- "'join %5').").arg(name).arg(expi_s).arg(rate_s).arg(len).arg(name);
+ "'join %5').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(len).tqarg(name);
KNotifyClient::event("invitation", i18n("%1 has invited you for a %2 point match").
- arg(name).arg(len));
+ tqarg(name).tqarg(len));
}
emit serverString("rawwho " + name); // this avoids a race
if (whoisInvite) {
@@ -493,7 +493,7 @@ void KBgEngineFIBS::changeJoin(const TQString &info)
*/
void KBgEngineFIBS::keepAlive()
{
- emit serverString("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ emit serverString("ABCDEFGHIJKLMNOPTQRSTUVWXYZ");
}
/*
@@ -578,8 +578,8 @@ void KBgEngineFIBS::done()
emit allowCommand(Roll, false);
// Transform the string to FIBS cormat
- lastMove.replace(0, 2, "move ");
- lastMove.replace(pat[PlsChar], "-");
+ lastMove.tqreplace(0, 2, "move ");
+ lastMove.tqreplace(pat[PlsChar], "-");
// sent it to the server
emit serverString(lastMove);
@@ -642,7 +642,7 @@ bool KBgEngineFIBS::queryClose()
if (connection->state() == TQSocket::Idle)
return true;
- switch (KMessageBox::warningYesNoCancel((TQWidget *)parent(),i18n("Still connected. Log out first?"),TQString::null,i18n("Log Out"), i18n("Stay Connected"))) {
+ switch (KMessageBox::warningYesNoCancel((TQWidget *)tqparent(),i18n("Still connected. Log out first?"),TQString(),i18n("Log Out"), i18n("Stay Connected"))) {
case KMessageBox::Yes :
disconnectFIBS();
return true;
@@ -731,7 +731,7 @@ void KBgEngineFIBS::away()
bool ret;
TQString msg = KLineEditDlg::getText(i18n("Please type the message that should be displayed to other\n"
"users while you are away."),
- lastAway, &ret, (TQWidget *)parent());
+ lastAway, &ret, (TQWidget *)tqparent());
if (ret) {
lastAway = msg;
emit serverString("away " + msg);
@@ -809,7 +809,7 @@ void KBgEngineFIBS::load()
*/
void KBgEngineFIBS::join(const TQString &msg)
{
- emit serverString("join " + msg.left(msg.find('(')));
+ emit serverString("join " + msg.left(msg.tqfind('(')));
}
void KBgEngineFIBS::join_0() { join(actJoin[0]->text()); }
void KBgEngineFIBS::join_1() { join(actJoin[1]->text()); }
@@ -877,7 +877,7 @@ void KBgEngineFIBS::connectFIBS()
/*
* Connect
*/
- emit infoText(i18n("Looking up %1").arg(infoFIBS[FIBSHost]));
+ emit infoText(i18n("Looking up %1").tqarg(infoFIBS[FIBSHost]));
connection->connectToHost(infoFIBS[FIBSHost], infoFIBS[FIBSPort].toUShort());
return;
@@ -888,7 +888,7 @@ void KBgEngineFIBS::connectFIBS()
*/
void KBgEngineFIBS::hostFound()
{
- emit infoText(i18n("Connecting to %1").arg(infoFIBS[FIBSHost]));
+ emit infoText(i18n("Connecting to %1").tqarg(infoFIBS[FIBSHost]));
}
/*
@@ -947,7 +947,7 @@ void KBgEngineFIBS::connected()
/*
* Initialize the rx state machine
*/
- rxStatus = RxConnect;
+ rxtqStatus = RxConnect;
rxCollect = "";
/*
@@ -992,7 +992,7 @@ void KBgEngineFIBS::newAccount()
if (!queryConnection(true))
return;
- rxStatus = RxNewLogin;
+ rxtqStatus = RxNewLogin;
rxCollect = "";
login = false;
connectFIBS();
@@ -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, (TQWidget *)parent());
+ infoFIBS[FIBSHost], &ret, (TQWidget *)tqparent());
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, (TQWidget *)parent());
+ infoFIBS[FIBSPort], &ret, (TQWidget *)tqparent());
if (ret)
infoFIBS[FIBSPort] = msg;
@@ -1077,24 +1077,24 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
text = i18n("Enter the login you would like to use on the server %1. The login may not\n"
"contain spaces or colons. If the login you choose is not available, you'll later be\n"
- "given the opportunity to pick another one.\n\n").arg(infoFIBS[FIBSHost]);
+ "given the opportunity to pick another one.\n\n").tqarg(infoFIBS[FIBSHost]);
else
text = i18n("Enter your login on the server %1. If you don't have a login, you\n"
- "should create one using the corresponding menu option.\n\n").arg(infoFIBS[FIBSHost]);
+ "should create one using the corresponding menu option.\n\n").tqarg(infoFIBS[FIBSHost]);
first = true;
do {
msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret,
- (TQWidget *)parent())).stripWhiteSpace();
+ (TQWidget *)tqparent())).stripWhiteSpace();
if (first) {
text += i18n("The login may not contain spaces or colons!");
first = false;
}
- } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':')));
+ } while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':')));
if (ret)
infoFIBS[FIBSUser] = msg;
@@ -1107,12 +1107,12 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
text = i18n("Enter the password you would like to use with the login %1\n"
"on the server %2. It may not contain colons.\n\n").
- arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]);
+ tqarg(infoFIBS[FIBSUser]).tqarg(infoFIBS[FIBSHost]);
else
text = i18n("Enter the password for the login %1 on the server %2.\n\n").
- arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]);
+ tqarg(infoFIBS[FIBSUser]).tqarg(infoFIBS[FIBSHost]);
first = true;
do {
@@ -1130,7 +1130,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
first = false;
}
- } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':')));
+ } while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':')));
if (ret)
infoFIBS[FIBSPswd] = msg;
@@ -1234,7 +1234,7 @@ void KBgEngineFIBS::initPattern()
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[KeepAlv] = TQRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPTQRSTUVWXYZ'");
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\\.$");
@@ -1281,15 +1281,15 @@ void KBgEngineFIBS::handleServerData(TQString &line)
/*
* Fix-up any HTML-like tags in the line
*/
- line.replace(pat[HTML_lt], "&lt;");
- line.replace(pat[HTML_gt], "&gt;");
+ line.tqreplace(pat[HTML_lt], "&lt;");
+ line.tqreplace(pat[HTML_gt], "&gt;");
/*
* FIBS sometimes sends tabs, where it should send 8 spaces...
*/
- line.replace(pat[TabChar], " ");
+ line.tqreplace(pat[TabChar], " ");
- switch (rxStatus) {
+ switch (rxtqStatus) {
case RxConnect:
handleMessageConnect(line, rawline);
@@ -1344,8 +1344,8 @@ void KBgEngineFIBS::handleServerData(TQString &line)
void KBgEngineFIBS::handleMessageWhois(const TQString &line)
{
rxCollect += "<br>&nbsp;&nbsp;&nbsp;&nbsp;" + line;
- if (line.contains(pat[WhoisE1]) || line.contains(pat[WhoisE2])) {
- rxStatus = RxNormal;
+ if (line.tqcontains(pat[WhoisE1]) || line.tqcontains(pat[WhoisE2])) {
+ rxtqStatus = RxNormal;
emit infoText("<font color=\"darkgreen\">" + rxCollect + "<br></font>");
}
}
@@ -1356,9 +1356,9 @@ void KBgEngineFIBS::handleMessageWhois(const TQString &line)
void KBgEngineFIBS::handleMessageRating(const TQString &line)
{
rxCollect += "<br>" + line;
- if (line.contains(pat[EndRate]) && ++rxCount == 2) {
+ if (line.tqcontains(pat[EndRate]) && ++rxCount == 2) {
emit infoText("<font color=\"blue\">" + rxCollect + "<br></font>");
- rxStatus = RxNormal;
+ rxtqStatus = RxNormal;
}
}
@@ -1367,8 +1367,8 @@ void KBgEngineFIBS::handleMessageRating(const TQString &line)
*/
void KBgEngineFIBS::handleMessageMotd(const TQString &line)
{
- if (line.contains(pat[MotdEnd])) {
- rxStatus = RxNormal;
+ if (line.tqcontains(pat[MotdEnd])) {
+ rxtqStatus = RxNormal;
emit infoText("<font color=\"blue\"><pre>" + rxCollect + "</pre></font>");
/*
* just to be on the safe side, we set the value of boardstyle.
@@ -1378,9 +1378,9 @@ void KBgEngineFIBS::handleMessageMotd(const TQString &line)
emit serverString("set boardstyle 3");
} else {
TQString tline = line;
- tline.replace(pat[BoxHori], "<br><hr>");
- tline.replace(pat[BoxVer1], "");
- tline.replace(pat[BoxVer2], "");
+ tline.tqreplace(pat[BoxHori], "<br><hr>");
+ tline.tqreplace(pat[BoxVer1], "");
+ tline.tqreplace(pat[BoxVer2], "");
rxCollect += "<br>" + tline;
}
}
@@ -1393,14 +1393,14 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
/*
* Two possibilities: either we are logged in or we sent bad password/login
*/
- if (line.contains("login:")) {
+ if (line.tqcontains("login:")) {
/*
* This can only happen if the password/login is wrong.
*/
if (rxCollect.isEmpty()) {
- rxStatus = RxIgnore;
+ rxtqStatus = RxIgnore;
int ret = KMessageBox::warningContinueCancel
- ((TQWidget *)parent(), i18n("There was a problem with "
+ ((TQWidget *)tqparent(), i18n("There was a problem with "
"your login and password. "
"You can reenter\n"
"your login and password and "
@@ -1411,9 +1411,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
infoFIBS[FIBSUser] = "";
infoFIBS[FIBSPswd] = "";
login = true;
- connectFIBS(); // will reset the rxStatus
+ connectFIBS(); // will reset the rxtqStatus
} else {
- rxStatus = RxConnect;
+ rxtqStatus = RxConnect;
emit serverString("");
emit serverString("");
}
@@ -1428,14 +1428,14 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
* Ok, we are logged in! Now receive personal information. These
* are completely useless but what the heck.
*/
- if (line.contains(pat[Welcome])) {
+ if (line.tqcontains(pat[Welcome])) {
char p[3][256];
time_t tmp;
// 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) {
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());
+ TQString text = i18n("%1, last logged in from %2 at %3.").tqarg(p[1]).tqarg(p[2]).tqarg(d.toString());
emit infoText("<hr><br>" + text);
playerlist->setName(p[1]);
}
@@ -1471,9 +1471,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
* p[3] - timezone
*
*/
- if (line.contains(pat[OwnInfo])) {
+ if (line.tqcontains(pat[OwnInfo])) {
- rxStatus = RxNormal;
+ rxtqStatus = RxNormal;
int fibsOptions[NumFIBSOpt];
@@ -1537,8 +1537,8 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
/*
* The beginning of a new login procedure starts starts here
*/
- if (line.contains(pat[OneName])) {
- rxStatus = RxNewLogin;
+ if (line.tqcontains(pat[OneName])) {
+ rxtqStatus = RxNewLogin;
emit infoText(TQString("<font color=\"red\">") + rxCollect + "</font>");
rxCollect = "";
TQString tmp = rawline;
@@ -1560,26 +1560,26 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line)
/*
* Request the new login
*/
- if (line.contains(pat[OneName])) {
+ if (line.tqcontains(pat[OneName])) {
emit serverString(TQString("name ") + infoFIBS[FIBSUser]);
return;
}
/*
* Ooops, user name already exists
*/
- if (line.contains(pat[OthrNam])) {
+ if (line.tqcontains(pat[OthrNam])) {
TQString text = i18n("The selected login is alreay in use! Please select another one.");
bool ret, first = true;
TQString msg;
do {
msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret,
- (TQWidget *)parent())).stripWhiteSpace();
+ (TQWidget *)tqparent())).stripWhiteSpace();
if (first) {
text += i18n("\n\nThe login may not contain spaces or colons!");
first = false;
}
- } while (msg.contains(' ') || msg.contains(':'));
+ } while (msg.tqcontains(' ') || msg.tqcontains(':'));
if (ret) {
infoFIBS[FIBSUser] = msg;
@@ -1592,28 +1592,28 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line)
/*
* first time we send the password
*/
- if (line.contains(pat[YourNam])) {
+ if (line.tqcontains(pat[YourNam])) {
emit serverString(infoFIBS[FIBSPswd]);
return;
}
/*
* second time we send the password
*/
- if (line.contains(pat[GivePwd])) {
+ if (line.tqcontains(pat[GivePwd])) {
emit serverString(infoFIBS[FIBSPswd]);
return;
}
/*
* at this point we are done creating the account
*/
- if (line.contains(pat[RetypeP])) {
+ if (line.tqcontains(pat[RetypeP])) {
TQString text = i18n("Your account has been created. Your new login is <u>%1</u>. To fully activate "
"this account, I will now close the connection. Once you reconnect, you can start "
- "playing backgammon on FIBS.").arg(infoFIBS[FIBSUser]);
+ "playing backgammon on FIBS.").tqarg(infoFIBS[FIBSUser]);
emit infoText("<br><hr><font color=\"blue\">" + text + "</font><br><hr>");
emit serverString("bye");
- rxStatus = RxNormal;
+ rxtqStatus = RxNormal;
rxCollect = "";
return;
}
@@ -1632,7 +1632,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* For now, the waves are ignored. They should probably go into
* the chat window -- but only optional
*/
- if (line.contains(pat[OneWave]) || line.contains(pat[TwoWave]) || line.contains(pat[YouWave])) {
+ if (line.tqcontains(pat[OneWave]) || line.tqcontains(pat[TwoWave]) || line.tqcontains(pat[YouWave])) {
return;
}
@@ -1642,8 +1642,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* ever gets a games window, they should be in there. For now, they
* are ignored.
*/
- else if (line.contains(pat[GameBG1]) || line.contains(pat[GameBG2]) || line.contains(pat[GameRE1]) ||
- line.contains(pat[GameRE2]) || line.contains(pat[GameEnd])) {
+ else if (line.tqcontains(pat[GameBG1]) || line.tqcontains(pat[GameBG2]) || line.tqcontains(pat[GameRE1]) ||
+ line.tqcontains(pat[GameRE2]) || line.tqcontains(pat[GameEnd])) {
return;
}
@@ -1651,7 +1651,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Artefact caused by the login test procedure utilized.
*/
- else if (line.contains(pat[NoLogin])) {
+ else if (line.tqcontains(pat[NoLogin])) {
return;
}
@@ -1659,7 +1659,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Connection keep-alive response
*/
- else if (line.contains(pat[KeepAlv])) {
+ else if (line.tqcontains(pat[KeepAlv])) {
return;
}
@@ -1670,10 +1670,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* Chat and personal messages - note that the chat window sends these messages
* back to us so we can display them if the user wants that.
*/
- else if (line.contains(pat[ChatSay]) || line.contains(pat[ChatSht]) || line.contains(pat[ChatWis]) ||
- line.contains(pat[ChatKib]) || line.contains(pat[SelfSay]) || line.contains(pat[SelfSht]) ||
- line.contains(pat[SelfWis]) || line.contains(pat[SelfKib]) || line.contains(pat[SelfSlf]) ||
- line.contains(pat[MsgPers]) || line.contains(pat[MsgDeli]) || line.contains(pat[MsgSave])) {
+ else if (line.tqcontains(pat[ChatSay]) || line.tqcontains(pat[ChatSht]) || line.tqcontains(pat[ChatWis]) ||
+ line.tqcontains(pat[ChatKib]) || line.tqcontains(pat[SelfSay]) || line.tqcontains(pat[SelfSht]) ||
+ line.tqcontains(pat[SelfWis]) || line.tqcontains(pat[SelfKib]) || line.tqcontains(pat[SelfSlf]) ||
+ line.tqcontains(pat[MsgPers]) || line.tqcontains(pat[MsgDeli]) || line.tqcontains(pat[MsgSave])) {
emit chatMessage(line);
return;
@@ -1684,12 +1684,12 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Beginning of games. In all these cases we are playing and not watching.
*/
- else if (line.contains(pat[MatchB1]) || line.contains(pat[MatchB2])) {
+ else if (line.tqcontains(pat[MatchB1]) || line.tqcontains(pat[MatchB2])) {
if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty())
emit serverString("kibitz " + autoMsg[MsgBeg]);
}
- else if (line.contains(pat[MatchB3]) || line.contains(pat[MatchB4])) {
+ else if (line.tqcontains(pat[MatchB3]) || line.tqcontains(pat[MatchB4])) {
if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty())
emit serverString("kibitz " + autoMsg[MsgBeg]);
@@ -1702,7 +1702,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* The help should be handled separately. A fairly complete implementation of a
* help parsing can be found in KFibs.
*/
- else if (line.contains(pat[HelpTxt])) {
+ else if (line.tqcontains(pat[HelpTxt])) {
// do nothing
}
@@ -1712,12 +1712,12 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Simple cases without the need for many comments...
*/
- else if (line.contains(pat[RawBord])) {
+ else if (line.tqcontains(pat[RawBord])) {
/*
* Save the board string and create a new game state
*/
- KBgStatus *st = new KBgStatus(currBoard = rawline);
+ KBgtqStatus *st = new KBgtqStatus(currBoard = rawline);
/*
* Save important state data and stop the timeout
@@ -1736,15 +1736,15 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* Update the caption string
*/
if (st->turn() < 0)
- caption = i18n("%1 (%2) vs. %3 (%4) - game over").arg(pname[US]).
- arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM));
+ caption = i18n("%1 (%2) vs. %3 (%4) - game over").tqarg(pname[US]).
+ tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM));
else if (st->length() < 0)
- caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").arg(pname[US]).
- arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM));
+ caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").tqarg(pname[US]).
+ tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM));
else
- caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").arg(pname[US]).
- arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM)).
- arg(st->length());
+ caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").tqarg(pname[US]).
+ tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM)).
+ tqarg(st->length());
emit statText(caption);
@@ -1766,7 +1766,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
return;
}
- else if (line.contains(pat[PlsMove]) || line.contains(pat[YouMove])) {
+ else if (line.tqcontains(pat[PlsMove]) || line.tqcontains(pat[YouMove])) {
KNotifyClient::event("move", i18n("Please make your move"));
@@ -1777,15 +1777,15 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Being away and coming back
*/
- else if (line.contains(pat[YouAway])) {
+ else if (line.tqcontains(pat[YouAway])) {
- emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true);
+ emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true);
actBack->setEnabled(true);
line += "<br><pre> </pre>" + i18n("(or use the corresponding menu entry to join the match)");
}
- else if (line.contains(pat[YouBack])) {
+ else if (line.tqcontains(pat[YouBack])) {
- emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false);
+ emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false);
actBack->setEnabled(false);
actAway->setEnabled(true);
}
@@ -1795,7 +1795,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Catch the response of the user responding to double or resign
*/
- else if (line.contains(pat[YouGive]) || line.contains(pat[RejCont]) || line.contains(pat[AcptWin])) {
+ else if (line.tqcontains(pat[YouGive]) || line.tqcontains(pat[RejCont]) || line.tqcontains(pat[AcptWin])) {
actAccept->setEnabled(false);
actReject->setEnabled(false);
@@ -1806,20 +1806,20 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Catch the responses to newly set toggles
*/
- else if (line.contains(pat[GreedyY]) || line.contains(pat[GreedyN])) {
+ else if (line.tqcontains(pat[GreedyY]) || line.tqcontains(pat[GreedyN])) {
- fibsOpt[OptGreedy]->setChecked(line.contains(pat[GreedyY]));
+ fibsOpt[OptGreedy]->setChecked(line.tqcontains(pat[GreedyY]));
line = "<font color=\"red\">" + line + "</font>";
}
- else if (line.contains(pat[DoubleY]) || line.contains(pat[DoubleN])) {
+ else if (line.tqcontains(pat[DoubleY]) || line.tqcontains(pat[DoubleN])) {
- fibsOpt[OptDouble]->setChecked(line.contains(pat[DoubleY]));
+ fibsOpt[OptDouble]->setChecked(line.tqcontains(pat[DoubleY]));
line = "<font color=\"red\">" + line + "</font>";
}
- else if (line.contains(pat[RatingY]) || line.contains(pat[RatingN])) {
+ else if (line.tqcontains(pat[RatingY]) || line.tqcontains(pat[RatingN])) {
- fibsOpt[OptRatings]->setChecked(line.contains(pat[RatingY]));
+ fibsOpt[OptRatings]->setChecked(line.tqcontains(pat[RatingY]));
line = "<font color=\"red\">" + line + "</font>";
}
@@ -1828,7 +1828,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* It's our turn to roll or double
*/
- else if (line.contains(pat[YouTurn]) || line.contains(pat[YouRoll])) {
+ else if (line.tqcontains(pat[YouTurn]) || line.tqcontains(pat[YouRoll])) {
emit allowCommand(Cube, playing);
emit allowCommand(Roll, playing);
@@ -1843,17 +1843,17 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Got an invitation for a match
*/
- else if (line.contains(pat[Invite0]) || line.contains(pat[Invite2]) || line.contains(pat[Invite3])) {
+ else if (line.tqcontains(pat[Invite0]) || line.tqcontains(pat[Invite2]) || line.tqcontains(pat[Invite3])) {
- rxCollect = rawline.left(rawline.find(' '));
+ rxCollect = rawline.left(rawline.tqfind(' '));
emit serverString("rawwho " + rxCollect);
- if (line.contains(pat[Invite0])) {
- rawline.replace(pat[Invite1], "");
- rawline = rxCollect + " "+ rawline.left(rawline.find(' '));
- } else if (line.contains(pat[Invite2])) {
+ if (line.tqcontains(pat[Invite0])) {
+ rawline.tqreplace(pat[Invite1], "");
+ rawline = rxCollect + " "+ rawline.left(rawline.tqfind(' '));
+ } else if (line.tqcontains(pat[Invite2])) {
rawline = rxCollect + " r";
- } else if (line.contains(pat[Invite3])) {
+ } else if (line.tqcontains(pat[Invite3])) {
invitations += rxCollect + " u";
}
invitations += rawline;
@@ -1862,24 +1862,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
// - rx status changes ------------------------------------------------------------
- else if (line.contains(pat[WhoisBG])) {
- rxStatus = RxWhois;
+ else if (line.tqcontains(pat[WhoisBG])) {
+ rxtqStatus = RxWhois;
rxCollect = TQString("<br><u>") + line + "</u>";
return;
}
- else if (line.contains(pat[MotdBeg])) {
- rxStatus = RxMotd;
+ else if (line.tqcontains(pat[MotdBeg])) {
+ rxtqStatus = RxMotd;
rxCollect = "";
return;
}
- else if (line.contains(pat[BegRate])) {
- rxStatus = RxRating;
+ else if (line.tqcontains(pat[BegRate])) {
+ rxtqStatus = RxRating;
rxCount = 0;
rxCollect = "<br>" + line;
return;
}
- else if (line.contains(pat[Goodbye])) {
- rxStatus = RxGoodbye;
+ else if (line.tqcontains(pat[Goodbye])) {
+ rxtqStatus = RxGoodbye;
rxCollect = "<br><hr><br>";
handleServerData(rawline); // danger: recursion!
return;
@@ -1893,7 +1893,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Continue a mutli game match? We have to either leave or continue
*/
- else if (line.contains(pat[ConLeav])) {
+ else if (line.tqcontains(pat[ConLeav])) {
actConti->setEnabled(true);
actLeave->setEnabled(true);
line.append("<br><pre> </pre>" + i18n("(or use the corresponding menu "
@@ -1902,9 +1902,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Beginning and end of user updates
*/
- else if (line.contains(pat[WhoInfo])) {
- rawline.replace(pat[WhoInfo], "");
- if (rawline.contains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) {
+ else if (line.tqcontains(pat[WhoInfo])) {
+ rawline.tqreplace(pat[WhoInfo], "");
+ if (rawline.tqcontains(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);
@@ -1913,7 +1913,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
emit fibsWhoInfo(rawline);
return;
}
- else if (line.contains(pat[WhoEnde])) {
+ else if (line.tqcontains(pat[WhoEnde])) {
emit fibsWhoEnd();
return;
}
@@ -1921,43 +1921,43 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* This message is ignored. The instruction is given elsewhere (and slightly
* delayed in the flow of time).
*/
- if (line.contains(pat[TypJoin])) {
+ if (line.tqcontains(pat[TypJoin])) {
return;
}
/*
* Watching other players
*/
- else if (line.contains(pat[BegWtch])) {
+ else if (line.tqcontains(pat[BegWtch])) {
emit allowCommand(Load, true);
- rawline.replace(pat[BegWtch], "");
+ rawline.tqreplace(pat[BegWtch], "");
rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline);
load();
}
- else if (line.contains(pat[EndWtch])) {
+ else if (line.tqcontains(pat[EndWtch])) {
emit gameOver();
}
/*
* Blinding of players, the actual blind is handled by
* the player list
*/
- else if (line.contains(pat[BegBlnd])) {
- rawline.replace(pat[BegBlnd], "");
+ else if (line.tqcontains(pat[BegBlnd])) {
+ rawline.tqreplace(pat[BegBlnd], "");
rawline.truncate(rawline.length()-1);
- emit changePlayerStatus(rawline, KFibsPlayerList::Blind, true);
+ emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, true);
line = "<font color=\"red\">" + line + "</font>";
}
- else if (line.contains(pat[EndBlnd])) {
- rawline.replace(pat[EndBlnd], "");
+ else if (line.tqcontains(pat[EndBlnd])) {
+ rawline.tqreplace(pat[EndBlnd], "");
rawline.truncate(rawline.length()-1);
- emit changePlayerStatus(rawline, KFibsPlayerList::Blind, false);
+ emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, false);
line = "<font color=\"red\">" + line + "</font>";
}
/*
* Starting or reloading games or matches
*/
- else if (line.contains(pat[BegGame])) {
- rawline.replace(pat[BegGame], "");
+ else if (line.tqcontains(pat[BegGame])) {
+ rawline.tqreplace(pat[BegGame], "");
rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true);
@@ -1965,9 +1965,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
actConti->setEnabled(false);
actLeave->setEnabled(false);
}
- else if (line.contains(pat[Reload1])) {
- rawline.replace(pat[Reload1], "");
- rawline = rawline.left(rawline.find(' '));
+ else if (line.tqcontains(pat[Reload1])) {
+ rawline.tqreplace(pat[Reload1], "");
+ rawline = rawline.left(rawline.tqfind(' '));
rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true);
@@ -1976,8 +1976,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
actLeave->setEnabled(false);
load();
}
- else if (line.contains(pat[Reload2])) {
- rawline.replace(pat[Reload2], "");
+ else if (line.tqcontains(pat[Reload2])) {
+ rawline.tqreplace(pat[Reload2], "");
emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true);
fibsOpt[OptGreedy]->setChecked(false);
@@ -1989,7 +1989,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* Opponent offered resignation or the cube. We have to accept
* or reject the offer.
*/
- else if (line.contains(pat[RejAcpt])) {
+ else if (line.tqcontains(pat[RejAcpt])) {
actAccept->setEnabled(true);
actReject->setEnabled(true);
line += "<br><pre> </pre>" + i18n("(or use the corresponding menu "
@@ -1999,10 +1999,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* This is strange: FIBS seems to not send a newline at the
* end of this pattern. So we work around that.
*/
- else if (line.contains(pat[YouAcpt])) {
+ else if (line.tqcontains(pat[YouAcpt])) {
actAccept->setEnabled(false);
actReject->setEnabled(false);
- rawline.replace(pat[YouAcpt], "");
+ rawline.tqreplace(pat[YouAcpt], "");
line.truncate(line.length()-rawline.length());
if (!rawline.stripWhiteSpace().isEmpty()) {
handleServerData(rawline);
@@ -2011,7 +2011,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Ending of games
*/
- else if (line.contains(pat[EndLose])) {
+ else if (line.tqcontains(pat[EndLose])) {
if (playing) {
KNotifyClient::event("game over l", i18n("Sorry, you lost the game."));
if (useAutoMsg[MsgLos] && !autoMsg[MsgLos].stripWhiteSpace().isEmpty())
@@ -2019,7 +2019,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
}
emit gameOver();
}
- else if (line.contains(pat[EndVict])) {
+ else if (line.tqcontains(pat[EndVict])) {
if (playing) {
KNotifyClient::event("game over w", i18n("Congratulations, you won the game!"));
if (useAutoMsg[MsgWin] && !autoMsg[MsgWin].stripWhiteSpace().isEmpty())
@@ -2027,24 +2027,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
}
emit gameOver();
}
- else if (line.contains(pat[GameSav])) {
+ else if (line.tqcontains(pat[GameSav])) {
emit gameOver();
}
/*
* User logs out. This has to be signalled to the player
* list. Get the true user names by working on the rawline.
*/
- else if (line.contains(pat[UserLot])) {
- rawline.replace(pat[UserLot], "");
- emit fibsLogout(rawline.left(rawline.find(' ')));
+ else if (line.tqcontains(pat[UserLot])) {
+ rawline.tqreplace(pat[UserLot], "");
+ emit fibsLogout(rawline.left(rawline.tqfind(' ')));
return;
}
/*
* Emit the name of the newly logged in user.
*/
- else if (line.contains(pat[UserLin])) {
- rawline.replace(pat[UserLin], "");
- emit fibsLogin(rawline.left(rawline.find(' ')));
+ else if (line.tqcontains(pat[UserLin])) {
+ rawline.tqreplace(pat[UserLin], "");
+ emit fibsLogin(rawline.left(rawline.tqfind(' ')));
return;
}
/*
@@ -2052,11 +2052,11 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* the 'boardstyle' variable, since we will not be able to display
* the board properly without it.
*/
- else if (line.contains(pat[BoardSY])) {
+ else if (line.tqcontains(pat[BoardSY])) {
// ignored
return;
}
- else if (line.contains(pat[BoardSN])) {
+ else if (line.tqcontains(pat[BoardSN])) {
emit serverString("set boardstyle 3");
emit infoText(TQString("<font color=\"red\"><br>")
+ i18n("You should never set the 'boardstyle' variable "
@@ -2071,7 +2071,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* hasn't been processed, make it red, since it is a server resp.
* to something we just did.
*/
- else if (line.contains(pat[TwoStar])) {
+ else if (line.tqcontains(pat[TwoStar])) {
line = "<font color=\"red\">" + line + "</font>";
}
@@ -2091,13 +2091,13 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Constructor
*/
-KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmenu)
- : KBgEngine(parent, name, pmenu)
+KBgEngineFIBS::KBgEngineFIBS(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu)
+ : KBgEngine(tqparent, name, pmenu)
{
/*
* No connection, not playing, ready for login
*/
- connection = new TQSocket(parent, "fibs connection");
+ connection = new TQSocket(TQT_TQOBJECT(tqparent), "fibs connection");
playing = false;
login = true;
@@ -2128,8 +2128,8 @@ KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmen
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(this, TQT_SIGNAL(changePlayertqStatus(const TQString &, int, bool)),
+ playerlist, TQT_SLOT(changePlayertqStatus(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 &)));