summaryrefslogtreecommitdiffstats
path: root/kbackgammon
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /kbackgammon
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz
tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbackgammon')
-rw-r--r--kbackgammon/engines/fibs/kbgfibs.cpp542
-rw-r--r--kbackgammon/engines/fibs/kbgfibs.h86
-rw-r--r--kbackgammon/engines/fibs/kbgfibschat.cpp246
-rw-r--r--kbackgammon/engines/fibs/kbgfibschat.h26
-rw-r--r--kbackgammon/engines/fibs/kbginvite.cpp60
-rw-r--r--kbackgammon/engines/fibs/kbginvite.h4
-rw-r--r--kbackgammon/engines/fibs/kplayerlist.cpp154
-rw-r--r--kbackgammon/engines/fibs/kplayerlist.h24
-rw-r--r--kbackgammon/engines/generic/kbgengine.cpp12
-rw-r--r--kbackgammon/engines/generic/kbgengine.h16
-rw-r--r--kbackgammon/engines/gnubg/kbggnubg.cpp84
-rw-r--r--kbackgammon/engines/gnubg/kbggnubg.h26
-rw-r--r--kbackgammon/engines/nextgen/kbggame.cpp4
-rw-r--r--kbackgammon/engines/nextgen/kbggame.h4
-rw-r--r--kbackgammon/engines/nextgen/kbgng.cpp78
-rw-r--r--kbackgammon/engines/nextgen/kbgng.h20
-rw-r--r--kbackgammon/engines/nextgen/kbgplayer.cpp4
-rw-r--r--kbackgammon/engines/nextgen/kbgplayer.h6
-rw-r--r--kbackgammon/engines/offline/kbgoffline.cpp84
-rw-r--r--kbackgammon/engines/offline/kbgoffline.h6
-rw-r--r--kbackgammon/kbg.cpp184
-rw-r--r--kbackgammon/kbg.h24
-rw-r--r--kbackgammon/kbgboard.cpp298
-rw-r--r--kbackgammon/kbgboard.h158
-rw-r--r--kbackgammon/kbgstatus.cpp16
-rw-r--r--kbackgammon/kbgstatus.h12
-rw-r--r--kbackgammon/kbgtextview.cpp8
-rw-r--r--kbackgammon/kbgtextview.h8
-rw-r--r--kbackgammon/main.cpp2
29 files changed, 1098 insertions, 1098 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);
}
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 <qstring.h>
-#include <qstringlist.h>
-#include <qregexp.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
#include <klocale.h>
@@ -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 <qstring.h>
-
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qpopupmenu.h>
-#include <qregexp.h>
-#include <qfont.h>
-#include <qwhatsthis.h>
-#include <qdatetime.h>
-#include <qclipboard.h>
-#include <qsimplerichtext.h>
-#include <qregion.h>
-#include <qpalette.h>
-#include <qpainter.h>
-#include <qpoint.h>
-#include <qlistbox.h>
-#include <qiconset.h>
-#include <qstringlist.h>
-#include <qdict.h>
+#include <tqstring.h>
+
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqpopupmenu.h>
+#include <tqregexp.h>
+#include <tqfont.h>
+#include <tqwhatsthis.h>
+#include <tqdatetime.h>
+#include <tqclipboard.h>
+#include <tqsimplerichtext.h>
+#include <tqregion.h>
+#include <tqpalette.h>
+#include <tqpainter.h>
+#include <tqpoint.h>
+#include <tqlistbox.h>
+#include <tqiconset.h>
+#include <tqstringlist.h>
+#include <tqdict.h>
#include <klocale.h>
#include <kconfig.h>
@@ -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<int> *mName2ID;
+ TQDict<int> *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<int>(17, true);
+ d->mName2ID = new TQDict<int>(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<int> it(*d->mName2ID);
+ TQDictIterator<int> 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("<u>%1 tells you:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), ""));
+ cMsg = i18n("<u>%1 tells you:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>";
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("<u>%1 shouts:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), ""));
+ cMsg = i18n("<u>%1 shouts:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"black\">" + cMsg + "</font>";
} else
cMsg = "";
@@ -566,7 +566,7 @@ void KBgChat::handleData(const QString &msg)
case CLIP_WHISPERS:
if (!d->mGag.contains(user)) {
- cMsg = i18n("<u>%1 whispers:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), ""));
+ cMsg = i18n("<u>%1 whispers:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg);
} else
@@ -575,7 +575,7 @@ void KBgChat::handleData(const QString &msg)
case CLIP_KIBITZES:
if (!d->mGag.contains(user)) {
- cMsg = i18n("<u>%1 kibitzes:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), ""));
+ cMsg = i18n("<u>%1 kibitzes:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg);
} else
@@ -583,31 +583,31 @@ void KBgChat::handleData(const QString &msg)
break;
case CLIP_YOU_SAY:
- cMsg = i18n("<u>You tell %1:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + user), ""));
+ cMsg = i18n("<u>You tell %1:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
emit personalMessage(cMsg);
- user = QString::null;
+ user = TQString::null;
break;
case CLIP_YOU_SHOUT:
cMsg = i18n("<u>You shout:</u> %1").arg(cMsg);
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
emit personalMessage(cMsg);
- user = QString::null;
+ user = TQString::null;
break;
case CLIP_YOU_WHISPER:
cMsg = i18n("<u>You whisper:</u> %1").arg(cMsg);
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
emit personalMessage(cMsg);
- user = QString::null;
+ user = TQString::null;
break;
case CLIP_YOU_KIBITZ:
cMsg = i18n("<u>You kibitz:</u> %1").arg(cMsg);
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
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("<u>User %1 left a message at %2</u>: %3").arg(user).arg(date.toString()).arg(cMsg);
cMsg = "<font color=\"red\">" + cMsg + "</font>";
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("<font color=\"darkgreen\">") + cMsg + "</font>";
+ cMsg = TQString("<font color=\"darkgreen\">") + cMsg + "</font>";
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("<font color=\"darkgreen\">") + cMsg + "</font>";
+ cMsg = TQString("<font color=\"darkgreen\">") + cMsg + "</font>";
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("<u>You say to yourself:</u> "));
} 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("<font color=\"blue\">");
+ TQString msg("<font color=\"blue\">");
msg += i18n("The gag list is now empty.");
msg += "</font>";
- addMessage(QString::null, msg);
+ addMessage(TQString::null, msg);
}
/*
@@ -740,11 +740,11 @@ void KBgChat::slotGag()
{
d->mGag.append(d->mName[0]);
- QString msg("<font color=\"blue\">");
+ TQString msg("<font color=\"blue\">");
msg += i18n("You won't hear what %1 says and shouts.").arg(d->mName[0]);
msg += "</font>";
- addMessage(QString::null, msg);
+ addMessage(TQString::null, msg);
}
/*
@@ -762,11 +762,11 @@ void KBgChat::slotUngag()
{
d->mGag.remove(d->mName[0]);
- QString msg("<font color=\"blue\">");
+ TQString msg("<font color=\"blue\">");
msg += i18n("You will again hear what %1 says and shouts.").arg(d->mName[0]);
msg += "</font>";
- 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 = "<font color=\"blue\">" + i18n("You will not hear what people shout.") + "</font>";
else
msg = "<font color=\"blue\">" + i18n("You will hear what people shout.") + "</font>";
- addMessage(QString::null, msg);
+ addMessage(TQString::null, msg);
}
/*
@@ -797,10 +797,10 @@ void KBgChat::slotSilent()
*/
void KBgChat::slotCopy()
{
- d->mText.replace(QRegExp("<u>"), "");
- d->mText.replace(QRegExp("</u>"), "");
- d->mText.replace(QRegExp("</font>"), "");
- d->mText.replace(QRegExp("^.*\">"), "");
+ d->mText.replace(TQRegExp("<u>"), "");
+ d->mText.replace(TQRegExp("</u>"), "");
+ d->mText.replace(TQRegExp("</font>"), "");
+ 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 <qlabel.h>
-#include <qlayout.h>
-#include <qframe.h>
-#include <qspinbox.h>
-#include <qstring.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqframe.h>
+#include <tqspinbox.h>
+#include <tqstring.h>
#include <klocale.h>
#include <klineedit.h>
@@ -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 <qlayout.h>
-#include <qiconset.h>
-#include <qgroupbox.h>
-#include <qpopupmenu.h>
-#include <qcheckbox.h>
-#include <qlistview.h>
-#include <qwhatsthis.h>
-#include <qdatetime.h>
-#include <qlabel.h>
+#include <tqlayout.h>
+#include <tqiconset.h>
+#include <tqgroupbox.h>
+#include <tqpopupmenu.h>
+#include <tqcheckbox.h>
+#include <tqlistview.h>
+#include <tqwhatsthis.h>
+#include <tqdatetime.h>
+#include <tqlabel.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -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 <qtimer.h>
-#include <qpopupmenu.h>
+#include <tqtimer.h>
+#include <tqpopupmenu.h>
#include <kdialogbase.h>
@@ -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 <config.h>
#endif
-#include <qobject.h>
+#include <tqobject.h>
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 <stdlib.h>
#include <time.h>
#include <unistd.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kiconloader.h>
#include <kstdaction.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
#include <kconfig.h>
#include <iostream>
#include <klocale.h>
#include <kmainwindow.h>
#include <klineeditdlg.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kregexp.h>
#include <knotifyclient.h>
@@ -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(" "), "&nbsp;");
+ line.replace(TQRegExp(" "), "&nbsp;");
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.<br/><br/>"));
@@ -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("<br/><font color=\"red\">") + i18n("The GNU Backgammon process (%1) has exited. ")
+ emit infoText(TQString("<br/><font color=\"red\">") + i18n("The GNU Backgammon process (%1) has exited. ")
.arg(proc->pid()) + "</font><br/>");
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 <generic/kbgengine.h>
-#include <qtimer.h>
-#include <qspinbox.h>
+#include <tqtimer.h>
+#include <tqspinbox.h>
#include <kaction.h>
#include <krandomsequence.h>
#include <kprocess.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
/**
*
@@ -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 <stdlib.h>
#include <time.h>
#include <unistd.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kiconloader.h>
#include <kstdaction.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
#include <kconfig.h>
#include <klocale.h>
#include <kmainwindow.h>
#include <klineeditdlg.h>
#include <krandomsequence.h>
-#include <qstringlist.h>
-#include <qcstring.h>
-#include <qtextstream.h>
+#include <tqstringlist.h>
+#include <tqcstring.h>
+#include <tqtextstream.h>
#include <version.h>
@@ -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 <qtimer.h>
-#include <qspinbox.h>
+#include <tqtimer.h>
+#include <tqspinbox.h>
#include <kaction.h>
-#include <qdatastream.h>
+#include <tqdatastream.h>
#include <kgameproperty.h>
#include <generic/kbgengine.h>
@@ -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 <kplayer.h>
-#include <qdatastream.h>
+#include <tqdatastream.h>
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 <qlayout.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qtimer.h>
-#include <qspinbox.h>
-#include <qwhatsthis.h>
-#include <qlineedit.h>
-#include <qvbox.h>
+#include <tqlayout.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqtimer.h>
+#include <tqspinbox.h>
+#include <tqwhatsthis.h>
+#include <tqlineedit.h>
+#include <tqvbox.h>
#include <kapplication.h>
#include <kmessagebox.h>
@@ -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.
diff --git a/kbackgammon/kbg.cpp b/kbackgammon/kbg.cpp
index 55aef32a..711471ad 100644
--- a/kbackgammon/kbg.cpp
+++ b/kbackgammon/kbg.cpp
@@ -24,16 +24,16 @@
#include "kbg.h"
#include "kbg.moc"
-#include <qpainter.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qpixmap.h>
-#include <qstring.h>
-#include <qwhatsthis.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
-#include <qiconset.h>
-#include <qvbox.h>
+#include <tqpainter.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqpixmap.h>
+#include <tqstring.h>
+#include <tqwhatsthis.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqiconset.h>
+#include <tqvbox.h>
#include <kmenubar.h>
#include <ktoolbar.h>
@@ -89,7 +89,7 @@ KBg::KBg()
/*
* The main view is shared between the board and a small text window
*/
- panner = new QSplitter(Vertical, this, "panner");
+ panner = new TQSplitter(Vertical, this, "panner");
board = new KBgBoardSetup(panner, "board");
status = new KBgTextView(panner, "status");
setCentralWidget(panner);
@@ -97,59 +97,59 @@ KBg::KBg()
/*
* Create all actions needed by the application
*/
- newAction = KStdGameAction::gameNew(this, SLOT(openNew()), actionCollection());
+ newAction = KStdGameAction::gameNew(this, TQT_SLOT(openNew()), actionCollection());
newAction->setEnabled(false);
- KStdGameAction::print(this, SLOT(print()), actionCollection());
- KStdGameAction::quit(this, SLOT(close()), actionCollection());
+ KStdGameAction::print(this, TQT_SLOT(print()), actionCollection());
+ KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection());
- QStringList list;
+ TQStringList list;
for (int i = 0; i < MaxEngine; i++)
list.append(engineString[i]);
- engineSet = new KSelectAction(i18n("&Engine"), 0, this, SLOT(setupEngine()), actionCollection(),
+ engineSet = new KSelectAction(i18n("&Engine"), 0, this, TQT_SLOT(setupEngine()), actionCollection(),
"move_engine");
engineSet->setItems(list);
// AB: what the heck has this to do with redisplay? perhaps use reload instead?
- loadAction = KStdAction::redisplay(this, SLOT(load()), actionCollection(), "move_load");
+ loadAction = KStdAction::redisplay(this, TQT_SLOT(load()), actionCollection(), "move_load");
loadAction->setEnabled(false);
- undoAction = KStdGameAction::undo(this, SLOT(undo()), actionCollection());
+ undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection());
undoAction->setEnabled(false);
- redoAction = KStdGameAction::redo(this, SLOT(redo()), actionCollection());
+ redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection());
redoAction->setEnabled(false);
- rollAction = KStdGameAction::roll(this, SLOT(roll()), actionCollection());
+ rollAction = KStdGameAction::roll(this, TQT_SLOT(roll()), actionCollection());
rollAction->setEnabled(false);
- endAction = KStdGameAction::endTurn(this, SLOT(done()), actionCollection());
+ endAction = KStdGameAction::endTurn(this, TQT_SLOT(done()), actionCollection());
endAction->setEnabled(false);
- cubeAction = new KAction(i18n("Double Cube"), QIconSet(kapp->iconLoader()->loadIcon
+ cubeAction = new KAction(i18n("Double Cube"), TQIconSet(kapp->iconLoader()->loadIcon
(PROG_NAME "-double.xpm", KIcon::Toolbar)),
- 0, this, SLOT(cube()), actionCollection(), "move_cube");
+ 0, this, TQT_SLOT(cube()), actionCollection(), "move_cube");
cubeAction->setEnabled(false);
- KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection());
- KStdAction::preferences(this, SLOT(setupDlg()), actionCollection());
- KStdAction::saveOptions(this, SLOT(saveConfig()), actionCollection());
+ KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection());
+ KStdAction::preferences(this, TQT_SLOT(setupDlg()), actionCollection());
+ KStdAction::saveOptions(this, TQT_SLOT(saveConfig()), actionCollection());
KPopupMenu *p = (new KActionMenu(i18n("&Backgammon on the Web"),
actionCollection(), "help_www"))->popupMenu();
- (new KAction(helpTopic[FIBSHome][0], 0, this, SLOT(wwwFIBS()),
+ (new KAction(helpTopic[FIBSHome][0], 0, this, TQT_SLOT(wwwFIBS()),
actionCollection(), "help_www_fibs"))->plug(p);
- (new KAction(helpTopic[RuleHome][0], 0, this, SLOT(wwwRule()),
+ (new KAction(helpTopic[RuleHome][0], 0, this, TQT_SLOT(wwwRule()),
actionCollection(), "help_www_rule"))->plug(p);
/*
* Set up the command line - using actions, otherwise recreating the GUI will delete them
* (e.g. using KEditToolbar)
*/
- cmdLabel = new QLabel(i18n("Command: "), this);
+ cmdLabel = new TQLabel(i18n("Command: "), this);
new KWidgetAction( cmdLabel, cmdLabel->text(), 0, 0, 0, actionCollection(), "command_label");
cmdLine = new KLineEdit(this, "commandline");
- KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, QString::null, 0, 0, 0, actionCollection(), "command_lineedit");
+ KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, TQString::null, 0, 0, 0, actionCollection(), "command_lineedit");
actionCmdLine->setAutoSized(true);
cmdLine->completionObject()->setOrder(KCompletion::Weighted);
- connect(cmdLine, SIGNAL(returnPressed(const QString &)), this, SLOT(handleCmd(const QString &)));
+ connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(handleCmd(const TQString &)));
/*
* Done with the actions, create the XML-defined parts of the
* user interface
@@ -173,33 +173,33 @@ KBg::KBg()
* Set up configuration handling.
* FIXME: support session management
*/
- connect(this, SIGNAL(readSettings()), board, SLOT(readConfig()));
- connect(this, SIGNAL(saveSettings()), board, SLOT(saveConfig()));
+ connect(this, TQT_SIGNAL(readSettings()), board, TQT_SLOT(readConfig()));
+ connect(this, TQT_SIGNAL(saveSettings()), board, TQT_SLOT(saveConfig()));
/*
* Set up some whatis messages for the online help
*/
- QWhatsThis::add(status, i18n("This area contains the status messages for the game. "
+ TQWhatsThis::add(status, i18n("This area contains the status messages for the game. "
"Most of these messages are sent to you from the current "
"engine."));
- QWhatsThis::add(toolBar("cmdToolBar"),
+ TQWhatsThis::add(toolBar("cmdToolBar"),
i18n("This is the command line. You can type special "
"commands related to the current engine in here. "
"Most relevant commands are also available "
"through the menus."));
- QWhatsThis::add(toolBar("mainToolBar"),
+ TQWhatsThis::add(toolBar("mainToolBar"),
i18n("This is the button bar tool bar. It gives "
"you easy access to game related commands. "
"You can drag the bar to a different location "
"within the window."));
- QWhatsThis::add(statusBar(),
+ TQWhatsThis::add(statusBar(),
i18n("This is the status bar. It shows you the currently "
"selected engine in the left corner."));
/*
* Create and initialize the context menu
*/
- QPopupMenu* menu = (QPopupMenu*)factory()->container("popup", this);
+ TQPopupMenu* menu = (TQPopupMenu*)factory()->container("popup", this);
board->setContextMenu(menu);
}
@@ -239,8 +239,8 @@ void KBg::setupEngine()
/*
* Remove the old engine, create a new one, and hook up menu and slots/signals
*/
- QPopupMenu *commandMenu = (QPopupMenu *)factory()->container("command_menu", this);
- QString s = PROG_NAME;
+ TQPopupMenu *commandMenu = (TQPopupMenu *)factory()->container("command_menu", this);
+ TQString s = PROG_NAME;
commandMenu->clear();
if (currEngine != None) {
@@ -275,26 +275,26 @@ void KBg::setupEngine()
newAction->setEnabled(engine[currEngine]->haveNewGame());
// engine -> this
- connect(engine[currEngine], SIGNAL(statText(const QString &)), this, SLOT(updateCaption(const QString &)));
- connect(engine[currEngine], SIGNAL(infoText(const QString &)), status, SLOT(write(const QString &)));
- connect(engine[currEngine], SIGNAL(allowCommand(int, bool)), this, SLOT(allowCommand(int, bool)));
+ connect(engine[currEngine], TQT_SIGNAL(statText(const TQString &)), this, TQT_SLOT(updateCaption(const TQString &)));
+ connect(engine[currEngine], TQT_SIGNAL(infoText(const TQString &)), status, TQT_SLOT(write(const TQString &)));
+ connect(engine[currEngine], TQT_SIGNAL(allowCommand(int, bool)), this, TQT_SLOT(allowCommand(int, bool)));
// this -> engine
- connect(this, SIGNAL(readSettings()), engine[currEngine], SLOT(readConfig()));
- connect(this, SIGNAL(saveSettings()), engine[currEngine], SLOT(saveConfig()));
+ connect(this, TQT_SIGNAL(readSettings()), engine[currEngine], TQT_SLOT(readConfig()));
+ connect(this, TQT_SIGNAL(saveSettings()), engine[currEngine], TQT_SLOT(saveConfig()));
// board -> engine
- connect(board, SIGNAL(rollDice(const int)), engine[currEngine], SLOT(rollDice(const int)));
- connect(board, SIGNAL(doubleCube(const int)), engine[currEngine], SLOT(doubleCube(const int)));
- connect(board, SIGNAL(currentMove(QString *)), engine[currEngine], SLOT(handleMove(QString *)));
+ connect(board, TQT_SIGNAL(rollDice(const int)), engine[currEngine], TQT_SLOT(rollDice(const int)));
+ connect(board, TQT_SIGNAL(doubleCube(const int)), engine[currEngine], TQT_SLOT(doubleCube(const int)));
+ connect(board, TQT_SIGNAL(currentMove(TQString *)), engine[currEngine], TQT_SLOT(handleMove(TQString *)));
// engine -> board
- connect(engine[currEngine], SIGNAL(undoMove()), board, SLOT(undoMove()));
- connect(engine[currEngine], SIGNAL(redoMove()), board, SLOT(redoMove()));
- connect(engine[currEngine], SIGNAL(setEditMode(const bool)), board, SLOT(setEditMode(const bool)));
- connect(engine[currEngine], SIGNAL(allowMoving(const bool)), board, SLOT(allowMoving(const bool)));
- connect(engine[currEngine], SIGNAL(getState(KBgStatus *)), board, SLOT(getState(KBgStatus *)));
- connect(engine[currEngine], SIGNAL(newState(const KBgStatus &)), board, SLOT(setState(const KBgStatus &)));
+ connect(engine[currEngine], TQT_SIGNAL(undoMove()), board, TQT_SLOT(undoMove()));
+ connect(engine[currEngine], TQT_SIGNAL(redoMove()), board, TQT_SLOT(redoMove()));
+ connect(engine[currEngine], TQT_SIGNAL(setEditMode(const bool)), board, TQT_SLOT(setEditMode(const bool)));
+ connect(engine[currEngine], TQT_SIGNAL(allowMoving(const bool)), board, TQT_SLOT(allowMoving(const bool)));
+ connect(engine[currEngine], TQT_SIGNAL(getState(KBgStatus *)), board, TQT_SLOT(getState(KBgStatus *)));
+ connect(engine[currEngine], TQT_SIGNAL(newState(const KBgStatus &)), board, TQT_SLOT(setState(const KBgStatus &)));
// now that all signals are connected, start the engine
engine[currEngine]->start();
@@ -363,14 +363,14 @@ void KBg::readConfig()
config->setGroup("main window");
- QPoint pos, defpos(10, 10);
- QFont kappFont = kapp->font();
+ TQPoint pos, defpos(10, 10);
+ TQFont kappFont = kapp->font();
pos = config->readPointEntry("origin", &defpos);
status->setFont(config->readFontEntry("font", &kappFont));
- QValueList<int> l;
+ TQValueList<int> l;
l.append(qRound( config->readDoubleNumEntry("panner", 0.75) *panner->height()));
l.append(qRound((1-config->readDoubleNumEntry("panner", 0.75))*panner->height()));
panner->setSizes(l);
@@ -481,7 +481,7 @@ void KBg::setupDone()
// FIXME make more general...
-void KBg::startKCM(const QString &url)
+void KBg::startKCM(const TQString &url)
{
KRun::runCommand(url);
}
@@ -506,29 +506,29 @@ void KBg::setupDlg()
/*
* Main Widget
*/
- QVBox *w = nb->addVBoxPage(i18n("General"), i18n("Here you can configure general settings of %1").
+ TQVBox *w = nb->addVBoxPage(i18n("General"), i18n("Here you can configure general settings of %1").
arg(kapp->aboutData()->programName()),
kapp->iconLoader()->loadIcon("go", KIcon::Desktop));
/*
* Group boxes
*/
- QGroupBox *gbm = new QGroupBox(i18n("Messages"), w);
- QGroupBox *gbt = new QGroupBox(i18n("Timer"), w);
- QGroupBox *gbs = new QGroupBox(i18n("Autosave"), w);
- QGroupBox *gbe = new QGroupBox(i18n("Events"), w);
+ TQGroupBox *gbm = new TQGroupBox(i18n("Messages"), w);
+ TQGroupBox *gbt = new TQGroupBox(i18n("Timer"), w);
+ TQGroupBox *gbs = new TQGroupBox(i18n("Autosave"), w);
+ TQGroupBox *gbe = new TQGroupBox(i18n("Events"), w);
/*
* Timer box
*/
- QWhatsThis::add(gbt, i18n("After you finished your moves, they have to be sent to the engine. "
+ TQWhatsThis::add(gbt, i18n("After you finished your moves, they have to be sent to the engine. "
"You can either do that manually (in which case you should not enable "
"this feature), or you can specify an amount of time that has to pass "
"before the move is committed. If you undo a move during the timeout, the "
"timeout will be reset and restarted once you finish the move. This is "
"very useful if you would like to review the result of your move."));
- cbt = new QCheckBox(i18n("Enable timeout"), gbt);
+ cbt = new TQCheckBox(i18n("Enable timeout"), gbt);
cbt->setChecked(config->readBoolEntry("enable timeout", true));
sbt = new KDoubleNumInput(gbt);
@@ -536,49 +536,49 @@ void KBg::setupDlg()
sbt->setLabel(i18n("Move timeout in seconds:"));
sbt->setValue(config->readDoubleNumEntry("timeout", 2.5));
- connect(cbt, SIGNAL(toggled(bool)), sbt, SLOT(setEnabled(bool)));
+ connect(cbt, TQT_SIGNAL(toggled(bool)), sbt, TQT_SLOT(setEnabled(bool)));
sbt->setEnabled(cbt->isChecked());
- QGridLayout *gl = new QGridLayout(gbt, 2, 1, 20);
+ TQGridLayout *gl = new TQGridLayout(gbt, 2, 1, 20);
gl->addWidget(cbt, 0, 0);
gl->addWidget(sbt, 1, 0);
/*
* Enable messages
*/
- QWhatsThis::add(gbm, i18n("Check the box to enable all the messages that you have previously "
+ TQWhatsThis::add(gbm, i18n("Check the box to enable all the messages that you have previously "
"disabled by choosing the \"Don't show this message again\" option."));
- QGridLayout *glm = new QGridLayout(gbm, 1, 1, nb->spacingHint());
- cbm = new QCheckBox(i18n("Reenable all messages"), gbm);
+ TQGridLayout *glm = new TQGridLayout(gbm, 1, 1, nb->spacingHint());
+ cbm = new TQCheckBox(i18n("Reenable all messages"), gbm);
glm->addWidget(cbm, 0, 0);
/*
* Save options on exit ?
*/
- QWhatsThis::add(gbm, i18n("Check the box to automatically save all window positions on program "
+ TQWhatsThis::add(gbm, i18n("Check the box to automatically save all window positions on program "
"exit. They will be restored at next start."));
- QGridLayout *gls = new QGridLayout(gbs, 1, 1, nb->spacingHint());
- cbs = new QCheckBox(i18n("Save settings on exit"), gbs);
+ TQGridLayout *gls = new TQGridLayout(gbs, 1, 1, nb->spacingHint());
+ cbs = new TQCheckBox(i18n("Save settings on exit"), gbs);
cbs->setChecked(config->readBoolEntry("autosave on exit", true));
gls->addWidget(cbs, 0, 0);
/*
* Event vonfiguration
*/
- QWhatsThis::add(gbe, i18n("Event notification of %1 is configured as part of the "
+ TQWhatsThis::add(gbe, i18n("Event notification of %1 is configured as part of the "
"system-wide notification process. Click here, and you "
"will be able to configure system sounds, etc.").
arg(kapp->aboutData()->programName()));
- QGridLayout *gle = new QGridLayout(gbe, 1, 1, nb->spacingHint());
+ TQGridLayout *gle = new TQGridLayout(gbe, 1, 1, nb->spacingHint());
KURLLabel *lab = new KURLLabel("kcmshell kcmnotify",
i18n("Klick here to configure the event notification"), gbe);
lab->setMaximumSize(lab->sizeHint());
gle->addWidget(lab, 0, 0);
- connect(lab, SIGNAL(leftClickedURL(const QString &)), SLOT(startKCM(const QString &)));
+ connect(lab, TQT_SIGNAL(leftClickedURL(const TQString &)), TQT_SLOT(startKCM(const TQString &)));
/*
* Board settings
@@ -589,8 +589,8 @@ void KBg::setupDlg()
* Hack alert: this little trick makes sure that ALL engines
* have their settings available in the dialog.
*/
- QPopupMenu *dummyPopup = new QPopupMenu(nb);
- QString s = PROG_NAME;
+ TQPopupMenu *dummyPopup = new TQPopupMenu(nb);
+ TQString s = PROG_NAME;
for (int i = 0; i < MaxEngine; i++) {
if (currEngine != i) {
switch (i) {
@@ -607,7 +607,7 @@ void KBg::setupDlg()
engine[i] = new KBgEngineNg(nb, &s, dummyPopup);
break;
}
- connect(this, SIGNAL(saveSettings()), engine[i], SLOT(saveConfig()));
+ connect(this, TQT_SIGNAL(saveSettings()), engine[i], TQT_SLOT(saveConfig()));
}
engine[i]->getSetupPages(nb);
}
@@ -615,12 +615,12 @@ void KBg::setupDlg()
/*
* Connect the signals of nb
*/
- connect(nb, SIGNAL(okClicked()), this, SLOT(setupOk()));
- connect(nb, SIGNAL(applyClicked()), this, SLOT(setupOk()));
- connect(nb, SIGNAL(cancelClicked()), this, SLOT(setupCancel()));
- connect(nb, SIGNAL(defaultClicked()),this, SLOT(setupDefault()));
+ connect(nb, TQT_SIGNAL(okClicked()), this, TQT_SLOT(setupOk()));
+ connect(nb, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(setupOk()));
+ connect(nb, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(setupCancel()));
+ connect(nb, TQT_SIGNAL(defaultClicked()),this, TQT_SLOT(setupDefault()));
- connect(nb, SIGNAL(finished()), this, SLOT(setupDone()));
+ connect(nb, TQT_SIGNAL(finished()), this, TQT_SLOT(setupDone()));
nb->resize(nb->minimumSize());
nb->show();
@@ -647,7 +647,7 @@ void KBg::print()
prt->setOrientation((KPrinter::Orientation)config->readNumEntry("orientation", KPrinter::Landscape));
if (prt->setup(this, i18n("Print %1").arg(baseCaption))) {
- QPainter p;
+ TQPainter p;
p.begin(prt);
board->print(&p);
p.end();
@@ -686,7 +686,7 @@ void KBg::configureToolbars()
{
saveMainWindowSettings(KGlobal::config(), "kedittoolbar settings"); // temp group
KEditToolbar dlg(actionCollection(), xmlFile(), true, this);
- connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(newToolbarConfig()));
+ connect(&dlg,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(newToolbarConfig()));
dlg.exec();
KGlobal::config()->deleteGroup( "kedittoolbar settings" ); // delete temp group
}
@@ -748,14 +748,14 @@ bool KBg::queryClose()
* Set the caption of the main window. If the user has requested pip
* counts, they are appended, too.
*/
-void KBg::updateCaption(const QString &s)
+void KBg::updateCaption(const TQString &s)
{
baseCaption = s;
- QString msg;
+ TQString msg;
if (!s.isEmpty()) {
msg = s;
if (board->getPipCount(US) >= 0) {
- QString tmp;
+ TQString tmp;
tmp.setNum(board->getPipCount(US ));
msg += " - " + tmp;
tmp.setNum(board->getPipCount(THEM));
@@ -769,7 +769,7 @@ void KBg::updateCaption(const QString &s)
* Take the string from the commandline, give it to the engine, append
* to the history and clear the buffer.
*/
-void KBg::handleCmd(const QString &s)
+void KBg::handleCmd(const TQString &s)
{
if (!s.stripWhiteSpace().isEmpty()) {
engine[currEngine]->handleCommand(s);
@@ -810,7 +810,7 @@ void KBg::allowCommand(int cmd, bool f)
* Catch the hide envents. That way, the current engine can close its
* child windows.
*/
-void KBg::hideEvent(QHideEvent *e)
+void KBg::hideEvent(TQHideEvent *e)
{
KMainWindow::hideEvent(e);
engine[currEngine]->hideEvent();
@@ -820,7 +820,7 @@ void KBg::hideEvent(QHideEvent *e)
* Catch the show envents. That way, the current engine can open any
* previously hidden windows.
*/
-void KBg::showEvent(QShowEvent *e)
+void KBg::showEvent(TQShowEvent *e)
{
KMainWindow::showEvent(e);
engine[currEngine]->showEvent();
diff --git a/kbackgammon/kbg.h b/kbackgammon/kbg.h
index d191c8a3..030b30ad 100644
--- a/kbackgammon/kbg.h
+++ b/kbackgammon/kbg.h
@@ -73,7 +73,7 @@ public slots:
* Set the caption to KFIBS_NAME + string + pipcount (if requested by
* the user)
*/
- void updateCaption(const QString &s);
+ void updateCaption(const TQString &s);
/**
* Slot to be called by the engine - it enables/disables buttons
@@ -86,7 +86,7 @@ public slots:
*/
void setupEngine();
- void startKCM(const QString &);
+ void startKCM(const TQString &);
signals:
@@ -106,12 +106,12 @@ protected:
/*
* Windows are to be hidden
*/
- virtual void hideEvent(QHideEvent *);
+ virtual void hideEvent(TQHideEvent *);
/*
* Redisplay the windows
*/
- virtual void showEvent(QShowEvent *);
+ virtual void showEvent(TQShowEvent *);
/*
* Called before the window is closed. Check with the engine
@@ -140,7 +140,7 @@ protected slots:
* Takes text from the commandline and hands it over to the
* current engine
*/
- void handleCmd(const QString &);
+ void handleCmd(const TQString &);
/**
* Saves the user settings to disk
@@ -198,13 +198,13 @@ private:
* Each engine has its own identifier.
*/
enum Engines {None = -1, Offline, FIBS, GNUbg, NextGen, MaxEngine};
- QString engineString[MaxEngine];
+ TQString engineString[MaxEngine];
KBgEngine *engine[MaxEngine];
int currEngine;
- QPopupMenu *dummyPopup;
+ TQPopupMenu *dummyPopup;
enum HelpTopics {FIBSHome, RuleHome, MaxHelpTopic};
- QString helpTopic[MaxHelpTopic][2];
+ TQString helpTopic[MaxHelpTopic][2];
KSelectAction *engineSet;
/**
@@ -212,17 +212,17 @@ private:
*/
KDialogBase *nb;
KDoubleNumInput *sbt;
- QCheckBox *cbt, *cbs, *cbm;
+ TQCheckBox *cbt, *cbs, *cbm;
/*
* UI elements
*/
- QSplitter *panner;
+ TQSplitter *panner;
KBgBoardSetup *board;
KBgTextView *status;
KLineEdit *cmdLine;
- QLabel *cmdLabel;
- QString baseCaption; // for user friendly printing, we keep it around
+ TQLabel *cmdLabel;
+ TQString baseCaption; // for user friendly printing, we keep it around
};
#endif // __KBG_H
diff --git a/kbackgammon/kbgboard.cpp b/kbackgammon/kbgboard.cpp
index 8b961a45..fc024ab8 100644
--- a/kbackgammon/kbgboard.cpp
+++ b/kbackgammon/kbgboard.cpp
@@ -39,12 +39,12 @@
#include <math.h>
#include <kcolordialog.h>
#include <klocale.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qbuttongroup.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqbuttongroup.h>
#include <kconfig.h>
-#include <qwhatsthis.h>
-#include <qvbox.h>
+#include <tqwhatsthis.h>
+#include <tqvbox.h>
#include <kiconloader.h>
#include <ktabctl.h>
#include <kpushbutton.h>
@@ -64,17 +64,17 @@ static const int MINIMUM_CHECKER_SIZE = 10;
void KBgBoardSetup::setupDefault()
{
// default background color
- setBackgroundColor(QColor(200, 200, 166));
- pbc_1->setPalette(QPalette(backgroundColor()));
+ setBackgroundColor(TQColor(200, 200, 166));
+ pbc_1->setPalette(TQPalette(backgroundColor()));
// checker colors
baseColors[0] = black;
baseColors[1] = white;
- pbc_2->setPalette(QPalette(baseColors[0]));
- pbc_3->setPalette(QPalette(baseColors[1]));
+ pbc_2->setPalette(TQPalette(baseColors[0]));
+ pbc_3->setPalette(TQPalette(baseColors[1]));
// default font
- setFont(QFont("Serif", 18, QFont::Normal));
+ setFont(TQFont("Serif", 18, TQFont::Normal));
kf->setFont(getFont());
// short moves
@@ -128,7 +128,7 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb)
* Main Widget
* ===========
*/
- QVBox *vbp = nb->addVBoxPage(i18n("Board"), i18n("Here you can configure the backgammon board"),
+ TQVBox *vbp = nb->addVBoxPage(i18n("Board"), i18n("Here you can configure the backgammon board"),
kapp->iconLoader()->loadIcon(PROG_NAME, KIcon::Desktop));
/*
@@ -136,16 +136,16 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb)
*/
KTabCtl *tc = new KTabCtl(vbp, "board tabs");
- 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 *ga = new QGroupBox(w);
- QButtonGroup *gm = new QButtonGroup(w);
- QGroupBox *go = new QGroupBox(w);
+ TQGroupBox *ga = new TQGroupBox(w);
+ TQButtonGroup *gm = new TQButtonGroup(w);
+ TQGroupBox *go = new TQGroupBox(w);
ga->setTitle(i18n("Colors"));
gm->setTitle(i18n("Short Moves"));
@@ -159,35 +159,35 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb)
* Appearance group
* ----------------
*/
- QGridLayout *blc = new QGridLayout(ga, 2, 2, 20);
+ TQGridLayout *blc = new TQGridLayout(ga, 2, 2, 20);
- pbc_1 = new QPushButton(i18n("Background"), ga);
- pbc_1->setPalette(QPalette(backgroundColor()));
+ pbc_1 = new TQPushButton(i18n("Background"), ga);
+ pbc_1->setPalette(TQPalette(backgroundColor()));
- pbc_2 = new QPushButton(i18n("Color 1"), ga);
- pbc_2->setPalette(QPalette(baseColors[0]));
+ pbc_2 = new TQPushButton(i18n("Color 1"), ga);
+ pbc_2->setPalette(TQPalette(baseColors[0]));
- pbc_3 = new QPushButton(i18n("Color 2"), ga);
- pbc_3->setPalette(QPalette(baseColors[1]));
+ pbc_3 = new TQPushButton(i18n("Color 2"), ga);
+ pbc_3->setPalette(TQPalette(baseColors[1]));
blc->addWidget(pbc_2, 0, 0);
blc->addWidget(pbc_3, 0, 1);
blc->addMultiCellWidget(pbc_1, 1, 1, 0, 1);
- connect(pbc_1, SIGNAL(clicked()), this, SLOT(selectBackgroundColor()));
- connect(pbc_2, SIGNAL(clicked()), this, SLOT(selectBaseColorOne()));
- connect(pbc_3, SIGNAL(clicked()), this, SLOT(selectBaseColorTwo()));
+ connect(pbc_1, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectBackgroundColor()));
+ connect(pbc_2, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectBaseColorOne()));
+ connect(pbc_3, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectBaseColorTwo()));
/*
* Moving style
* ------------
*/
- QBoxLayout *blm = new QVBoxLayout(gm, nb->spacingHint());
+ TQBoxLayout *blm = new TQVBoxLayout(gm, nb->spacingHint());
blm->addSpacing(gm->fontMetrics().height());
for (int i = 0; i < 3; i++)
- rbMove[i] = new QRadioButton(gm);
+ rbMove[i] = new TQRadioButton(gm);
rbMove[SHORT_MOVE_NONE]->setText(i18n("&Disable short moves. Only drag and drop will move."));
rbMove[SHORT_MOVE_SINGLE]->setText(i18n("&Single clicks with the left mouse button will\n"
@@ -205,9 +205,9 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb)
* Other options
* -------------
*/
- QGridLayout *glo = new QGridLayout(go, 1, 1, 20);
+ TQGridLayout *glo = new TQGridLayout(go, 1, 1, 20);
- cbp = new QCheckBox(i18n("Show pip count in title bar"), go);
+ cbp = new TQCheckBox(i18n("Show pip count in title bar"), go);
cbp->setChecked(computePipCount);
cbp->adjustSize();
cbp->setMinimumSize(cbp->size());
@@ -234,10 +234,10 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb)
* Font selection page
* ===================
*/
- w = new QWidget(tc);
+ w = new TQWidget(tc);
kf = new KFontChooser(w);
kf->setFont(getFont());
- gl = new QGridLayout(w, 1, 1, nb->spacingHint());
+ gl = new TQGridLayout(w, 1, 1, nb->spacingHint());
gl->addWidget(kf, 0, 0);
gl->activate();
w->adjustSize();
@@ -248,7 +248,7 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb)
/*
* Empty constructor calls the board constructor
*/
-KBgBoardSetup::KBgBoardSetup(QWidget *parent, const char *name, QPopupMenu *menu)
+KBgBoardSetup::KBgBoardSetup(TQWidget *parent, const char *name, TQPopupMenu *menu)
: KBgBoard(parent, name, menu)
{
// empty
@@ -263,7 +263,7 @@ void KBgBoardSetup::selectBaseColorOne()
c->setColor(baseColors[0]);
if (c->exec()) {
baseColors[0] = c->color();
- pbc_2->setPalette(QPalette(baseColors[0]));
+ pbc_2->setPalette(TQPalette(baseColors[0]));
for (int i = 0; i < 30; i++)
cells[i]->update();
}
@@ -279,7 +279,7 @@ void KBgBoardSetup::selectBaseColorTwo()
c->setColor(baseColors[1]);
if (c->exec()) {
baseColors[1] = c->color();
- pbc_3->setPalette(QPalette(baseColors[1]));
+ pbc_3->setPalette(TQPalette(baseColors[1]));
for (int i = 0; i < 30; i++)
cells[i]->update();
}
@@ -295,7 +295,7 @@ void KBgBoardSetup::selectBackgroundColor()
c->setColor(backgroundColor());
if (c->exec()) {
setBackgroundColor(c->color());
- pbc_1->setPalette(QPalette(backgroundColor()));
+ pbc_1->setPalette(TQPalette(backgroundColor()));
for (int i = 0; i < 30; i++)
cells[i]->update();
}
@@ -323,8 +323,8 @@ void KBgBoard::saveConfig()
*/
void KBgBoard::readConfig()
{
- QColor col(200, 200, 166);
- QFont fon("Serif", 18, QFont::Normal);
+ TQColor col(200, 200, 166);
+ TQFont fon("Serif", 18, TQFont::Normal);
KConfig* config = kapp->config();
config->setGroup(name());
@@ -341,7 +341,7 @@ void KBgBoard::readConfig()
* Get the font the board cells should use for the display of
* numbers and cube value.
*/
-QFont KBgBoard::getFont() const
+TQFont KBgBoard::getFont() const
{
return boardFont;
}
@@ -350,7 +350,7 @@ QFont KBgBoard::getFont() const
* Allows the users of the board classe to set the font to be used
* on the board. Note that the fontsize is dynamically set
*/
-void KBgBoard::setFont(const QFont& f)
+void KBgBoard::setFont(const TQFont& f)
{
boardFont = f;
}
@@ -378,16 +378,16 @@ void KBgBoard::queryCube()
* Constructor, creates the dialog but does not show nor execute it.
*/
KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them)
- : QDialog(0, 0, true)
+ : TQDialog(0, 0, true)
{
setCaption(i18n("Set Cube Values"));
- QBoxLayout *vbox = new QVBoxLayout(this, 17);
+ TQBoxLayout *vbox = new TQVBoxLayout(this, 17);
- QLabel *info = new QLabel(this);
+ TQLabel *info = new TQLabel(this);
- cb[0] = new QComboBox(this, "first sb");
- cb[1] = new QComboBox(this, "second sb");
+ cb[0] = new TQComboBox(this, "first sb");
+ cb[1] = new TQComboBox(this, "second sb");
ok = new KPushButton(KStdGuiItem::ok(), this);
cancel = new KPushButton(KStdGuiItem::cancel(), this);
@@ -399,8 +399,8 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them)
vbox->addWidget(info, 0);
- QBoxLayout *hbox_1 = new QHBoxLayout();
- QBoxLayout *hbox_2 = new QHBoxLayout();
+ TQBoxLayout *hbox_1 = new TQHBoxLayout();
+ TQBoxLayout *hbox_2 = new TQHBoxLayout();
vbox->addLayout(hbox_1);
vbox->addLayout(hbox_2);
@@ -471,11 +471,11 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them)
cb[0]->setFocus();
- connect(ok, SIGNAL(clicked()), SLOT(accept()));
- connect(cancel, SIGNAL(clicked()), SLOT(reject()));
+ connect(ok, TQT_SIGNAL(clicked()), TQT_SLOT(accept()));
+ connect(cancel, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
- connect(cb[0], SIGNAL(activated(int)), SLOT(changePlayer(int)));
- connect(cb[1], SIGNAL(activated(int)), SLOT(changeValue (int)));
+ connect(cb[0], TQT_SIGNAL(activated(int)), TQT_SLOT(changePlayer(int)));
+ connect(cb[1], TQT_SIGNAL(activated(int)), TQT_SLOT(changeValue (int)));
}
/*
@@ -528,16 +528,16 @@ void KBgBoardQCube::changePlayer(int val)
* Constructor, creates the dialog but does not show nor execute it.
*/
KBgBoardQDice::KBgBoardQDice(const char *name)
- : QDialog(0, name, true)
+ : TQDialog(0, name, true)
{
setCaption(i18n("Set Dice Values"));
- QBoxLayout *vbox = new QVBoxLayout(this, 17);
+ TQBoxLayout *vbox = new TQVBoxLayout(this, 17);
- QLabel *info = new QLabel(this);
+ TQLabel *info = new TQLabel(this);
- sb[0] = new QSpinBox(this, "first sb");
- sb[1] = new QSpinBox(this, "second sb");
+ sb[0] = new TQSpinBox(this, "first sb");
+ sb[1] = new TQSpinBox(this, "second sb");
ok = new KPushButton(KStdGuiItem::ok(), this);
cancel = new KPushButton(KStdGuiItem::cancel(), this);
@@ -548,8 +548,8 @@ KBgBoardQDice::KBgBoardQDice(const char *name)
vbox->addWidget(info, 0);
- QBoxLayout *hbox_1 = new QHBoxLayout();
- QBoxLayout *hbox_2 = new QHBoxLayout();
+ TQBoxLayout *hbox_1 = new TQHBoxLayout();
+ TQBoxLayout *hbox_2 = new TQHBoxLayout();
vbox->addLayout(hbox_1);
vbox->addLayout(hbox_2);
@@ -577,8 +577,8 @@ KBgBoardQDice::KBgBoardQDice(const char *name)
sb[0]->setFocus();
- connect(ok, SIGNAL(clicked()), SLOT(accept()));
- connect(cancel, SIGNAL(clicked()), SLOT(reject()));
+ connect(ok, TQT_SIGNAL(clicked()), TQT_SLOT(accept()));
+ connect(cancel, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
sb[0]->setValue(1);
sb[1]->setValue(1);
@@ -656,7 +656,7 @@ KBgStatus* KBgBoard::getState(KBgStatus *st) const
/*
* This function lets external users change the context menu
*/
-void KBgBoard::setContextMenu(QPopupMenu *menu)
+void KBgBoard::setContextMenu(TQPopupMenu *menu)
{
contextMenu = menu;
}
@@ -670,12 +670,12 @@ void KBgBoard::sendMove()
if (getEditMode())
return;
- QString s, t;
+ TQString s, t;
s.setNum(moveHistory.count());
s += " ";
- QPtrListIterator<KBgBoardMove> it(moveHistory);
+ TQPtrListIterator<KBgBoardMove> it(moveHistory);
for (; it.current(); ++it) {
KBgBoardMove *move = it.current();
if (move->source() == BAR_US || move->source() == BAR_THEM ) {
@@ -702,22 +702,22 @@ void KBgBoard::sendMove()
}
/*
- * This is overloaded from QWidget, since it has to pass the new
+ * This is overloaded from TQWidget, since it has to pass the new
* background color to the child widgets (the cells).
*/
-void KBgBoard::setBackgroundColor(const QColor &col)
+void KBgBoard::setBackgroundColor(const TQColor &col)
{
if (col != backgroundColor()) {
- QWidget::setBackgroundColor(col);
+ TQWidget::setBackgroundColor(col);
for( int i = 0; i < 30; ++i)
cells[i]->setBackgroundColor(col);
}
}
/*
- * Overloaded from QWidget since we have to resize all cells
+ * Overloaded from TQWidget since we have to resize all cells
*/
-void KBgBoard::resizeEvent(QResizeEvent *)
+void KBgBoard::resizeEvent(TQResizeEvent *)
{
int xo0 = 0;
int xo1, w;
@@ -750,7 +750,7 @@ void KBgBoard::resizeEvent(QResizeEvent *)
* can print whatever she/he wants above the 0.2*p->viewport().height()
* margin (like game status information).
*/
-void KBgBoard::print(QPainter *p)
+void KBgBoard::print(TQPainter *p)
{
double sf = 0.8*p->viewport().width()/width();
int xo = int((p->viewport().width() - sf*width())/2);
@@ -770,7 +770,7 @@ void KBgBoard::print(QPainter *p)
* of the given sign(!). I.e. we distinguish checkers by whether
* they are negative or positive.
*/
-QColor KBgBoard::getCheckerColor(int p) const
+TQColor KBgBoard::getCheckerColor(int p) const
{
return ((p < 0) ? baseColors[0] : baseColors[1]);
}
@@ -799,14 +799,14 @@ int KBgBoardCell::getCheckerDiameter() const
/*
* Draws the cells content using the painter p.
- * Reimplemented from QLabel.
+ * Reimplemented from TQLabel.
*/
-void KBgBoardCell::drawContents(QPainter *)
+void KBgBoardCell::drawContents(TQPainter *)
{
- QRect cr(0, 0, width(), height());
+ TQRect cr(0, 0, width(), height());
cr.moveBottomLeft(rect().bottomLeft());
- QPixmap pix(cr.size());
- QPainter tmp;
+ TQPixmap pix(cr.size());
+ TQPainter tmp;
pix.fill(this, cr.topLeft());
tmp.begin(&pix);
paintCell(&tmp);
@@ -825,7 +825,7 @@ void KBgBoardCell::drawContents(QPainter *)
* overloaded paintCell() member are supposed to call this one after(!) they
* have painted themselves.
*/
-void KBgBoardCell::paintCell(QPainter *p, int xo, int yo, double sf) const
+void KBgBoardCell::paintCell(TQPainter *p, int xo, int yo, double sf) const
{
int x1 = xo; int x2 = xo;
int y1 = yo; int y2 = yo;
@@ -857,7 +857,7 @@ void KBgBoardCell::paintCell(QPainter *p, int xo, int yo, double sf) const
* for bars and homes to get them separated from the rest of the board.
*/
void
-KBgBoardCell::drawVertBorder(QPainter *p, int xo, int yo, double sf) const
+KBgBoardCell::drawVertBorder(TQPainter *p, int xo, int yo, double sf) const
{
p->setBrush(black);
p->setPen(black);
@@ -870,7 +870,7 @@ KBgBoardCell::drawVertBorder(QPainter *p, int xo, int yo, double sf) const
* starts at the upper left corner (xo, yo) and uses the scaling factor
* sf.
*/
-void KBgBoardHome::paintCell(QPainter *p, int xo, int yo, double sf) const
+void KBgBoardHome::paintCell(TQPainter *p, int xo, int yo, double sf) const
{
/*
* Only these homes contain checkers. The other ones contains dice and cube.
@@ -902,7 +902,7 @@ void KBgBoardHome::paintCell(QPainter *p, int xo, int yo, double sf) const
* checkers and the cube. Please read the comments in the code on how
* and why the checkers and (especially) the cube is printed.
*/
-void KBgBoardBar::paintCell(QPainter *p, int xo, int yo, double sf) const
+void KBgBoardBar::paintCell(TQPainter *p, int xo, int yo, double sf) const
{
/*
* Put in the checkers.
@@ -944,18 +944,18 @@ void KBgBoardBar::paintCell(QPainter *p, int xo, int yo, double sf) const
* the coundaries given by cubeRect(...). The other parameters are like
* in the other functions.
*/
-void KBgBoardCell::drawCube(QPainter *p, int who, int xo, int yo,
+void KBgBoardCell::drawCube(TQPainter *p, int who, int xo, int yo,
double sf) const
{
- QRect r = cubeRect(who, true, sf);
- r.moveTopLeft(QPoint(xo+r.left(), yo+r.top()));
+ TQRect r = cubeRect(who, true, sf);
+ r.moveTopLeft(TQPoint(xo+r.left(), yo+r.top()));
p->setBrush(black);
p->setPen(black);
p->drawRoundRect(r, 20, 20);
r = cubeRect(who, false, sf);
- r.moveTopLeft(QPoint(xo+r.left(), yo+r.top()));
+ r.moveTopLeft(TQPoint(xo+r.left(), yo+r.top()));
p->setBrush(white);
p->setPen(white);
@@ -964,7 +964,7 @@ void KBgBoardCell::drawCube(QPainter *p, int who, int xo, int yo,
p->setBrush(black);
p->setPen(black);
- QString cubeNum;
+ TQString cubeNum;
int v = board->getCube();
/*
* Ensure that the cube shows 64 initially
@@ -975,7 +975,7 @@ void KBgBoardCell::drawCube(QPainter *p, int who, int xo, int yo,
/*
* Adjust the font size
*/
- QFont f = board->getFont();
+ TQFont f = board->getFont();
f.setPointSizeFloat(0.75*f.pointSizeFloat());
p->setFont(f);
p->drawText(r, AlignCenter, cubeNum);
@@ -987,12 +987,12 @@ void KBgBoardCell::drawCube(QPainter *p, int who, int xo, int yo,
* is scaled with a default value of 1.0. The scale parameter determines the the
* size of the dice relative to the checker diameter.
*/
-QRect KBgBoardCell::diceRect(int i, bool big, double sf, double scale) const
+TQRect KBgBoardCell::diceRect(int i, bool big, double sf, double scale) const
{
int d = int(scale*getCheckerDiameter());
int l = (1+width())%2;
int k = (big ? 0 : 1);
- return(QRect(sf*(width()/2-d+k),
+ return(TQRect(sf*(width()/2-d+k),
sf*(height()/2-2*d-3+2*i*(d+3)-1+k),
sf*(2*(d-k)+1-l),
sf*(2*(d-k)+1-l)));
@@ -1003,9 +1003,9 @@ QRect KBgBoardCell::diceRect(int i, bool big, double sf, double scale) const
* is moved to the correct place and scaled correctly. The cube is slightly
* smaller than the dice.
*/
-QRect KBgBoardCell::cubeRect(int who, bool big, double sf) const
+TQRect KBgBoardCell::cubeRect(int who, bool big, double sf) const
{
- QRect r = diceRect(0, big, sf, 0.40);
+ TQRect r = diceRect(0, big, sf, 0.40);
int d = int(0.40*getCheckerDiameter());
int h = r.height();
@@ -1025,7 +1025,7 @@ QRect KBgBoardCell::cubeRect(int who, bool big, double sf) const
r.setTop( -d*sf - k);
break;
default:
- return(QRect(0,0,0,0));
+ return(TQRect(0,0,0,0));
}
r.setHeight(h);
return r;
@@ -1036,14 +1036,14 @@ QRect KBgBoardCell::cubeRect(int who, bool big, double sf) const
* If the painting of dice should be saved this is the place
* to modify.
*/
-void KBgBoardHome::drawDiceFace(QPainter *p, int col, int num, int who,
+void KBgBoardHome::drawDiceFace(TQPainter *p, int col, int num, int who,
int xo, int yo, double sf) const
{
p->setBrush(board->getCheckerColor(col));
p->setPen(board->getCheckerColor(col));
- QRect r = diceRect(num, false, sf);
- r.moveTopLeft(QPoint(xo+r.left(), yo+r.top()));
+ TQRect r = diceRect(num, false, sf);
+ r.moveTopLeft(TQPoint(xo+r.left(), yo+r.top()));
int cx = r.width() /2;
int cy = r.height()/2;
@@ -1087,13 +1087,13 @@ void KBgBoardHome::drawDiceFace(QPainter *p, int col, int num, int who,
* The square is suited to contain a a face value as printed
* by drawDiceFace(...).
*/
-void KBgBoardHome::drawDiceFrame(QPainter *p, int col, int num,
+void KBgBoardHome::drawDiceFrame(TQPainter *p, int col, int num,
int xo, int yo, bool big, double sf) const
{
p->setBrush(board->getCheckerColor(col));
p->setPen(board->getCheckerColor(col));
- QRect r = diceRect(num, big, sf);
- r.moveTopLeft(QPoint(xo+r.left(), yo+r.top()));
+ TQRect r = diceRect(num, big, sf);
+ r.moveTopLeft(TQPoint(xo+r.left(), yo+r.top()));
p->drawRoundRect(r, 20, 20);
}
@@ -1101,7 +1101,7 @@ void KBgBoardHome::drawDiceFrame(QPainter *p, int col, int num,
* If the event is left button we just store that. If the event is right
* button we ask the board to possibly display the popup menu.
*/
-void KBgBoardCell::mousePressEvent(QMouseEvent *e)
+void KBgBoardCell::mousePressEvent(TQMouseEvent *e)
{
if (e->button() == RightButton)
board->showContextMenu();
@@ -1140,7 +1140,7 @@ int KBgBoard::getShortMoveMode()
* tests are ok, the shortest possible move away from here is
* made.
*/
-void KBgBoardCell::checkAndMakeShortMove(QMouseEvent *e, int m)
+void KBgBoardCell::checkAndMakeShortMove(TQMouseEvent *e, int m)
{
if ((e->button() == LeftButton) &&
(board->getShortMoveMode() == m) &&
@@ -1152,7 +1152,7 @@ void KBgBoardCell::checkAndMakeShortMove(QMouseEvent *e, int m)
/*
* This functions reacts on a double click.
*/
-void KBgBoardCell::mouseDoubleClickEvent(QMouseEvent *e)
+void KBgBoardCell::mouseDoubleClickEvent(TQMouseEvent *e)
{
checkAndMakeShortMove(e, SHORT_MOVE_DOUBLE);
}
@@ -1162,9 +1162,9 @@ void KBgBoardCell::mouseDoubleClickEvent(QMouseEvent *e)
* about two different double clicks: double the cube and make a
* short move.
*/
-void KBgBoardBar::mouseDoubleClickEvent(QMouseEvent *e)
+void KBgBoardBar::mouseDoubleClickEvent(TQMouseEvent *e)
{
- QRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true);
+ TQRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true);
if (board->canDouble(US) &&
board->canDouble(THEM) && r.contains(e->pos())) {
if (board->getEditMode())
@@ -1189,7 +1189,7 @@ KBgBoard::~KBgBoard()
* This function draws dice and cube on the painter for a home cell.
* who may be either US or THEM.
*/
-void KBgBoardHome::drawDiceAndCube(QPainter *p, int who, int xo, int yo,
+void KBgBoardHome::drawDiceAndCube(TQPainter *p, int who, int xo, int yo,
double sf) const
{
int col = ((who == THEM) ? -color : color);
@@ -1316,7 +1316,7 @@ int KBgBoard::getPipCount(const int& w) const
* only if the the click happened within the boundaries of a
* dice or the cube.
*/
-void KBgBoardHome::mouseDoubleClickEvent(QMouseEvent * e)
+void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e)
{
if (e->button() != LeftButton)
return;
@@ -1331,7 +1331,7 @@ void KBgBoardHome::mouseDoubleClickEvent(QMouseEvent * e)
int w = ((cellID == HOME_US_LEFT || cellID == HOME_US_RIGHT) ?
US : THEM);
for (int i = 0; i < 2; ++i) {
- QRect r = diceRect(i, true);
+ TQRect r = diceRect(i, true);
if (r.contains(e->pos())) {
if (board->getEditMode()) {
@@ -1355,7 +1355,7 @@ void KBgBoardHome::mouseDoubleClickEvent(QMouseEvent * e)
}
if (board->canDouble(w) &&
!(board->canDouble(US) && board->canDouble(THEM))) {
- QRect r = cubeRect(w, true);
+ TQRect r = cubeRect(w, true);
if (r.contains(e->pos()))
if (board->getEditMode())
board->queryCube();
@@ -1432,7 +1432,7 @@ bool KBgBoard::moveOffPossible() const
* a pointer to the cell or NULL if there is no cell under the point.
*/
-KBgBoardCell* KBgBoard::getCellByPos(const QPoint& p) const
+KBgBoardCell* KBgBoard::getCellByPos(const TQPoint& p) const
{
for (int i = 0; i < 30; ++i) {
if (cells[i]->rect().contains(cells[i]->mapFromParent(p)))
@@ -1512,11 +1512,11 @@ bool KBgBoardCell::getPiece()
* This function stores the current cursor and replaces it with the
* supplied one c.
*/
-void KBgBoard::replaceCursor(const QCursor& c)
+void KBgBoard::replaceCursor(const TQCursor& c)
{
if (savedCursor)
delete savedCursor;
- savedCursor = new QCursor(cursor());
+ savedCursor = new TQCursor(cursor());
setCursor(c);
}
@@ -1558,7 +1558,7 @@ void KBgBoardCell::putPiece(int newColor)
* the cell where the first mousePressEvent occurred receives the release event.
* The release event marks the end of a drag or a single click short move.
*/
-void KBgBoardCell::mouseReleaseEvent(QMouseEvent *e)
+void KBgBoardCell::mouseReleaseEvent(TQMouseEvent *e)
{
if (dragInProgress) {
@@ -1608,12 +1608,12 @@ KBgBoardField::~KBgBoardField()
/*
* This is the constructor of the bars. It calls the base class' constructor
- * and defines the QWhatsThis string.
+ * and defines the TQWhatsThis string.
*/
-KBgBoardBar::KBgBoardBar(QWidget * parent, int numID)
+KBgBoardBar::KBgBoardBar(TQWidget * parent, int numID)
: KBgBoardCell(parent, numID)
{
- QWhatsThis::add(this, i18n("This is the bar of the backgammon board.\n\n"
+ TQWhatsThis::add(this, i18n("This is the bar of the backgammon board.\n\n"
"Checkers that have been kicked from the board are put "
"on the bar and remain there until they can be put back "
"on the board. Checkers can be moved by dragging them to "
@@ -1625,12 +1625,12 @@ KBgBoardBar::KBgBoardBar(QWidget * parent, int numID)
/*
* This is the constructor of regular fields. It calls the base class' constructor
- * and defines the QWhatsThis string.
+ * and defines the TQWhatsThis string.
*/
-KBgBoardField::KBgBoardField(QWidget * parent, int numID)
+KBgBoardField::KBgBoardField(TQWidget * parent, int numID)
: KBgBoardCell(parent, numID)
{
- QWhatsThis::add(this, i18n("This is a regular field of the backgammon board.\n\n"
+ TQWhatsThis::add(this, i18n("This is a regular field of the backgammon board.\n\n"
"Checkers can be placed on this field and if the current state "
"of the game and the dice permit this, they can be moved by "
"dragging them to their destination or by using the 'short "
@@ -1639,12 +1639,12 @@ KBgBoardField::KBgBoardField(QWidget * parent, int numID)
/*
* This is the constructor of the homes. It calls the base class' constructor
- * and defines the QWhatsThis string.
+ * and defines the TQWhatsThis string.
*/
-KBgBoardHome::KBgBoardHome(QWidget * parent, int numID)
+KBgBoardHome::KBgBoardHome(TQWidget * parent, int numID)
: KBgBoardCell(parent, numID)
{
- QWhatsThis::add(this, i18n("This part of the backgammon board is the home.\n\n"
+ TQWhatsThis::add(this, i18n("This part of the backgammon board is the home.\n\n"
"Depending on the direction of the game, one of the homes "
"contains the dice and the other one contains checkers that "
"have been moved off the board. Checkers can never be moved "
@@ -1734,8 +1734,8 @@ int KBgBoard::getTurn() const
* This is the constructor of the basic cells. It initializes the cell
* to a sane state and connects a signal to the board.
*/
-KBgBoardCell::KBgBoardCell(QWidget * parent, int numID)
- : QLabel(parent)
+KBgBoardCell::KBgBoardCell(TQWidget * parent, int numID)
+ : TQLabel(parent)
{
board = (KBgBoard *)parent;
@@ -1749,7 +1749,7 @@ KBgBoardCell::KBgBoardCell(QWidget * parent, int numID)
mouseButton = NoButton;
dragInProgress = false;
- connect(parent, SIGNAL(finishedUpdate()), this, SLOT(refresh()));
+ connect(parent, TQT_SIGNAL(finishedUpdate()), this, TQT_SLOT(refresh()));
}
/*
@@ -1858,7 +1858,7 @@ void KBgBoard::updateField(int f, int v)
*/
void KBgBoard::showContextMenu()
{
- if (contextMenu) contextMenu->popup(QCursor::pos());
+ if (contextMenu) contextMenu->popup(TQCursor::pos());
}
/*
@@ -2149,23 +2149,23 @@ void KBgBoard::setState(const KBgStatus &st)
* This function starts a drag from this cell if possible. It asks the board to
* change the mouse pointer and takes a checker away from this cell.
*/
-void KBgBoardCell::mouseMoveEvent(QMouseEvent *)
+void KBgBoardCell::mouseMoveEvent(TQMouseEvent *)
{
if ((mouseButton == LeftButton) && dragPossible()) {
dragInProgress = true;
- QRect cr(0, 0, 1+getCheckerDiameter(), 1+getCheckerDiameter());
+ TQRect cr(0, 0, 1+getCheckerDiameter(), 1+getCheckerDiameter());
cr.moveBottomLeft(rect().bottomLeft());
- QPixmap pix(cr.size());
- QPainter tmp;
+ TQPixmap pix(cr.size());
+ TQPainter tmp;
pix.fill(this, cr.topLeft());
tmp.begin(&pix);
board->drawSimpleChecker(&tmp, 0, 0, pcs, getCheckerDiameter());
tmp.end();
pix.setMask(pix.createHeuristicMask());
- QBitmap mask = *(pix.mask());
- QBitmap newCursor;
+ TQBitmap mask = *(pix.mask());
+ TQBitmap newCursor;
newCursor = pix;
- board->replaceCursor(QCursor(newCursor, mask));
+ board->replaceCursor(TQCursor(newCursor, mask));
if (board->getEditMode())
board->storeTurn(pcs);
getPiece();
@@ -2179,7 +2179,7 @@ void KBgBoardCell::mouseMoveEvent(QMouseEvent *)
* maximum diameter of diam. This checker has only two colors and
* as such it is suited for the mouse cursor and printing.
*/
-void KBgBoard::drawSimpleChecker(QPainter *p, int x, int y, int pcs,
+void KBgBoard::drawSimpleChecker(TQPainter *p, int x, int y, int pcs,
int diam) const
{
p->setBrush(getCheckerColor(pcs));
@@ -2202,7 +2202,7 @@ void KBgBoard::drawSimpleChecker(QPainter *p, int x, int y, int pcs,
* on a field respectively. upper indicates whether the checker is
* in the upper half of the board or not.
*/
-void KBgBoard::drawChecker(QPainter *p, int x, int y, int pcs, int diam,
+void KBgBoard::drawChecker(TQPainter *p, int x, int y, int pcs, int diam,
int col, bool upper) const
{
drawCircle(p, x, y, pcs, diam , col, upper, true );
@@ -2215,7 +2215,7 @@ void KBgBoard::drawChecker(QPainter *p, int x, int y, int pcs, int diam,
* up to fifteen checkers fit on the cell. This is used by homes and
* bars.
*/
-void KBgBoardCell::drawOverlappingCheckers(QPainter *p, int xo, int yo,
+void KBgBoardCell::drawOverlappingCheckers(TQPainter *p, int xo, int yo,
double sf) const
{
int d = getCheckerDiameter();
@@ -2240,9 +2240,9 @@ void KBgBoardCell::drawOverlappingCheckers(QPainter *p, int xo, int yo,
* checkers in such a way that always five are in one level and the next
* level is slightly shifted.
*/
-void KBgBoardField::paintCell(QPainter *p, int xo, int yo, double sf) const
+void KBgBoardField::paintCell(TQPainter *p, int xo, int yo, double sf) const
{
- QColor color, alphaColor, background = backgroundColor();
+ TQColor color, alphaColor, background = backgroundColor();
bool printing = abs(xo)+abs(yo) > 0;
if (printing) {
@@ -2251,7 +2251,7 @@ void KBgBoardField::paintCell(QPainter *p, int xo, int yo, double sf) const
* paper. This justs draws a triangle and surrounds
* it by a black triangle. Easy but works.
*/
- QPointArray pa(3);
+ TQPointArray pa(3);
color = (getNumber()%2 ? white : black);
@@ -2362,11 +2362,11 @@ void KBgBoardField::paintCell(QPainter *p, int xo, int yo, double sf) const
p->setBrush(color);
p->setPen(color);
- QString t;
+ TQString t;
t.setNum(getNumber());
p->setFont(board->getFont());
- int textHeight = QFontMetrics(p->font()).height();
+ int textHeight = TQFontMetrics(p->font()).height();
p->drawText(xo, yo+((cellID < 13) ? 5 : height()-5-textHeight),
width()*sf, textHeight, AlignCenter, t);
@@ -2408,12 +2408,12 @@ void KBgBoardField::paintCell(QPainter *p, int xo, int yo, double sf) const
* about the triangles on the cells. This is long but it is just a big if
* construct.
*/
-void KBgBoard::drawCircle(QPainter *p, int x, int y, int pcs, int diam,
+void KBgBoard::drawCircle(TQPainter *p, int x, int y, int pcs, int diam,
int col, bool upper, bool outer) const
{
- QColor fColor = getCheckerColor(pcs);
- QColor alphaColor;
- QColor bColor;
+ TQColor fColor = getCheckerColor(pcs);
+ TQColor alphaColor;
+ TQColor bColor;
int red, green, blue;
int rad = diam/2;
@@ -2823,8 +2823,8 @@ void KBgBoard::getRollDice(const int w)
* You have to change the status by passing a KBgStatus
* object to setState(...) before you can play!
*/
-KBgBoard::KBgBoard(QWidget *parent, const char *name, QPopupMenu *menu)
- : QWidget(parent, name)
+KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu)
+ : TQWidget(parent, name)
{
/*
* The following lines set up internal bookkeeping data.
@@ -2898,21 +2898,21 @@ KBgBoard::KBgBoard(QWidget *parent, const char *name, QPopupMenu *menu)
* overwritten by the user.
*/
shortMoveMode = SHORT_MOVE_DOUBLE;
- setBackgroundColor(QColor(200, 200, 166));
+ setBackgroundColor(TQColor(200, 200, 166));
computePipCount = true;
/*
* Set initial font
*/
- setFont(QApplication::font());
+ setFont(TQApplication::font());
}
-QSize KBgBoard::minimumSizeHint() const
+TQSize KBgBoard::minimumSizeHint() const
{
- return QSize(MINIMUM_CHECKER_SIZE * 15, MINIMUM_CHECKER_SIZE * 11);
+ return TQSize(MINIMUM_CHECKER_SIZE * 15, MINIMUM_CHECKER_SIZE * 11);
}
-QSize KBgBoard::sizeHint() const {
- return QSize(MINIMUM_CHECKER_SIZE *15*4,MINIMUM_CHECKER_SIZE*11*2);
+TQSize KBgBoard::sizeHint() const {
+ return TQSize(MINIMUM_CHECKER_SIZE *15*4,MINIMUM_CHECKER_SIZE*11*2);
}
diff --git a/kbackgammon/kbgboard.h b/kbackgammon/kbgboard.h
index e2f35f68..54ad506c 100644
--- a/kbackgammon/kbgboard.h
+++ b/kbackgammon/kbgboard.h
@@ -39,23 +39,23 @@
#include <config.h>
#endif
-#include <qspinbox.h>
-#include <qpushbutton.h>
-#include <qcheckbox.h>
-#include <qdialog.h>
-#include <qstring.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qregexp.h>
-#include <qradiobutton.h>
-#include <qwidget.h>
-#include <qptrlist.h>
-#include <qtimer.h>
-#include <qlabel.h>
-#include <qcursor.h>
-#include <qpopupmenu.h>
-#include <qcombobox.h>
+#include <tqspinbox.h>
+#include <tqpushbutton.h>
+#include <tqcheckbox.h>
+#include <tqdialog.h>
+#include <tqstring.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqbitmap.h>
+#include <tqregexp.h>
+#include <tqradiobutton.h>
+#include <tqwidget.h>
+#include <tqptrlist.h>
+#include <tqtimer.h>
+#include <tqlabel.h>
+#include <tqcursor.h>
+#include <tqpopupmenu.h>
+#include <tqcombobox.h>
#include <kdialogbase.h>
#include <kfontdialog.h>
@@ -109,8 +109,8 @@ class KBgBoard : public QWidget
/**
* Constructor and destructor. Parameter as usual.
*/
- KBgBoard(QWidget *parent = 0, const char *name = 0,
- QPopupMenu *menu = 0);
+ KBgBoard(TQWidget *parent = 0, const char *name = 0,
+ TQPopupMenu *menu = 0);
virtual ~KBgBoard();
/**
@@ -141,14 +141,14 @@ class KBgBoard : public QWidget
* Sets the background color and passes the info to the
* child widgets
*/
- virtual void setBackgroundColor(const QColor &col);
+ virtual void setBackgroundColor(const TQColor &col);
/**
* Prints the baord along with some basic info onto the
* painetr p. It is assumed that this painter is a postscript
* printer. Hence the plot is black/white only.
*/
- void print(QPainter *p);
+ void print(TQPainter *p);
/**
* Get whose turn it is - US, THEM or 0
@@ -174,13 +174,13 @@ class KBgBoard : public QWidget
* Get the font the board cells should use for the display of
* numbers and cube value.
*/
- QFont getFont() const;
+ TQFont getFont() const;
/**
* This function has to be reimplemented to provide a minimum size for
* the playing area.
*/
- QSize minimumSizeHint() const;
+ TQSize minimumSizeHint() const;
public slots:
/**
@@ -196,7 +196,7 @@ public slots:
* We overwrite the handler to make sure that all the cells are
* repainted as well.
*/
- virtual void resizeEvent(QResizeEvent *);
+ virtual void resizeEvent(TQResizeEvent *);
/**
* Undo the last move.
@@ -218,7 +218,7 @@ public slots:
/**
* Set the context menu
*/
- void setContextMenu(QPopupMenu *menu);
+ void setContextMenu(TQPopupMenu *menu);
/**
* Get the current state of the board.
@@ -235,7 +235,7 @@ public slots:
* Allows the users of the board classe to set the font to be used
* on the board. Note that the fontsize is dynamically set
*/
- void setFont(const QFont& f);
+ void setFont(const TQFont& f);
/**
* Write the current configuration to the application's data base
@@ -253,7 +253,7 @@ public slots:
* 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);
/**
* The cells connect to this signal and it tells them that it is
@@ -276,7 +276,7 @@ public slots:
* Once the moves are all made, build a server command and send
* them out.
*/
- void currentMove(QString *s);
+ void currentMove(TQString *s);
/* ************************************************** */
/* ************************************************** */
@@ -291,10 +291,10 @@ public slots:
/* ************************************************** */
protected:
- virtual QSize sizeHint() const;
+ virtual TQSize sizeHint() const;
- QColor baseColors[2];
- QFont boardFont;
+ TQColor baseColors[2];
+ TQFont boardFont;
KBgBoardCell* cells[30];
bool computePipCount;
@@ -382,26 +382,26 @@ protected:
* Draws a piece on the painter p, with the upper left corner
* of the enclosing rectangle being (x,y)
*/
- void drawCircle(QPainter *p, int x, int y, int pcs, int diam,
+ void drawCircle(TQPainter *p, int x, int y, int pcs, int diam,
int col, bool upper, bool outer) const;
/**
* Draws an anti-aliased checker on the painter p.
*/
- void drawChecker(QPainter *p, int x, int y, int pcs, int diam,
+ void drawChecker(TQPainter *p, int x, int y, int pcs, int diam,
int col, bool upper) const;
/**
* Draws a simple 2-color checker on the painter p. This is intended
* for printing.
*/
- void drawSimpleChecker(QPainter *p, int x, int y, int pcs,
+ void drawSimpleChecker(TQPainter *p, int x, int y, int pcs,
int diam) const;
/**
* Given a position on the board, return the cell under the mouse pointer
*/
- KBgBoardCell* getCellByPos(const QPoint& p) const;
+ KBgBoardCell* getCellByPos(const TQPoint& p) const;
/**
* Name says it all, doesn't it?
@@ -411,7 +411,7 @@ protected:
/**
* Temporary replace the cursor, saves the old one
*/
- void replaceCursor(const QCursor& c);
+ void replaceCursor(const TQCursor& c);
/**
* Restore the previously stored cursor.
@@ -421,7 +421,7 @@ protected:
/**
* Given the sign of p, return the current base color
*/
- QColor getCheckerColor(int p) const;
+ TQColor getCheckerColor(int p) const;
/**
* Small utility function for makeMove - just for readability
@@ -431,9 +431,9 @@ protected:
/**
* Private data members - no description needed
*/
- QPopupMenu *contextMenu;
- QPtrList<KBgBoardMove> moveHistory;
- QPtrList<KBgBoardMove> redoHistory;
+ TQPopupMenu *contextMenu;
+ TQPtrList<KBgBoardMove> moveHistory;
+ TQPtrList<KBgBoardMove> redoHistory;
int direction, color;
int hasmoved;
bool allowmoving, editMode;
@@ -448,7 +448,7 @@ protected:
bool cubechanged;
bool maydouble[2];
int shortMoveMode;
- QCursor *savedCursor;
+ TQCursor *savedCursor;
};
/**
@@ -467,7 +467,7 @@ class KBgBoardCell : public QLabel
/**
* Constructor and destructor
*/
- KBgBoardCell(QWidget * parent, int numID);
+ KBgBoardCell(TQWidget * parent, int numID);
virtual ~KBgBoardCell();
/**
@@ -479,7 +479,7 @@ class KBgBoardCell : public QLabel
/**
* Draws the content of the cell on the painter *p
*/
- virtual void paintCell(QPainter *p, int xo = 0, int yo = 0,
+ virtual void paintCell(TQPainter *p, int xo = 0, int yo = 0,
double sf = 1.0) const;
/**
@@ -492,10 +492,10 @@ protected:
/**
* Draw vertical lines around the board.
*/
- void drawVertBorder(QPainter *p, int xo, int yo, double sf = 1.0) const;
- void drawOverlappingCheckers(QPainter *p, int xo, int yo,
+ void drawVertBorder(TQPainter *p, int xo, int yo, double sf = 1.0) const;
+ void drawOverlappingCheckers(TQPainter *p, int xo, int yo,
double sf = 1.0) const;
- void drawCube(QPainter *p, int who, int xo, int yo, double sf = 1.0) const;
+ void drawCube(TQPainter *p, int who, int xo, int yo, double sf = 1.0) const;
/**
* Puts a piece of color on a field
@@ -530,7 +530,7 @@ protected:
/**
* Overwrite how a cell draws itself
*/
- virtual void drawContents(QPainter *);
+ virtual void drawContents(TQPainter *);
/**
* Status numbers that store the current board status.
@@ -561,17 +561,17 @@ protected:
* sense without the other). So the pieces know and access their parent.
*/
KBgBoard *board;
- void checkAndMakeShortMove(QMouseEvent *e, int m);
+ void checkAndMakeShortMove(TQMouseEvent *e, int m);
/**
* Returns the bounding rectangle of the cube on this cell
*/
- QRect cubeRect( int who, bool big, double sf = 1.0 ) const;
+ TQRect cubeRect( int who, bool big, double sf = 1.0 ) const;
/**
* Returns the bounding rectangle of the dice i on this cell
*/
- QRect diceRect(int i, bool big, double sf = 1.0, double scale = 0.45) const;
+ TQRect diceRect(int i, bool big, double sf = 1.0, double scale = 0.45) const;
bool dragInProgress;
protected slots:
@@ -588,8 +588,8 @@ protected:
/**
* Possibly initiate a drag.
*/
- virtual void mouseMoveEvent( QMouseEvent * );
- virtual void mousePressEvent(QMouseEvent *e);
+ virtual void mouseMoveEvent( TQMouseEvent * );
+ virtual void mousePressEvent(TQMouseEvent *e);
/**
* Make the shortes possible move away from this cell
@@ -600,12 +600,12 @@ protected:
/**
* Catch a single left click and perhapes make a move.
*/
- virtual void mouseReleaseEvent( QMouseEvent *e );
+ virtual void mouseReleaseEvent( TQMouseEvent *e );
/**
* Catch a double left click and perhapes make a move.
*/
- virtual void mouseDoubleClickEvent( QMouseEvent *e );
+ virtual void mouseDoubleClickEvent( TQMouseEvent *e );
};
/**
@@ -626,13 +626,13 @@ class KBgBoardHome : public KBgBoardCell
/*
* Draws the content of the cell on the painter *p
*/
- virtual void paintCell(QPainter *p, int xo = 0, int yo = 0,
+ virtual void paintCell(TQPainter *p, int xo = 0, int yo = 0,
double sf = 1.0) const;
/**
* Constructor and destructor
*/
- KBgBoardHome( QWidget * parent, int numID);
+ KBgBoardHome( TQWidget * parent, int numID);
virtual ~KBgBoardHome();
/**
@@ -649,17 +649,17 @@ class KBgBoardHome : public KBgBoardCell
/**
* Get the double clicks
*/
- virtual void mouseDoubleClickEvent( QMouseEvent *e );
+ virtual void mouseDoubleClickEvent( TQMouseEvent *e );
/**
* The homes contain dice and cube. This draws them.
*/
- void drawDiceAndCube(QPainter *p, int who, int xo, int yo,
+ void drawDiceAndCube(TQPainter *p, int who, int xo, int yo,
double sf) const;
- void drawDiceFrame(QPainter *p, int col, int num, int xo, int yo,
+ void drawDiceFrame(TQPainter *p, int col, int num, int xo, int yo,
bool big, double sf) const;
- void drawDiceFace(QPainter *p, int col, int num, int who, int xo,
+ void drawDiceFace(TQPainter *p, int col, int num, int who, int xo,
int yo, double sf) const;
private:
@@ -688,13 +688,13 @@ class KBgBoardBar : public KBgBoardCell
/**
* Draws the content of the cell on the painter *p
*/
- virtual void paintCell(QPainter *p, int xo = 0, int yo = 0,
+ virtual void paintCell(TQPainter *p, int xo = 0, int yo = 0,
double sf = 1.0) const;
/**
* Constructor
*/
- KBgBoardBar( QWidget * parent, int numID );
+ KBgBoardBar( TQWidget * parent, int numID );
/**
* Destructor
@@ -714,7 +714,7 @@ class KBgBoardBar : public KBgBoardCell
/**
* Get the double clicks
*/
- virtual void mouseDoubleClickEvent(QMouseEvent *e);
+ virtual void mouseDoubleClickEvent(TQMouseEvent *e);
};
/**
@@ -729,7 +729,7 @@ class KBgBoardField : public KBgBoardCell
/**
* Constructor and destructor
*/
- KBgBoardField( QWidget * parent, int numID);
+ KBgBoardField( TQWidget * parent, int numID);
virtual ~KBgBoardField();
/**
@@ -741,7 +741,7 @@ class KBgBoardField : public KBgBoardCell
/**
* Draws the content of the cell on the painter *p
*/
- virtual void paintCell(QPainter *p, int xo = 0, int yo = 0,
+ virtual void paintCell(TQPainter *p, int xo = 0, int yo = 0,
double sf = 1.0) const;
/**
@@ -833,9 +833,9 @@ protected:
/**
* Spin boxes and buttons are children
*/
- QSpinBox *sb[2];
- QPushButton *ok;
- QPushButton *cancel;
+ TQSpinBox *sb[2];
+ TQPushButton *ok;
+ TQPushButton *cancel;
public slots:
@@ -866,9 +866,9 @@ protected:
/**
* Spin boxes and buttons are children
*/
- QComboBox *cb[2];
- QPushButton *ok;
- QPushButton *cancel;
+ TQComboBox *cb[2];
+ TQPushButton *ok;
+ TQPushButton *cancel;
public slots:
@@ -892,7 +892,7 @@ protected slots:
/**
* Extension of the KBgBoard class that can add itself
- * to a QTabDialog for configuration.
+ * to a TQTabDialog for configuration.
*/
class KBgBoardSetup : public KBgBoard
{
@@ -903,8 +903,8 @@ public:
/**
* Constructor
*/
- KBgBoardSetup(QWidget *parent = 0, const char *name = 0,
- QPopupMenu *menu = 0);
+ KBgBoardSetup(TQWidget *parent = 0, const char *name = 0,
+ TQPopupMenu *menu = 0);
/**
* Lets the board put its setup pages into the notebook nb
@@ -952,16 +952,16 @@ private:
*/
KFontChooser *kf;
- QRadioButton *rbMove[3];
+ TQRadioButton *rbMove[3];
- QColor saveBackgroundColor;
- QColor saveBaseColors[2];
+ TQColor saveBackgroundColor;
+ TQColor saveBaseColors[2];
/**
* Need these to change their colors
*/
- QPushButton *pbc_1, *pbc_2, *pbc_3;
- QCheckBox *cbp;
+ TQPushButton *pbc_1, *pbc_2, *pbc_3;
+ TQCheckBox *cbp;
};
#endif // KBGBOARD_H
diff --git a/kbackgammon/kbgstatus.cpp b/kbackgammon/kbgstatus.cpp
index 1215324e..4f5db3c0 100644
--- a/kbackgammon/kbgstatus.cpp
+++ b/kbackgammon/kbgstatus.cpp
@@ -29,7 +29,7 @@
/*
* Parse a rawboard description from FIBS and initialize members.
*/
-KBgStatus::KBgStatus(const QString &rawboard)
+KBgStatus::KBgStatus(const TQString &rawboard)
{
/*
* This is the format string from hell...
@@ -45,7 +45,7 @@ KBgStatus::KBgStatus(const QString &rawboard)
char opponent[100], player[100];
- QString cap;
+ TQString cap;
int board[26], ldice[2][2], maydouble[2], scratch[4], onhome[2], onbar[2];
int points[2];
@@ -117,7 +117,7 @@ KBgStatus::KBgStatus(const QString &rawboard)
* and empty dice.
*/
KBgStatus::KBgStatus()
- : QObject()
+ : TQObject()
{
/*
* Initialize members
@@ -131,7 +131,7 @@ KBgStatus::KBgStatus()
setHome (i, 0);
setBar (i, 0);
setPoints(i, -1);
- setPlayer(i, QString::null);
+ setPlayer(i, TQString::null);
}
setColor(White, US);
setCube(1, BOTH); // also initializes maydouble
@@ -147,7 +147,7 @@ KBgStatus::KBgStatus()
* Copy constructor calls private utility function.
*/
KBgStatus::KBgStatus(const KBgStatus &rhs)
- : QObject()
+ : TQObject()
{
copy(rhs);
}
@@ -244,9 +244,9 @@ int KBgStatus::points(const int& w) const
return ((w == US || w == THEM) ? points_[w] : -1);
}
-QString KBgStatus::player(const int &w) const
+TQString KBgStatus::player(const int &w) const
{
- return ((w == US || w == THEM) ? player_[w] : QString::null);
+ return ((w == US || w == THEM) ? player_[w] : TQString::null);
}
int KBgStatus::length() const
@@ -343,7 +343,7 @@ void KBgStatus::setPoints(const int &w, const int &p)
points_[w] = p;
}
-void KBgStatus::setPlayer(const int &w, const QString &name)
+void KBgStatus::setPlayer(const int &w, const TQString &name)
{
if (w == US || w == THEM)
player_[w] = name;
diff --git a/kbackgammon/kbgstatus.h b/kbackgammon/kbgstatus.h
index 5543e1ca..afcc2f6a 100644
--- a/kbackgammon/kbgstatus.h
+++ b/kbackgammon/kbgstatus.h
@@ -27,7 +27,7 @@
#include <config.h>
#endif
-#include <qobject.h>
+#include <tqobject.h>
/**
@@ -70,7 +70,7 @@ class KBgStatus : public QObject
/**
* Constructor from a FIBS rawboard string
*/
- KBgStatus(const QString &rawboard);
+ KBgStatus(const TQString &rawboard);
/**
* Copy constructor
@@ -156,10 +156,10 @@ class KBgStatus : public QObject
/*
* Return the name of player w. If w is out of bounds or if
- * the player names have not been set, QString::null is
+ * the player names have not been set, TQString::null is
* returned.
*/
- QString player(const int &w = US) const;
+ TQString player(const int &w = US) const;
/*
* Return the length of the game. Negative values should be used to
@@ -260,7 +260,7 @@ class KBgStatus : public QObject
* Set the name of player w to name. If w is out of bound,
* nothing is done.
*/
- void setPlayer(const int &w, const QString &name);
+ void setPlayer(const int &w, const TQString &name);
/*
* Set the length of the game. Negative values should be used to
@@ -298,7 +298,7 @@ class KBgStatus : public QObject
/*
* Private variables with self-expalanatory names.
*/
- QString player_[2];
+ TQString player_[2];
int board_[26], home_[2], bar_[2], dice_[2][2], points_[2];
int color_, direction_, cube_, length_, turn_;
diff --git a/kbackgammon/kbgtextview.cpp b/kbackgammon/kbgtextview.cpp
index b99a2f27..a2199b05 100644
--- a/kbackgammon/kbgtextview.cpp
+++ b/kbackgammon/kbgtextview.cpp
@@ -26,7 +26,7 @@
#include <kconfig.h>
#include <kcmenumngr.h>
#include <kfontdialog.h>
-#include <qfont.h>
+#include <tqfont.h>
#include <kapplication.h>
#include <iostream>
@@ -36,7 +36,7 @@
/*
* Constructor
*/
-KBgTextView::KBgTextView(QWidget *parent, const char *name)
+KBgTextView::KBgTextView(TQWidget *parent, const char *name)
: KTextBrowser(parent, name)
{
clear();
@@ -55,7 +55,7 @@ KBgTextView::~KBgTextView()
* Write the string l to the TextView and put the cursor at the end of
* the current text
*/
-void KBgTextView::write(const QString &l)
+void KBgTextView::write(const TQString &l)
{
append("<font face=\"" + font().family() + "\">" + l + "</font><br>\n");
scrollToBottom();
@@ -74,7 +74,7 @@ void KBgTextView::clear()
*/
void KBgTextView::selectFont()
{
- QFont f = font();
+ TQFont f = font();
KFontDialog::getFont(f, false, this, true);
setFont(f);
}
diff --git a/kbackgammon/kbgtextview.h b/kbackgammon/kbgtextview.h
index 887136f4..8b8b8389 100644
--- a/kbackgammon/kbgtextview.h
+++ b/kbackgammon/kbgtextview.h
@@ -27,11 +27,11 @@
#endif
#include <ktextbrowser.h>
-#include <qstring.h>
+#include <tqstring.h>
/**
- * A small extension to the QTextView control.
+ * A small extension to the TQTextView control.
*/
class KBgTextView : public KTextBrowser
{
@@ -42,7 +42,7 @@ public:
/**
* Constructor
*/
- KBgTextView(QWidget *parent = 0, const char *name = 0);
+ KBgTextView(TQWidget *parent = 0, const char *name = 0);
/**
* Destructor
@@ -75,7 +75,7 @@ public slots:
* Write the string at the end of the buffer and scroll to
* the end
*/
- void write(const QString &);
+ void write(const TQString &);
};
#endif // __KBGTEXTVIEW_H
diff --git a/kbackgammon/main.cpp b/kbackgammon/main.cpp
index fe20cc7c..5c942f70 100644
--- a/kbackgammon/main.cpp
+++ b/kbackgammon/main.cpp
@@ -20,7 +20,7 @@
*/
#include <kapplication.h>
-#include <qstring.h>
+#include <tqstring.h>
#include <klocale.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>