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.cpp542
1 files changed, 271 insertions, 271 deletions
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 <kapplication.h>
#include <kconfig.h>
-#include <qtimer.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qstring.h>
-#include <qsocket.h>
-#include <qpopupmenu.h>
-#include <qgroupbox.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
+#include <tqtimer.h>
+#include <tqcheckbox.h>
+#include <tqlayout.h>
+#include <tqstring.h>
+#include <tqsocket.h>
+#include <tqpopupmenu.h>
+#include <tqgroupbox.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
#include <kmainwindow.h>
#include <klineeditdlg.h>
#include <kmessagebox.h>
-#include <qdatetime.h>
-#include <qwhatsthis.h>
+#include <tqdatetime.h>
+#include <tqwhatsthis.h>
#include <kaudioplayer.h>
#include <kstandarddirs.h>
-#include <qvbox.h>
+#include <tqvbox.h>
#include <kiconloader.h>
#include <ktabctl.h>
#include <kpassdlg.h>
-#include <qcstring.h>
+#include <tqcstring.h>
#include <knotifyclient.h>
#include <kaction.h>
@@ -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("<font color=\"blue\"><pre>") + line + "</pre></font><br>";
+ rxCollect += TQString("<font color=\"blue\"><pre>") + line + "</pre></font><br>";
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 += "<br>&nbsp;&nbsp;&nbsp;&nbsp;" + 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 += "<br>" + 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], "<br><hr>");
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("<hr><br>" + 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("<font color=\"red\">") + rxCollect + "</font>");
+ emit infoText(TQString("<font color=\"red\">") + rxCollect + "</font>");
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 <u>%1</u>. To fully activate "
+ 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]);
emit infoText("<br><hr><font color=\"blue\">" + text + "</font><br><hr>");
@@ -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("<br><u>") + line + "</u>";
+ rxCollect = TQString("<br><u>") + line + "</u>";
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("<font color=\"red\"><br>")
+ emit infoText(TQString("<font color=\"red\"><br>")
+ 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);
}