summaryrefslogtreecommitdiffstats
path: root/libksirtet/lib
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 /libksirtet/lib
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 'libksirtet/lib')
-rw-r--r--libksirtet/lib/defines.cpp8
-rw-r--r--libksirtet/lib/defines.h6
-rw-r--r--libksirtet/lib/internal.cpp32
-rw-r--r--libksirtet/lib/internal.h38
-rw-r--r--libksirtet/lib/keys.cpp22
-rw-r--r--libksirtet/lib/keys.h22
-rw-r--r--libksirtet/lib/meeting.cpp60
-rw-r--r--libksirtet/lib/meeting.h40
-rw-r--r--libksirtet/lib/miscui.cpp22
-rw-r--r--libksirtet/lib/miscui.h10
-rw-r--r--libksirtet/lib/mp_board.h12
-rw-r--r--libksirtet/lib/mp_interface.cpp54
-rw-r--r--libksirtet/lib/mp_interface.h36
-rw-r--r--libksirtet/lib/mp_option.h10
-rw-r--r--libksirtet/lib/mp_simple_board.cpp10
-rw-r--r--libksirtet/lib/mp_simple_board.h24
-rw-r--r--libksirtet/lib/mp_simple_interface.cpp10
-rw-r--r--libksirtet/lib/mp_simple_interface.h8
-rw-r--r--libksirtet/lib/mp_simple_types.cpp4
-rw-r--r--libksirtet/lib/mp_simple_types.h6
-rw-r--r--libksirtet/lib/pline.cpp54
-rw-r--r--libksirtet/lib/pline.h52
-rw-r--r--libksirtet/lib/smanager.h2
-rw-r--r--libksirtet/lib/socket.cpp6
-rw-r--r--libksirtet/lib/socket.h12
-rw-r--r--libksirtet/lib/types.cpp58
-rw-r--r--libksirtet/lib/types.h82
-rw-r--r--libksirtet/lib/wizard.cpp84
-rw-r--r--libksirtet/lib/wizard.h26
29 files changed, 405 insertions, 405 deletions
diff --git a/libksirtet/lib/defines.cpp b/libksirtet/lib/defines.cpp
index 7c897dd9..baf91083 100644
--- a/libksirtet/lib/defines.cpp
+++ b/libksirtet/lib/defines.cpp
@@ -2,21 +2,21 @@
#include <klocale.h>
-void errorBox(const QString &msg1, const QString &msg2, QWidget *parent)
+void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent)
{
- QString str;
+ TQString str;
if ( msg2.isNull() ) str = msg1;
else str = i18n("%1:\n%2").arg(msg1).arg(msg2);
KMessageBox::error(parent, str);
}
-QString socketError(const KExtendedSocket *socket)
+TQString socketError(const KExtendedSocket *socket)
{
return KExtendedSocket::strError(socket->status(), socket->systemError());
}
bool checkSocket(int res, const KExtendedSocket *socket,
- const QString &msg, QWidget *parent)
+ const TQString &msg, TQWidget *parent)
{
if ( res==0 ) return false;
errorBox(msg, socketError(socket), parent);
diff --git a/libksirtet/lib/defines.h b/libksirtet/lib/defines.h
index 9015c6b1..a6728a38 100644
--- a/libksirtet/lib/defines.h
+++ b/libksirtet/lib/defines.h
@@ -16,10 +16,10 @@
#define MP_SERVER_ADDRESS "Server address"
#define MP_PORT "Port"
-void errorBox(const QString &msg1, const QString &msg2, QWidget *parent);
-QString socketError(const KExtendedSocket *socket);
+void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent);
+TQString socketError(const KExtendedSocket *socket);
bool checkSocket(int res, const KExtendedSocket *,
- const QString &msg, QWidget *parent);
+ const TQString &msg, TQWidget *parent);
#define R_ERROR_BOX(msg1, msg2) { \
errorBox(msg1, msg2, this); \
diff --git a/libksirtet/lib/internal.cpp b/libksirtet/lib/internal.cpp
index c7b69f9e..f8b34085 100644
--- a/libksirtet/lib/internal.cpp
+++ b/libksirtet/lib/internal.cpp
@@ -1,7 +1,7 @@
#include "internal.h"
#include "internal.moc"
-#include <qptrlist.h>
+#include <tqptrlist.h>
#include <klocale.h>
#include "mp_interface.h"
@@ -67,17 +67,17 @@ void Server::serverTimeout()
//-----------------------------------------------------------------------------
Network::Network(MPInterface *_interface,
- QValueList<MPInterface::Data> &_boards,
- const QPtrList<RemoteHostData> &rhd)
+ TQValueList<MPInterface::Data> &_boards,
+ const TQPtrList<RemoteHostData> &rhd)
: Local(_interface, _boards)
{
RemoteData rd;
- QPtrListIterator<RemoteHostData> it(rhd);
+ TQPtrListIterator<RemoteHostData> it(rhd);
for (; it.current(); ++it) {
rd.socket = it.current()->socket;
rd.socket->notifier()->setEnabled(TRUE);
- connect(rd.socket->notifier(), SIGNAL(activated(int)),
- SLOT(notifier(int)));
+ connect(rd.socket->notifier(), TQT_SIGNAL(activated(int)),
+ TQT_SLOT(notifier(int)));
uint nb = it.current()->bds.count();
Q_ASSERT( nb>=1 );
rd.array = new BufferArray(nb);
@@ -102,7 +102,7 @@ uint Network::nbPlayers() const
return nb;
}
-QString Network::playerName(uint i) const
+TQString Network::playerName(uint i) const
{
uint l = Local::nbPlayers();
if ( i<l ) return Local::playerName(i);
@@ -111,7 +111,7 @@ QString Network::playerName(uint i) const
if ( i<(l+ll) ) return remotes[k].names[i-l];
l += ll;
}
- return QString::null; // dummy
+ return TQString::null; // dummy
}
IOBuffer *Network::ioBuffer(uint i) const
@@ -141,7 +141,7 @@ void Network::brokeError(uint i)
disconnectHost(i, i18n("Link broken"));
}
-void Network::disconnectHost(uint i, const QString &msg)
+void Network::disconnectHost(uint i, const TQString &msg)
{
delete remotes[i].socket;
delete remotes[i].array;
@@ -151,24 +151,24 @@ void Network::disconnectHost(uint i, const QString &msg)
//-----------------------------------------------------------------------------
LocalServer::LocalServer(MPInterface *_interface,
- QValueList<MPInterface::Data> &_boards,
+ TQValueList<MPInterface::Data> &_boards,
uint _interval)
: Local(_interface, _boards), Server(_interval)
{
- connect(&timer, SIGNAL(timeout()), SLOT(timeoutSlot()));
- connect(&ctimer, SIGNAL(timeout()), SLOT(congestionTimeoutSlot()));
+ connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutSlot()));
+ connect(&ctimer, TQT_SIGNAL(timeout()), TQT_SLOT(congestionTimeoutSlot()));
serverTimeout();
}
//-----------------------------------------------------------------------------
NetworkServer::NetworkServer(MPInterface *_interface,
- QValueList<MPInterface::Data> &_boards,
- const QPtrList<RemoteHostData> &rhd, uint _interval)
+ TQValueList<MPInterface::Data> &_boards,
+ const TQPtrList<RemoteHostData> &rhd, uint _interval)
: Network(_interface, _boards, rhd), Server(_interval),
nbReceived(remotes.count())
{
- connect(&timer, SIGNAL(timeout()), SLOT(timeoutSlot()));
- connect(&ctimer, SIGNAL(timeout()), SLOT(congestionTimeoutSlot()));
+ connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutSlot()));
+ connect(&ctimer, TQT_SIGNAL(timeout()), TQT_SLOT(congestionTimeoutSlot()));
// to catch unexpected data
for (uint i=0; i<remotes.count(); i++) remotes[i].received = TRUE;
nbReceived = remotes.count();
diff --git a/libksirtet/lib/internal.h b/libksirtet/lib/internal.h
index 4dece16a..cc74fbc4 100644
--- a/libksirtet/lib/internal.h
+++ b/libksirtet/lib/internal.h
@@ -1,8 +1,8 @@
#ifndef INTERNAL_H
#define INTERNAL_H
-#include <qtimer.h>
-#include <qstringlist.h>
+#include <tqtimer.h>
+#include <tqstringlist.h>
#include "socket.h"
#include "mp_interface.h"
@@ -14,12 +14,12 @@ class RemoteHostData;
class Local
{
public:
- Local(MPInterface *_interface, QValueList<MPInterface::Data> &_boards)
+ Local(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards)
: interface(_interface), ios(_boards.count()), boards(_boards) {}
virtual ~Local() {}
virtual uint nbPlayers() const { return boards.count(); }
- virtual QString playerName(uint i) const { return boards[i].name; }
+ virtual TQString playerName(uint i) const { return boards[i].name; }
virtual IOBuffer *ioBuffer(uint i) const { return ios[i]; }
virtual void writeData(bool inverse);
virtual WritingStream *globalStream() { return 0; }
@@ -33,7 +33,7 @@ class Local
void treatData();
private:
- QValueList<MPInterface::Data> boards;
+ TQValueList<MPInterface::Data> boards;
};
//-----------------------------------------------------------------------------
@@ -45,7 +45,7 @@ class Server
protected:
WritingStream stream;
- QTimer timer, ctimer;
+ TQTimer timer, ctimer;
virtual void timeout() = 0;
void serverTimeout();
@@ -56,17 +56,17 @@ class Server
};
//-----------------------------------------------------------------------------
-class Network : public QObject, public Local
+class Network : public TQObject, public Local
{
Q_OBJECT
public:
- Network(MPInterface *_interface, QValueList<MPInterface::Data> &_boards,
- const QPtrList<RemoteHostData> &rhd);
+ Network(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards,
+ const TQPtrList<RemoteHostData> &rhd);
virtual ~Network();
virtual uint nbPlayers() const;
- QString playerName(uint i) const;
+ TQString playerName(uint i) const;
IOBuffer *ioBuffer(uint i) const;
protected slots:
@@ -79,24 +79,24 @@ class Network : public QObject, public Local
Socket *socket;
BufferArray *array;
bool received;
- QStringList names;
+ TQStringList names;
};
- QValueList<RemoteData> remotes;
+ TQValueList<RemoteData> remotes;
void readError(uint i);
void writeError(uint i);
void brokeError(uint i);
- void disconnectHost(uint i, const QString &msg);
+ void disconnectHost(uint i, const TQString &msg);
};
//-----------------------------------------------------------------------------
-class LocalServer : public QObject, public Local, public Server
+class LocalServer : public TQObject, public Local, public Server
{
Q_OBJECT
public:
LocalServer(MPInterface *_interface,
- QValueList<MPInterface::Data> &_boards, uint _interval);
+ TQValueList<MPInterface::Data> &_boards, uint _interval);
WritingStream *globalStream() { return &stream; }
@@ -115,8 +115,8 @@ class NetworkServer : public Network, public Server
public:
NetworkServer(MPInterface *_interface,
- QValueList<MPInterface::Data> &_boards,
- const QPtrList<RemoteHostData> &rhd, uint _interval);
+ TQValueList<MPInterface::Data> &_boards,
+ const TQPtrList<RemoteHostData> &rhd, uint _interval);
void writeData(bool inverse);
WritingStream *globalStream() { return &stream; }
@@ -139,8 +139,8 @@ class Client : public Network
Q_OBJECT
public:
- Client(MPInterface *_interface, QValueList<MPInterface::Data> &_boards,
- const QPtrList<RemoteHostData> &rhd)
+ Client(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards,
+ const TQPtrList<RemoteHostData> &rhd)
: Network(_interface, _boards, rhd) {}
uint nbPlayers() const { return Local::nbPlayers(); }
diff --git a/libksirtet/lib/keys.cpp b/libksirtet/lib/keys.cpp
index 879f0bfa..8433503f 100644
--- a/libksirtet/lib/keys.cpp
+++ b/libksirtet/lib/keys.cpp
@@ -1,14 +1,14 @@
#include "keys.h"
#include "keys.moc"
-#include <qsignal.h>
+#include <tqsignal.h>
#include <kkeydialog.h>
#include <klocale.h>
KeyData::KeyData(uint maxNb, uint nbActions, const ActionData *data,
- QObject *parent)
- : QObject(parent), _maxNb(maxNb)
+ TQObject *parent)
+ : TQObject(parent), _maxNb(maxNb)
{
_data.duplicate(data, nbActions);
@@ -40,13 +40,13 @@ void KeyData::clear()
_cols.resize(0);
}
-void KeyData::createActionCollection(uint index, QWidget *receiver)
+void KeyData::createActionCollection(uint index, TQWidget *receiver)
{
Q_ASSERT( index<_cols.size() );
_cols[index] = new KActionCollection(receiver, this);
for (uint k=0; k<_data.size(); k++) {
- QString label = i18n(_data[k].label);
- QString name = QString("%2 %3").arg(index+1).arg(_data[k].name);
+ TQString label = i18n(_data[k].label);
+ TQString name = TQString("%2 %3").arg(index+1).arg(_data[k].name);
const char *slot = (_data[k].slotRelease ? 0 : _data[k].slot);
KAction *a = new KAction(label, _keycodes[_cols.size()-1][index][k],
receiver, slot, _cols[index], name.utf8());
@@ -54,9 +54,9 @@ void KeyData::createActionCollection(uint index, QWidget *receiver)
if ( slot==0 ) {
SpecialData data;
data.enabled = false;
- data.pressed = new QSignal(this);
+ data.pressed = new TQSignal(this);
data.pressed->connect(receiver, _data[k].slot);
- data.released = new QSignal(this);
+ data.released = new TQSignal(this);
data.released->connect(receiver, _data[k].slotRelease);
_specActions[a] = data;
}
@@ -67,7 +67,7 @@ void KeyData::createActionCollection(uint index, QWidget *receiver)
void KeyData::setEnabled(uint index, bool enabled)
{
for (uint k=0; k<_cols[index]->count(); k++) {
- QMap<KAction *, SpecialData>::Iterator it =
+ TQMap<KAction *, SpecialData>::Iterator it =
_specActions.find(_cols[index]->action(k));
if ( it==_specActions.end() )
_cols[index]->action(k)->setEnabled(enabled);
@@ -88,12 +88,12 @@ void KeyData::save()
_cols[i]->writeShortcutSettings(group());
}
-void KeyData::keyEvent(QKeyEvent *e, bool pressed)
+void KeyData::keyEvent(TQKeyEvent *e, bool pressed)
{
if ( e->isAutoRepeat() ) return;
KKey key(e);
- QMap<KAction *, SpecialData>::Iterator it = _specActions.begin();
+ TQMap<KAction *, SpecialData>::Iterator it = _specActions.begin();
for(; it!=_specActions.end(); ++it) {
if ( !it.data().enabled ) continue;
if ( !it.key()->shortcut().contains(key) ) continue;
diff --git a/libksirtet/lib/keys.h b/libksirtet/lib/keys.h
index 07c08419..62bb818c 100644
--- a/libksirtet/lib/keys.h
+++ b/libksirtet/lib/keys.h
@@ -1,7 +1,7 @@
#ifndef KEYS_H
#define KEYS_H
-#include <qmap.h>
+#include <tqmap.h>
#include <kaction.h>
#include "mp_interface.h"
@@ -12,31 +12,31 @@ class KeyData : public QObject
Q_OBJECT
public:
KeyData(uint maxNb, uint nbActions, const ActionData *,
- QObject *parent);
+ TQObject *parent);
void setKeycodes(uint nb, uint i, const int *keycodes);
void setCurrentNb(uint nb);
void clear();
- void createActionCollection(uint index, QWidget *receiver);
+ void createActionCollection(uint index, TQWidget *receiver);
void setEnabled(uint index, bool enabled);
void addKeys(KKeyDialog &);
void save();
- void keyEvent(QKeyEvent *e, bool pressed);
+ void keyEvent(TQKeyEvent *e, bool pressed);
private:
uint _maxNb;
- QMemArray<ActionData> _data;
- QMap<int, QMap<int, QMemArray<int> > > _keycodes;
- QMemArray<KActionCollection *> _cols;
+ TQMemArray<ActionData> _data;
+ TQMap<int, TQMap<int, TQMemArray<int> > > _keycodes;
+ TQMemArray<KActionCollection *> _cols;
struct SpecialData {
bool enabled;
- QSignal *pressed, *released;
+ TQSignal *pressed, *released;
};
- QMap<KAction *, SpecialData> _specActions;
+ TQMap<KAction *, SpecialData> _specActions;
- QString group() const
- { return QString("Keys (%1 humans)").arg(_cols.size()); }
+ TQString group() const
+ { return TQString("Keys (%1 humans)").arg(_cols.size()); }
};
#endif // KEYS_H
diff --git a/libksirtet/lib/meeting.cpp b/libksirtet/lib/meeting.cpp
index 2cb6e285..71df0e4d 100644
--- a/libksirtet/lib/meeting.cpp
+++ b/libksirtet/lib/meeting.cpp
@@ -1,7 +1,7 @@
#include "meeting.h"
-#include <qmessagebox.h>
-#include <qpushbutton.h>
+#include <tqmessagebox.h>
+#include <tqpushbutton.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -14,7 +14,7 @@
NetMeeting::NetMeeting(const cId &_id, Socket *socket,
MPOptionWidget *option,
- bool _server, QWidget *parent, const char * name)
+ bool _server, TQWidget *parent, const char * name)
: KDialogBase(Plain, i18n("Network Meeting"),
(_server ? Ok|Cancel|Help : Cancel|Help),
(_server ? Ok : Cancel), parent, name),
@@ -24,8 +24,8 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket,
sm[0]->notifier()->setEnabled(TRUE);
/* top layout */
- QVBoxLayout *top = new QVBoxLayout(plainPage(), spacingHint());
- top->setResizeMode(QLayout::Fixed);
+ TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint());
+ top->setResizeMode(TQLayout::Fixed);
// server line
spl = new MeetingLine(server, server, true, plainPage());
@@ -36,7 +36,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket,
wl->hide();
top->addWidget(wl);
- labWait = new QLabel(i18n("Waiting for clients"), plainPage());
+ labWait = new TQLabel(i18n("Waiting for clients"), plainPage());
labWait->setAlignment(AlignCenter);
top->addWidget(labWait);
@@ -44,7 +44,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket,
// if (ow) top->addWidget(ow); #### FIXME
// status bar
- status = new QStatusBar(plainPage());
+ status = new TQStatusBar(plainPage());
status->setSizeGripEnabled(false);
top->addWidget(status);
@@ -65,13 +65,13 @@ void NetMeeting::appendLine(const MeetingLineData &pld, bool server)
{
MeetingLine *pl;
pl = new MeetingLine(pld.own, server, false, wl);
- if (pld.own) connect(pl, SIGNAL(textChanged(const QString &)),
- SLOT(textChanged(const QString &)));
+ if (pld.own) connect(pl, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(textChanged(const TQString &)));
else message(i18n("A new client has just arrived (#%1)")
.arg(wl->size()+1));
pl->setData(pld.ed);
- connect(pl, SIGNAL(typeChanged(MeetingCheckBox::Type)),
- SLOT(typeChanged(MeetingCheckBox::Type)));
+ connect(pl, TQT_SIGNAL(typeChanged(MeetingCheckBox::Type)),
+ TQT_SLOT(typeChanged(MeetingCheckBox::Type)));
wl->append(pl);
waiting();
}
@@ -122,7 +122,7 @@ bool NetMeeting::ready() const
return ( nbReady!=0 );
}
-void NetMeeting::cleanReject(const QString &str)
+void NetMeeting::cleanReject(const TQString &str)
{
sm.clean(); // remove the sockets immediately to avoid possible further mess
if ( !str.isEmpty() )
@@ -205,7 +205,7 @@ void NetMeeting::accept()
KDialogBase::accept();
}
-void NetMeeting::message(const QString &str)
+void NetMeeting::message(const TQString &str)
{
status->message(str, 3000);
}
@@ -213,20 +213,20 @@ void NetMeeting::message(const QString &str)
/** ServerNetMeeting *********************************************************/
ServerNetMeeting::ServerNetMeeting(const cId &id,
const RemoteHostData &r, MPOptionWidget *option,
- QPtrList<RemoteHostData> &arhd, QWidget *parent, const char * name)
+ TQPtrList<RemoteHostData> &arhd, TQWidget *parent, const char * name)
: NetMeeting(id, r.socket, option, TRUE, parent, name), rhd(arhd)
{
- connect(sm[0]->notifier(), SIGNAL(activated(int)), SLOT(newHost(int)));
+ connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), TQT_SLOT(newHost(int)));
players.append(Accepted); // server
// set server line
ExtData ed(r.bds, "", MeetingCheckBox::Ready);
spl->setData(ed);
- connect(spl, SIGNAL(textChanged(const QString &)),
- SLOT(textChanged(const QString &)));
+ connect(spl, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(textChanged(const TQString &)));
// options signal
- if (ow) connect(ow, SIGNAL(changed()), SLOT(optionsChanged()));
+ if (ow) connect(ow, TQT_SIGNAL(changed()), TQT_SLOT(optionsChanged()));
}
void ServerNetMeeting::writeToAll(uint i)
@@ -238,13 +238,13 @@ void ServerNetMeeting::writeToAll(uint i)
sm.commonWritingStream().clear();
}
-void ServerNetMeeting::netError(uint i, const QString &type)
+void ServerNetMeeting::netError(uint i, const TQString &type)
{
Q_ASSERT( i!=0 );
disconnectHost(i, i18n("%1 client #%2: disconnect it").arg(type).arg(i));
}
-void ServerNetMeeting::disconnectHost(uint i, const QString &str)
+void ServerNetMeeting::disconnectHost(uint i, const TQString &str)
{
sm.remove(i, true);
socketRemoved = TRUE;
@@ -271,8 +271,8 @@ void ServerNetMeeting::newHost(int)
players.append(NewPlayer);
Socket *socket = new Socket(s, true);
uint i = sm.append(socket, SocketManager::ReadWrite);
- connect(sm[i]->notifier(), SIGNAL(activated(int)),
- SLOT(readNotifier(int)));
+ connect(sm[i]->notifier(), TQT_SIGNAL(activated(int)),
+ TQT_SLOT(readNotifier(int)));
sm[i]->notifier()->setEnabled(TRUE);
}
@@ -341,7 +341,7 @@ void ServerNetMeeting::modTextFlag(uint i)
{
checkState(i-1, Accepted);
- // the client i has just sent a new text (QString)
+ // the client i has just sent a new text (TQString)
TextInfo ti;
sm[i]->readingStream() >> ti.text;
CHECK_READ(i);
@@ -369,7 +369,7 @@ void ServerNetMeeting::modTypeFlag(uint i)
writeToAll(i);
}
-void ServerNetMeeting::textChanged(const QString &text)
+void ServerNetMeeting::textChanged(const TQString &text)
{
// server line text changed : send to every clients (Mod_Text flag + TextInfo struct)
TextInfo ti; ti.i = 0; ti.text = text;
@@ -448,11 +448,11 @@ void ServerNetMeeting::optionsChanged()
/** ClientNetMeeting *********************************************************/
ClientNetMeeting::ClientNetMeeting(const cId &id,
const RemoteHostData &rhd, MPOptionWidget *option,
- QWidget *parent, const char * name)
+ TQWidget *parent, const char * name)
: NetMeeting(id, rhd.socket, option, FALSE, parent, name), bds(rhd.bds)
{
- connect(sm[0]->notifier(), SIGNAL(activated(int)),
- SLOT(readNotifier(int)));
+ connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)),
+ TQT_SLOT(readNotifier(int)));
players.append(NewPlayer); // server player
// Send id to server (Id flag + Id struct)
@@ -460,7 +460,7 @@ ClientNetMeeting::ClientNetMeeting(const cId &id,
writeToAll(); // what happens if there is a message box appearing before exec() call ??
}
-void ClientNetMeeting::netError(uint, const QString &str)
+void ClientNetMeeting::netError(uint, const TQString &str)
{
cleanReject(i18n("%1 server: aborting connection.").arg(str));
}
@@ -532,9 +532,9 @@ void ClientNetMeeting::delFlag(uint)
message(i18n("Client %1 has left").arg(k));
}
-void ClientNetMeeting::textChanged(const QString &text)
+void ClientNetMeeting::textChanged(const TQString &text)
{
- // text changed : send to server (Mod_Text flag + QString)
+ // text changed : send to server (Mod_Text flag + TQString)
sm.commonWritingStream() << Mod_TextFlag << text;
writeToAll();
}
diff --git a/libksirtet/lib/meeting.h b/libksirtet/lib/meeting.h
index cb534404..1e9ba267 100644
--- a/libksirtet/lib/meeting.h
+++ b/libksirtet/lib/meeting.h
@@ -1,7 +1,7 @@
#ifndef MEETING_H
#define MEETING_H
-#include <qstatusbar.h>
+#include <tqstatusbar.h>
#include <kdialogbase.h>
#include "smanager.h"
#include "pline.h"
@@ -15,22 +15,22 @@ class NetMeeting : public KDialogBase
Q_OBJECT
public:
- // "gameName" and "gameId" are QByteArray because they are
+ // "gameName" and "gameId" are TQByteArray because they are
// used for ID comparing between games.
NetMeeting(const cId &id, Socket *, MPOptionWidget *option, bool server,
- QWidget *parent = 0, const char * name = 0);
+ TQWidget *parent = 0, const char * name = 0);
virtual ~NetMeeting();
protected slots:
void readNotifier(int socket);
- virtual void textChanged(const QString &) = 0;
+ virtual void textChanged(const TQString &) = 0;
virtual void typeChanged(MeetingCheckBox::Type) = 0;
virtual void reject();
virtual void accept();
protected:
enum PlayerState { NewPlayer, IdChecked, Accepted };
- QValueList<PlayerState> players;
+ TQValueList<PlayerState> players;
bool server;
MeetingLine *spl;
WidgetList<MeetingLine> *wl;
@@ -44,7 +44,7 @@ class NetMeeting : public KDialogBase
void setType(const TypeInfo &ti);
void setText(const TextInfo &ti);
- void cleanReject(const QString &str = QString::null);
+ void cleanReject(const TQString &str = TQString::null);
bool checkState(uint i, PlayerState s);
bool checkAndSetState(uint i, PlayerState os, PlayerState ns);
bool ready() const;
@@ -58,17 +58,17 @@ class NetMeeting : public KDialogBase
virtual void modOptFlag(uint i) { dataError(i); }
virtual void playFlag(uint i) { dataError(i); }
- virtual void netError(uint i, const QString &str) = 0;
+ virtual void netError(uint i, const TQString &str) = 0;
virtual void writeToAll(uint i=0) = 0;
void readError(uint i);
void writeError(uint i);
void dataError(uint i);
void brokeError(uint i);
- void message(const QString &str);
+ void message(const TQString &str);
private:
- QLabel *labWait;
- QStatusBar *status;
+ TQLabel *labWait;
+ TQStatusBar *status;
void waiting();
void readData(uint i);
@@ -81,18 +81,18 @@ class ServerNetMeeting : public NetMeeting
public:
ServerNetMeeting(const cId &id,
const RemoteHostData &rhd, MPOptionWidget *options,
- QPtrList<RemoteHostData> &arhd,
- QWidget *parent = 0, const char * name = 0);
+ TQPtrList<RemoteHostData> &arhd,
+ TQWidget *parent = 0, const char * name = 0);
private slots:
void newHost(int);
- void textChanged(const QString &text);
+ void textChanged(const TQString &text);
void typeChanged(MeetingCheckBox::Type);
void accept();
void optionsChanged();
private:
- QPtrList<RemoteHostData> &rhd;
+ TQPtrList<RemoteHostData> &rhd;
void idFlag(uint i);
void newFlag(uint i);
@@ -100,9 +100,9 @@ class ServerNetMeeting : public NetMeeting
void modTypeFlag(uint i);
void modTextFlag(uint i);
- void netError(uint i, const QString &str);
+ void netError(uint i, const TQString &str);
void writeToAll(uint i = 0);
- void disconnectHost(uint i, const QString &str);
+ void disconnectHost(uint i, const TQString &str);
};
class ClientNetMeeting : public NetMeeting
@@ -112,14 +112,14 @@ class ClientNetMeeting : public NetMeeting
public:
ClientNetMeeting(const cId &id,
const RemoteHostData &rhd, MPOptionWidget *options,
- QWidget *parent = 0, const char * name = 0);
+ TQWidget *parent = 0, const char * name = 0);
private slots:
- void textChanged(const QString &text);
+ void textChanged(const TQString &text);
void typeChanged(MeetingCheckBox::Type);
private:
- QValueList<BoardData> bds;
+ TQValueList<BoardData> bds;
void idFlag(uint);
void newFlag(uint);
@@ -131,7 +131,7 @@ class ClientNetMeeting : public NetMeeting
void playFlag(uint);
void writeToAll(uint i=0);
- void netError(uint, const QString &str);
+ void netError(uint, const TQString &str);
};
#endif // MEETING_H
diff --git a/libksirtet/lib/miscui.cpp b/libksirtet/lib/miscui.cpp
index 28f00914..dde70adb 100644
--- a/libksirtet/lib/miscui.cpp
+++ b/libksirtet/lib/miscui.cpp
@@ -1,27 +1,27 @@
#include "miscui.h"
#include "miscui.moc"
-#include <qlayout.h>
+#include <tqlayout.h>
#include <klocale.h>
//-----------------------------------------------------------------------------
MeetingCheckBox::MeetingCheckBox(Type type, bool owner, bool server,
- QWidget *parent)
- : QWidget(parent, "meeting_check_box")
+ TQWidget *parent)
+ : TQWidget(parent, "meeting_check_box")
{
- QVBoxLayout *vbox = new QVBoxLayout(this);
+ TQVBoxLayout *vbox = new TQVBoxLayout(this);
- _ready = new QCheckBox(i18n("Ready"), this);
+ _ready = new TQCheckBox(i18n("Ready"), this);
vbox->addWidget(_ready);
_ready->setEnabled(owner);
- connect(_ready, SIGNAL(clicked()), SLOT(changedSlot()));
+ connect(_ready, TQT_SIGNAL(clicked()), TQT_SLOT(changedSlot()));
- _excluded = new QCheckBox(i18n("Excluded"), this);
+ _excluded = new TQCheckBox(i18n("Excluded"), this);
vbox->addWidget(_excluded);
_excluded->setEnabled(server);
- connect(_excluded, SIGNAL(clicked()), SLOT(changedSlot()));
+ connect(_excluded, TQT_SIGNAL(clicked()), TQT_SLOT(changedSlot()));
setType(type);
}
@@ -46,13 +46,13 @@ void MeetingCheckBox::changedSlot()
//-----------------------------------------------------------------------------
PlayerComboBox::PlayerComboBox(Type type, bool canBeEmpty, bool acceptAI,
- QWidget *parent)
- : QComboBox(parent, "player_combo_box")
+ TQWidget *parent)
+ : TQComboBox(parent, "player_combo_box")
{
insertItem(i18n("Human"));
if (acceptAI) insertItem(i18n("AI"));
if (canBeEmpty) insertItem(i18n("None"));
setCurrentItem(type);
- connect(this, SIGNAL(activated(int)), SIGNAL(changed(int)));
+ connect(this, TQT_SIGNAL(activated(int)), TQT_SIGNAL(changed(int)));
}
diff --git a/libksirtet/lib/miscui.h b/libksirtet/lib/miscui.h
index 7de5dfbc..fb40e0ec 100644
--- a/libksirtet/lib/miscui.h
+++ b/libksirtet/lib/miscui.h
@@ -1,8 +1,8 @@
#ifndef MISCUI_H
#define MISCUI_H
-#include <qcombobox.h>
-#include <qcheckbox.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
//-----------------------------------------------------------------------------
@@ -11,7 +11,7 @@ class MeetingCheckBox : public QWidget
Q_OBJECT
public:
enum Type { Ready, NotReady, Excluded };
- MeetingCheckBox(Type, bool owner, bool server, QWidget *parent);
+ MeetingCheckBox(Type, bool owner, bool server, TQWidget *parent);
void setType(Type);
Type type() const;
@@ -23,7 +23,7 @@ class MeetingCheckBox : public QWidget
void changedSlot();
private:
- QCheckBox *_ready, *_excluded;
+ TQCheckBox *_ready, *_excluded;
};
//-----------------------------------------------------------------------------
@@ -32,7 +32,7 @@ class PlayerComboBox : public QComboBox
Q_OBJECT
public:
enum Type { Human = 0, AI, None };
- PlayerComboBox(Type, bool canBeNone, bool acceptAI, QWidget *parent);
+ PlayerComboBox(Type, bool canBeNone, bool acceptAI, TQWidget *parent);
Type type() const { return (Type)currentItem(); }
diff --git a/libksirtet/lib/mp_board.h b/libksirtet/lib/mp_board.h
index fbd1e01f..5e84825c 100644
--- a/libksirtet/lib/mp_board.h
+++ b/libksirtet/lib/mp_board.h
@@ -1,7 +1,7 @@
#ifndef MP_BOARD_H
#define MP_BOARD_H
-#include <qwidget.h>
+#include <tqwidget.h>
/**
* The MP_Board class is the base widget from which each individual
@@ -12,8 +12,8 @@ class MPBoard : public QWidget
Q_OBJECT
public:
- MPBoard(QWidget *parent, const char *name=0)
- : QWidget(parent, name) {}
+ MPBoard(TQWidget *parent, const char *name=0)
+ : TQWidget(parent, name) {}
virtual ~MPBoard() {}
/**
@@ -23,7 +23,7 @@ class MPBoard : public QWidget
* @param first is TRUE if this board is the first local one.
*/
virtual void init(bool AI, bool multiplayers, bool server, bool first,
- const QString &name) = 0;
+ const TQString &name) = 0;
/**
* Put data on the stream.
@@ -31,7 +31,7 @@ class MPBoard : public QWidget
* This method is the communication way out. The data given here will
* be the only information that will go to the server.
*/
- virtual void dataOut(QDataStream &) = 0;
+ virtual void dataOut(TQDataStream &) = 0;
/**
* Get data from the stream.
@@ -39,7 +39,7 @@ class MPBoard : public QWidget
* This method is the communication way in. The data given here will be
* the only information that you will receive from the server.
*/
- virtual void dataIn(QDataStream &) = 0;
+ virtual void dataIn(TQDataStream &) = 0;
signals:
/**
diff --git a/libksirtet/lib/mp_interface.cpp b/libksirtet/lib/mp_interface.cpp
index 61742562..cfe06cd0 100644
--- a/libksirtet/lib/mp_interface.cpp
+++ b/libksirtet/lib/mp_interface.cpp
@@ -1,8 +1,8 @@
#include "mp_interface.h"
#include "mp_interface.moc"
-#include <qpainter.h>
-#include <qlayout.h>
+#include <tqpainter.h>
+#include <tqlayout.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -21,13 +21,13 @@
/*****************************************************************************/
MPInterface::MPInterface(const MPGameInfo &_gameInfo,
uint nbActions, const ActionData *data,
- QWidget *parent, const char *name)
-: QWidget(parent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0)
+ TQWidget *parent, const char *name)
+: TQWidget(parent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0)
{
Q_ASSERT( gameInfo.maxNbLocalPlayers>=1 );
- hbl = new QHBoxLayout(this, 0, 5);
- hbl->setResizeMode( QLayout::Fixed );
+ hbl = new TQHBoxLayout(this, 0, 5);
+ hbl->setResizeMode( TQLayout::Fixed );
_keyData = new KeyData(gameInfo.maxNbLocalPlayers, nbActions, data, this);
}
@@ -57,13 +57,13 @@ void MPInterface::dialog()
// configuration wizard
ConnectionData cd;
MPWizard wiz(gameInfo, cd, this);
- if ( wiz.exec()==QDialog::Rejected ) {
+ if ( wiz.exec()==TQDialog::Rejected ) {
singleHuman(); // create a single game
return;
}
// net meeting
- QPtrList<RemoteHostData> rhd;
+ TQPtrList<RemoteHostData> rhd;
rhd.setAutoDelete(TRUE);
if (cd.network) {
cId id(kapp->name(), gameInfo.gameId);
@@ -98,13 +98,13 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs)
KConfigGroupSaver cg(kapp->config(), MP_GROUP);
for (uint i=0; i<(nbHumans+nbAIs); i++) {
bd.type = (i<nbHumans ? PlayerComboBox::Human : PlayerComboBox::AI);
- bd.name = QString::null;
+ bd.name = TQString::null;
t = (PlayerComboBox::Type)
- cg.config()->readNumEntry(QString(MP_PLAYER_TYPE).arg(i),
+ cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).arg(i),
PlayerComboBox::None);
if ( bd.type==t )
- bd.name = cg.config()->readEntry(QString(MP_PLAYER_NAME).arg(i),
- QString::null);
+ bd.name = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i),
+ TQString::null);
if ( bd.name.isNull() )
bd.name = (i<nbHumans ? i18n("Human %1").arg(i+1)
: i18n("AI %1").arg(i-nbHumans+1));
@@ -116,11 +116,11 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs)
Q_ASSERT( gameInfo.AIAllowed || nbAIs==0 );
createLocalGame(cd);
- QPtrList<RemoteHostData> rhd;
+ TQPtrList<RemoteHostData> rhd;
createServerGame(rhd);
}
-void MPInterface::createServerGame(const QPtrList<RemoteHostData> &rhd)
+void MPInterface::createServerGame(const TQPtrList<RemoteHostData> &rhd)
{
internal = (rhd.count()
? (Local *)new NetworkServer(this, boards, rhd, gameInfo.interval)
@@ -130,7 +130,7 @@ void MPInterface::createServerGame(const QPtrList<RemoteHostData> &rhd)
void MPInterface::createClientGame(const RemoteHostData &rhd)
{
- QPtrList<RemoteHostData> r;
+ TQPtrList<RemoteHostData> r;
r.append((RemoteHostData *)&rhd);
internal = new Client(this, boards, r);
init();
@@ -155,7 +155,7 @@ void MPInterface::createLocalGame(const ConnectionData &cd)
d.ptr = newBoard(i);
hbl->addWidget(d.ptr);
d.ptr->show();
- connect(d.ptr, SIGNAL(enableKeys(bool)), SLOT(enableKeys(bool)));
+ connect(d.ptr, TQT_SIGNAL(enableKeys(bool)), TQT_SLOT(enableKeys(bool)));
boards += d;
}
@@ -204,12 +204,12 @@ void MPInterface::enableKeys(bool enable)
_keyData->setEnabled(hi, enable);
}
-void MPInterface::keyPressEvent(QKeyEvent *e)
+void MPInterface::keyPressEvent(TQKeyEvent *e)
{
_keyData->keyEvent(e, true);
}
-void MPInterface::keyReleaseEvent(QKeyEvent *e)
+void MPInterface::keyReleaseEvent(TQKeyEvent *e)
{
_keyData->keyEvent(e, false);
}
@@ -222,24 +222,24 @@ uint MPInterface::nbPlayers() const
return internal->nbPlayers();
}
-QString MPInterface::playerName(uint i) const
+TQString MPInterface::playerName(uint i) const
{
Q_ASSERT(_server);
return internal->playerName(i);
}
-QDataStream &MPInterface::readingStream(uint i) const
+TQDataStream &MPInterface::readingStream(uint i) const
{
Q_ASSERT(_server);
return internal->ioBuffer(i)->reading;
}
-QDataStream &MPInterface::writingStream(uint i) const
+TQDataStream &MPInterface::writingStream(uint i) const
{
return internal->ioBuffer(i)->writing;
}
-QDataStream &MPInterface::dataToClientsStream() const
+TQDataStream &MPInterface::dataToClientsStream() const
{
Q_ASSERT(_server);
return *internal->globalStream();
@@ -250,14 +250,14 @@ void MPInterface::immediateWrite()
internal->writeData(_server);
}
-void MPInterface::hostDisconnected(uint, const QString &msg)
+void MPInterface::hostDisconnected(uint, const TQString &msg)
{
- errorBox(msg, QString::null, this);
+ errorBox(msg, TQString::null, this);
if ( !disconnected ) { // to avoid multiple calls
disconnected = TRUE;
// the zero timer is used to be outside the "internal" class
- QTimer::singleShot(0, this, SLOT(singleHumanSlot()));
+ TQTimer::singleShot(0, this, TQT_SLOT(singleHumanSlot()));
}
}
@@ -267,8 +267,8 @@ void MPInterface::singleHumanSlot()
singleHuman();
}
-void MPInterface::paintEvent(QPaintEvent *e)
+void MPInterface::paintEvent(TQPaintEvent *e)
{
- QPainter p(this);
+ TQPainter p(this);
p.fillRect(e->rect(), darkGray);
}
diff --git a/libksirtet/lib/mp_interface.h b/libksirtet/lib/mp_interface.h
index ad925cba..e52ea9f7 100644
--- a/libksirtet/lib/mp_interface.h
+++ b/libksirtet/lib/mp_interface.h
@@ -1,9 +1,9 @@
#ifndef MP_INTERFACE_H
#define MP_INTERFACE_H
-#include <qwidget.h>
-#include <qvaluelist.h>
-#include <qptrlist.h>
+#include <tqwidget.h>
+#include <tqvaluelist.h>
+#include <tqptrlist.h>
#include "mp_board.h"
#include "mp_option.h"
@@ -82,7 +82,7 @@ class MPInterface : public QWidget
*/
MPInterface(const MPGameInfo &gameInfo,
uint nbActions, const ActionData *data,
- QWidget *parent = 0, const char *name = 0);
+ TQWidget *parent = 0, const char *name = 0);
virtual ~MPInterface();
public slots:
@@ -135,7 +135,7 @@ class MPInterface : public QWidget
/** @return the player name.
Do not call from client !
*/
- QString playerName(uint i) const;
+ TQString playerName(uint i) const;
/**
* Create a new @ref MPBoard.
@@ -161,11 +161,11 @@ class MPInterface : public QWidget
/** @return the reading stream for board #i.
* Do not call from client !
*/
- QDataStream &readingStream(uint i) const;
+ TQDataStream &readingStream(uint i) const;
/** @return the writing stream for board #i.
*/
- QDataStream &writingStream(uint i) const;
+ TQDataStream &writingStream(uint i) const;
/**
* Read data sent from server to clients "MultiplayersInterface"
@@ -175,13 +175,13 @@ class MPInterface : public QWidget
* local games.
* NB: the use of this method is optional.
*/
- virtual void dataFromServer(QDataStream &) {}
+ virtual void dataFromServer(TQDataStream &) {}
/** Used by the server to write meta data to clients.
* NB: the use of this method is optional.
* Do not call from client !
*/
- QDataStream &dataToClientsStream() const;
+ TQDataStream &dataToClientsStream() const;
/** Write immediately data to clients and local boards.
* It is unlike the normal exchange which is driven
@@ -203,12 +203,12 @@ class MPInterface : public QWidget
* ie it stops the current game. By overloading this method, it is
* possible to continue the game at this point with the remaining players.
*/
- virtual void hostDisconnected(uint i, const QString &msg);
+ virtual void hostDisconnected(uint i, const TQString &msg);
protected:
- void paintEvent(QPaintEvent *);
- void keyPressEvent(QKeyEvent *);
- void keyReleaseEvent(QKeyEvent *);
+ void paintEvent(TQPaintEvent *);
+ void keyPressEvent(TQKeyEvent *);
+ void keyReleaseEvent(TQKeyEvent *);
private slots:
void enableKeys(bool enable);
@@ -220,21 +220,21 @@ class MPInterface : public QWidget
Data() {}
MPBoard *ptr;
int humanIndex;
- QString name;
+ TQString name;
};
private:
Local *internal;
const MPGameInfo gameInfo;
- QValueList<Data> boards;
+ TQValueList<Data> boards;
uint nbLocalHumans;
- QHBoxLayout *hbl;
+ TQHBoxLayout *hbl;
bool _server, disconnected;
KeyData *_keyData;
- QMemArray<KeyCollection *> _keyCol;
+ TQMemArray<KeyCollection *> _keyCol;
- void createServerGame(const QPtrList<RemoteHostData> &);
+ void createServerGame(const TQPtrList<RemoteHostData> &);
void createClientGame(const RemoteHostData &);
void createLocalGame(const ConnectionData &);
void specialLocalGame(uint nbHumans, uint nbComputers);
diff --git a/libksirtet/lib/mp_option.h b/libksirtet/lib/mp_option.h
index 94c59107..2db2eacf 100644
--- a/libksirtet/lib/mp_option.h
+++ b/libksirtet/lib/mp_option.h
@@ -1,7 +1,7 @@
#ifndef MP_OPTION_H
#define MP_OPTION_H
-#include <qwidget.h>
+#include <tqwidget.h>
/**
* The OptionWidget is a base widget for the option widget in the
@@ -37,8 +37,8 @@ class MPOptionWidget : public QWidget
Q_OBJECT
public:
- MPOptionWidget(bool Server, QWidget *parent = 0, const char *name = 0)
- : QWidget(parent, name), server(Server) {}
+ MPOptionWidget(bool Server, TQWidget *parent = 0, const char *name = 0)
+ : TQWidget(parent, name), server(Server) {}
virtual ~MPOptionWidget() {}
bool isServer() const { return server; }
@@ -47,10 +47,10 @@ class MPOptionWidget : public QWidget
* This method is used on the client side to set the data coming from
* the server widget.
*/
- virtual void dataIn(QDataStream &s) = 0;
+ virtual void dataIn(TQDataStream &s) = 0;
/** This method is used on the server side to get the data. */
- virtual void dataOut(QDataStream &s) const = 0;
+ virtual void dataOut(TQDataStream &s) const = 0;
/**
* When the game will begin (ie when the "netmeeting" is over and the
diff --git a/libksirtet/lib/mp_simple_board.cpp b/libksirtet/lib/mp_simple_board.cpp
index f032c488..c0828f1e 100644
--- a/libksirtet/lib/mp_simple_board.cpp
+++ b/libksirtet/lib/mp_simple_board.cpp
@@ -3,13 +3,13 @@
void MPSimpleBoard::init(bool AI, bool multiplayers, bool server, bool first,
- const QString &name)
+ const TQString &name)
{
state = BS_Init;
_init(AI, multiplayers, server, first, name);
}
-void MPSimpleBoard::dataIn(QDataStream &s)
+void MPSimpleBoard::dataIn(TQDataStream &s)
{
if ( s.atEnd() ) return; // no data
@@ -24,14 +24,14 @@ void MPSimpleBoard::dataIn(QDataStream &s)
}
}
-void MPSimpleBoard::initFlag(QDataStream &s)
+void MPSimpleBoard::initFlag(TQDataStream &s)
{
state = BS_Play;
emit enableKeys(true);
_initFlag(s);
}
-void MPSimpleBoard::playFlag(QDataStream &s)
+void MPSimpleBoard::playFlag(TQDataStream &s)
{
Q_ASSERT( state==BS_Play );
_playFlag(s);
@@ -66,7 +66,7 @@ void MPSimpleBoard::_stop(bool gameover)
_stopFlag(gameover);
}
-void MPSimpleBoard::dataOut(QDataStream &s)
+void MPSimpleBoard::dataOut(TQDataStream &s)
{
switch (state) {
case BS_Init:
diff --git a/libksirtet/lib/mp_simple_board.h b/libksirtet/lib/mp_simple_board.h
index 2131feb2..d9a681f7 100644
--- a/libksirtet/lib/mp_simple_board.h
+++ b/libksirtet/lib/mp_simple_board.h
@@ -11,31 +11,31 @@ class KDE_EXPORT MPSimpleBoard : public MPBoard
Q_OBJECT
public:
- MPSimpleBoard(QWidget *parent = 0, const char *name = 0)
+ MPSimpleBoard(TQWidget *parent = 0, const char *name = 0)
: MPBoard(parent, name) {}
virtual ~MPSimpleBoard() {}
void init(bool AI, bool multiplayers, bool server, bool first,
- const QString &name);
- void dataOut(QDataStream &s);
- void dataIn(QDataStream &s);
+ const TQString &name);
+ void dataOut(TQDataStream &s);
+ void dataIn(TQDataStream &s);
protected:
virtual void _init(bool AI, bool multiplayers, bool server, bool first,
- const QString &name) = 0;
- virtual void _initFlag(QDataStream &s) = 0;
- virtual void _playFlag(QDataStream &s) = 0;
+ const TQString &name) = 0;
+ virtual void _initFlag(TQDataStream &s) = 0;
+ virtual void _playFlag(TQDataStream &s) = 0;
virtual void _pauseFlag(bool pause) = 0;
virtual void _stopFlag(bool gameover) = 0;
- virtual void _dataOut(QDataStream &s) = 0;
- virtual void _gameOverDataOut(QDataStream &s) = 0;
- virtual void _initDataOut(QDataStream &s) = 0;
+ virtual void _dataOut(TQDataStream &s) = 0;
+ virtual void _gameOverDataOut(TQDataStream &s) = 0;
+ virtual void _initDataOut(TQDataStream &s) = 0;
private:
BoardState state;
- void initFlag(QDataStream &s);
- void playFlag(QDataStream &s);
+ void initFlag(TQDataStream &s);
+ void playFlag(TQDataStream &s);
void pauseFlag();
void stopFlag();
void gameOverFlag();
diff --git a/libksirtet/lib/mp_simple_interface.cpp b/libksirtet/lib/mp_simple_interface.cpp
index e75243a6..1b83be40 100644
--- a/libksirtet/lib/mp_simple_interface.cpp
+++ b/libksirtet/lib/mp_simple_interface.cpp
@@ -2,7 +2,7 @@
#include "mp_simple_interface.moc"
#include <kmessagebox.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include <klocale.h>
#include <kaction.h>
#include <kmainwindow.h>
@@ -13,7 +13,7 @@
MPSimpleInterface::MPSimpleInterface(const MPGameInfo &gi,
uint nbActions, const ActionData *data,
- QWidget *parent, const char *name)
+ TQWidget *parent, const char *name)
: MPInterface(gi, nbActions, data, parent, name), state(SS_Standby)
{}
@@ -64,7 +64,7 @@ void MPSimpleInterface::pause()
}
}
-void MPSimpleInterface::dataFromServer(QDataStream &s)
+void MPSimpleInterface::dataFromServer(TQDataStream &s)
{
if ( s.atEnd() ) return; // no data
@@ -73,7 +73,7 @@ void MPSimpleInterface::dataFromServer(QDataStream &s)
switch (scf.value()) {
case SC_Flag::Stop:
KMessageBox::information(this, i18n("Server has left game!"));
- QTimer::singleShot(0, this, SLOT(singleHuman()));
+ TQTimer::singleShot(0, this, TQT_SLOT(singleHuman()));
return;
case SC_Flag::GameOver:
_readGameOverData(s);
@@ -141,7 +141,7 @@ void MPSimpleInterface::treatStop()
state = SS_Standby;
// read game over data + send them to all clients
- QDataStream &s = dataToClientsStream();
+ TQDataStream &s = dataToClientsStream();
SC_Flag f(SC_Flag::GameOver);
s << f;
_sendGameOverData(s);
diff --git a/libksirtet/lib/mp_simple_interface.h b/libksirtet/lib/mp_simple_interface.h
index 84e6f444..d366dafd 100644
--- a/libksirtet/lib/mp_simple_interface.h
+++ b/libksirtet/lib/mp_simple_interface.h
@@ -11,7 +11,7 @@ class MPSimpleInterface : public MPInterface
public:
MPSimpleInterface(const MPGameInfo &gi,
uint nbActions, const ActionData *data,
- QWidget *parent = 0, const char *name = 0);
+ TQWidget *parent = 0, const char *name = 0);
bool isPaused() const { return state==SS_Pause; }
@@ -22,8 +22,8 @@ class MPSimpleInterface : public MPInterface
protected:
virtual void _init() = 0;
- virtual void _readGameOverData(QDataStream &s) = 0;
- virtual void _sendGameOverData(QDataStream &s) = 0;
+ virtual void _readGameOverData(TQDataStream &s) = 0;
+ virtual void _sendGameOverData(TQDataStream &s) = 0;
virtual void _showGameOverData() = 0;
virtual void _firstInit() = 0;
virtual void _treatInit() = 0;
@@ -42,7 +42,7 @@ class MPSimpleInterface : public MPInterface
void init();
void stop();
- void dataFromServer(QDataStream &);
+ void dataFromServer(TQDataStream &);
};
#endif // MP_SIMPLE_INTERFACE_H
diff --git a/libksirtet/lib/mp_simple_types.cpp b/libksirtet/lib/mp_simple_types.cpp
index a470ce7c..c2a9dc27 100644
--- a/libksirtet/lib/mp_simple_types.cpp
+++ b/libksirtet/lib/mp_simple_types.cpp
@@ -1,6 +1,6 @@
#include "mp_simple_types.h"
-QDataStream &operator <<(QDataStream &s, const EnumClass &ec)
+TQDataStream &operator <<(TQDataStream &s, const EnumClass &ec)
{ s << (Q_UINT8)ec.f; return s; }
-QDataStream &operator >>(QDataStream &s, EnumClass &ec)
+TQDataStream &operator >>(TQDataStream &s, EnumClass &ec)
{ Q_UINT8 t; s >> t; ec.f = (int)t; return s; }
diff --git a/libksirtet/lib/mp_simple_types.h b/libksirtet/lib/mp_simple_types.h
index 2fd0c289..248d3fee 100644
--- a/libksirtet/lib/mp_simple_types.h
+++ b/libksirtet/lib/mp_simple_types.h
@@ -1,7 +1,7 @@
#ifndef WF_TYPES_H
#define WF_TYPES_H
-#include <qdatastream.h>
+#include <tqdatastream.h>
class EnumClass
{
@@ -9,8 +9,8 @@ class EnumClass
EnumClass(int _f) : f(_f) {}
int f;
};
-QDataStream &operator <<(QDataStream &s, const EnumClass &f);
-QDataStream &operator >>(QDataStream &s, EnumClass &f);
+TQDataStream &operator <<(TQDataStream &s, const EnumClass &f);
+TQDataStream &operator >>(TQDataStream &s, EnumClass &f);
class IO_Flag : public EnumClass
{
diff --git a/libksirtet/lib/pline.cpp b/libksirtet/lib/pline.cpp
index 41faf6ac..86fde398 100644
--- a/libksirtet/lib/pline.cpp
+++ b/libksirtet/lib/pline.cpp
@@ -1,36 +1,36 @@
#include "pline.h"
#include "pline.moc"
-#include <qfont.h>
-#include <qpushbutton.h>
+#include <tqfont.h>
+#include <tqpushbutton.h>
#include <klocale.h>
#include "defines.h"
#define THIN_BORDER 4
MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine,
- QWidget *parent, const char *name)
-: QFrame(parent, name)
+ TQWidget *parent, const char *name)
+: TQFrame(parent, name)
{
setFrameStyle(Panel | (serverLine ? Raised : Plain));
// Top layout
- hbl = new QHBoxLayout(this, THIN_BORDER + frameWidth());
+ hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth());
/* TriCheckBox */
tcb = new MeetingCheckBox(MeetingCheckBox::Ready, isOwner, serverIsReader,
this);
if ( !XOR(isOwner, serverIsReader) ) tcb->setEnabled(FALSE);
- else connect(tcb, SIGNAL(changed(int)), SLOT(_typeChanged(int)));
+ else connect(tcb, TQT_SIGNAL(changed(int)), TQT_SLOT(_typeChanged(int)));
hbl->addWidget(tcb);
/* Name */
- lname = new QLabel(" ", this);
+ lname = new TQLabel(" ", this);
lname->setAlignment(AlignCenter);
- lname->setFrameStyle(QFrame::Panel | QFrame::Sunken);
+ lname->setFrameStyle(TQFrame::Panel | TQFrame::Sunken);
lname->setLineWidth(2);
lname->setMidLineWidth(3);
- QFont f = lname->font();
+ TQFont f = lname->font();
f.setBold(TRUE);
lname->setFont(f);
lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH,
@@ -39,21 +39,21 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine,
hbl->addStretch(1);
// Nb humans
- labH = new QLabel(this);
+ labH = new TQLabel(this);
hbl->addWidget(labH);
// Nb AIs
- labAI = new QLabel(this);
+ labAI = new TQLabel(this);
hbl->addWidget(labAI);
// talker
- qle = new QLineEdit(this);
+ qle = new TQLineEdit(this);
qle->setMaxLength(TALKER_MAX_LENGTH);
- qle->setFont( QFont("fixed", 12, QFont::Bold) );
+ qle->setFont( TQFont("fixed", 12, TQFont::Bold) );
qle->setFixedSize(qle->fontMetrics().maxWidth()*TALKER_MAX_LENGTH,
qle->sizeHint().height());
- connect(qle, SIGNAL(textChanged(const QString &)),
- SLOT(_textChanged(const QString &)));
+ connect(qle, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(_textChanged(const TQString &)));
qle->setEnabled(isOwner);
hbl->addWidget(qle);
}
@@ -81,33 +81,33 @@ void MeetingLine::data(ExtData &ed) const
}
/*****************************************************************************/
-PlayerLine::PlayerLine(PlayerComboBox::Type type, const QString &txt,
+PlayerLine::PlayerLine(PlayerComboBox::Type type, const TQString &txt,
bool humanSetting, bool AISetting,
bool canBeEmpty, bool acceptAI,
- QWidget *parent, const char *name)
-: QFrame(parent, name), hs(humanSetting), as(AISetting)
+ TQWidget *parent, const char *name)
+: TQFrame(parent, name), hs(humanSetting), as(AISetting)
{
setFrameStyle(Panel | Raised);
// Top layout
- QHBoxLayout *hbl;
- hbl = new QHBoxLayout(this, THIN_BORDER + frameWidth());
+ TQHBoxLayout *hbl;
+ hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth());
/* CheckBox */
pcb = new PlayerComboBox(type, canBeEmpty, acceptAI, this);
- connect(pcb, SIGNAL(changed(int)), SLOT(typeChangedSlot(int)));
+ connect(pcb, TQT_SIGNAL(changed(int)), TQT_SLOT(typeChangedSlot(int)));
hbl->addWidget(pcb);
/* Name */
- edit = new QLineEdit(txt, this);
+ edit = new TQLineEdit(txt, this);
edit->setMaxLength(NAME_MAX_LENGTH);
edit->setFixedSize(edit->fontMetrics().maxWidth()*(NAME_MAX_LENGTH+2),
edit->sizeHint().height());
hbl->addWidget(edit);
/* settings button */
- setting = new QPushButton(i18n("Settings"), this);
- connect(setting, SIGNAL(clicked()), SLOT(setSlot()));
+ setting = new TQPushButton(i18n("Settings"), this);
+ connect(setting, TQT_SIGNAL(clicked()), TQT_SLOT(setSlot()));
hbl->addWidget(setting);
typeChangedSlot(type);
@@ -128,13 +128,13 @@ void PlayerLine::setSlot()
}
/*****************************************************************************/
-GWidgetList::GWidgetList(uint interval, QWidget *parent, const char * name)
- : QWidget(parent, name), vbl(this, interval)
+GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name)
+ : TQWidget(parent, name), vbl(this, interval)
{
widgets.setAutoDelete(TRUE);
}
-void GWidgetList::append(QWidget *wi)
+void GWidgetList::append(TQWidget *wi)
{
vbl.addWidget(wi);
wi->show();
diff --git a/libksirtet/lib/pline.h b/libksirtet/lib/pline.h
index 2defd10a..7d6e97e7 100644
--- a/libksirtet/lib/pline.h
+++ b/libksirtet/lib/pline.h
@@ -1,12 +1,12 @@
#ifndef PLINE_H
#define PLINE_H
-#include <qframe.h>
-#include <qscrollbar.h>
-#include <qlineedit.h>
-#include <qlabel.h>
-#include <qptrlist.h>
-#include <qlayout.h>
+#include <tqframe.h>
+#include <tqscrollbar.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqptrlist.h>
+#include <tqlayout.h>
#include "types.h"
@@ -19,33 +19,33 @@ class MeetingLine : public QFrame
public:
MeetingLine(bool isOwner, bool readerIsServer, bool serverLine,
- QWidget *parent, const char *name = 0);
+ TQWidget *parent, const char *name = 0);
MeetingCheckBox::Type type() const { return tcb->type(); }
void setType(MeetingCheckBox::Type type) { tcb->setType(type); }
- void setText(const QString &text) { qle->setText(text); }
+ void setText(const TQString &text) { qle->setText(text); }
void setData(const ExtData &ed);
void data(ExtData &ed) const;
- QString text() const { return qle->text(); }
+ TQString text() const { return qle->text(); }
signals:
void typeChanged(MeetingCheckBox::Type);
- void textChanged(const QString &);
+ void textChanged(const TQString &);
private slots:
void _typeChanged(int t)
{ emit typeChanged((MeetingCheckBox::Type)t); }
- void _textChanged(const QString &text) { emit textChanged(text); }
+ void _textChanged(const TQString &text) { emit textChanged(text); }
protected:
- QHBoxLayout *hbl;
+ TQHBoxLayout *hbl;
private:
MeetingCheckBox *tcb;
- QLabel *lname, *labH, *labAI;
- QValueList<BoardData> bds;
- QLineEdit *qle;
+ TQLabel *lname, *labH, *labAI;
+ TQValueList<BoardData> bds;
+ TQLineEdit *qle;
};
class PlayerLine : public QFrame
@@ -53,13 +53,13 @@ class PlayerLine : public QFrame
Q_OBJECT
public:
- PlayerLine(PlayerComboBox::Type type, const QString &txt,
+ PlayerLine(PlayerComboBox::Type type, const TQString &txt,
bool humanSetting, bool AISetting,
bool canBeEmpty, bool acceptAI,
- QWidget *parent = 0, const char *name = 0);
+ TQWidget *parent = 0, const char *name = 0);
PlayerComboBox::Type type() const { return pcb->type(); }
- QString name() const { return edit->text(); }
+ TQString name() const { return edit->text(); }
signals:
void setHuman();
@@ -72,8 +72,8 @@ class PlayerLine : public QFrame
private:
PlayerComboBox *pcb;
- QLineEdit *edit;
- QPushButton *setting;
+ TQLineEdit *edit;
+ TQPushButton *setting;
bool hs, as;
};
@@ -83,26 +83,26 @@ class GWidgetList : public QWidget
Q_OBJECT
public:
- GWidgetList(uint interval, QWidget *parent = 0, const char * name = 0);
+ GWidgetList(uint interval, TQWidget *parent = 0, const char * name = 0);
void remove(uint i);
uint size() const { return widgets.count(); }
protected:
/** The widget must be created with this widget as parent. */
- void append(QWidget *);
- QWidget *widget(uint i) { return widgets.at(i); }
+ void append(TQWidget *);
+ TQWidget *widget(uint i) { return widgets.at(i); }
private:
- QPtrList<QWidget> widgets;
- QVBoxLayout vbl;
+ TQPtrList<TQWidget> widgets;
+ TQVBoxLayout vbl;
};
template <class Type>
class WidgetList : public GWidgetList
{
public:
- WidgetList(uint interval, QWidget *parent=0, const char *name=0)
+ WidgetList(uint interval, TQWidget *parent=0, const char *name=0)
: GWidgetList(interval, parent, name) {}
void append(Type *w) { GWidgetList::append(w); }
diff --git a/libksirtet/lib/smanager.h b/libksirtet/lib/smanager.h
index a831b702..59dd0edb 100644
--- a/libksirtet/lib/smanager.h
+++ b/libksirtet/lib/smanager.h
@@ -75,7 +75,7 @@ class SocketManager
bool dataPending(uint i);
private:
- QMemArray<Socket *> sockets;
+ TQMemArray<Socket *> sockets;
fd_set read_set, write_set, read_tmp, write_tmp;
struct timeval tv;
diff --git a/libksirtet/lib/socket.cpp b/libksirtet/lib/socket.cpp
index 9ef3ba3c..6defc94b 100644
--- a/libksirtet/lib/socket.cpp
+++ b/libksirtet/lib/socket.cpp
@@ -21,12 +21,12 @@
#endif
Socket::Socket(KExtendedSocket *s, bool createNotifier,
- QObject *parent, const char *name)
+ TQObject *parent, const char *name)
: _socket(s), _notifier(0)
{
Q_ASSERT(s);
if (createNotifier) {
- _notifier = new QSocketNotifier(s->fd(), QSocketNotifier::Read,
+ _notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read,
parent, name);
_notifier->setEnabled(FALSE);
}
@@ -38,7 +38,7 @@ Socket::~Socket()
delete _socket;
}
-bool Socket::write(const QByteArray &a)
+bool Socket::write(const TQByteArray &a)
{
return ( _socket->writeBlock(a.data(), a.size())==(int)a.size() );
}
diff --git a/libksirtet/lib/socket.h b/libksirtet/lib/socket.h
index a2f47a63..01dac726 100644
--- a/libksirtet/lib/socket.h
+++ b/libksirtet/lib/socket.h
@@ -1,7 +1,7 @@
#ifndef SOCKET_H
#define SOCKET_H
-#include <qsocketnotifier.h>
+#include <tqsocketnotifier.h>
#include <kextsock.h>
@@ -12,7 +12,7 @@ class Socket
{
public:
Socket(KExtendedSocket *, bool createNotifier = FALSE,
- QObject *parent = 0, const char *name = 0);
+ TQObject *parent = 0, const char *name = 0);
/** close the socket */
~Socket();
@@ -28,7 +28,7 @@ class Socket
* @return the socket notifier associated with the socket
* (0 if none).
*/
- QSocketNotifier *notifier() const { return _notifier; }
+ TQSocketNotifier *notifier() const { return _notifier; }
/**
* Write data contained in the writing stream to the socket.
@@ -36,9 +36,9 @@ class Socket
* @return TRUE if all was written without error.
*/
bool write();
- bool write(const QByteArray &a);
+ bool write(const TQByteArray &a);
- /** @return the QDataStream for writing. */
+ /** @return the TQDataStream for writing. */
WritingStream &writingStream() { return writing; }
/** @return the size of pending data. */
@@ -56,7 +56,7 @@ class Socket
private:
KExtendedSocket *_socket;
- QSocketNotifier *_notifier;
+ TQSocketNotifier *_notifier;
WritingStream writing;
ReadingStream reading;
diff --git a/libksirtet/lib/types.cpp b/libksirtet/lib/types.cpp
index 557fffff..ad3dbc9b 100644
--- a/libksirtet/lib/types.cpp
+++ b/libksirtet/lib/types.cpp
@@ -3,7 +3,7 @@
#include <klocale.h>
#include "version.h"
-cId::cId(const QString &_gameName, const QString &_gameId)
+cId::cId(const TQString &_gameName, const TQString &_gameId)
: libId(MULTI_ID), gameName(_gameName), gameId(_gameId)
{}
@@ -15,12 +15,12 @@ void cId::check(const cId &id)
else state = Accepted;
}
-QString cId::errorMessage(const cId &id) const
+TQString cId::errorMessage(const cId &id) const
{
- QString str = i18n("\nServer: \"%1\"\nClient: \"%2\"");
+ TQString str = i18n("\nServer: \"%1\"\nClient: \"%2\"");
switch (state) {
- case Accepted: return QString::null;
+ case Accepted: return TQString::null;
case LibIdClash:
return i18n("The MultiPlayer library of the server is incompatible")
+ str.arg(libId).arg(id.libId);
@@ -32,16 +32,16 @@ QString cId::errorMessage(const cId &id) const
+ str.arg(gameId).arg(id.gameId);
}
Q_ASSERT(0);
- return QString::null;
+ return TQString::null;
}
-QDataStream &operator << (QDataStream &s, const cId &id)
+TQDataStream &operator << (TQDataStream &s, const cId &id)
{
s << id.libId << id.gameName << id.gameId << (Q_UINT8)id.state;
return s;
}
-QDataStream &operator >> (QDataStream &s, cId &id)
+TQDataStream &operator >> (TQDataStream &s, cId &id)
{
Q_UINT8 state;
s >> id.libId >> id.gameName >> id.gameId >> state;
@@ -50,13 +50,13 @@ QDataStream &operator >> (QDataStream &s, cId &id)
}
//-----------------------------------------------------------------------------
-QDataStream &operator << (QDataStream &s, const MeetingMsgFlag &f)
+TQDataStream &operator << (TQDataStream &s, const MeetingMsgFlag &f)
{
s << (Q_UINT8)f;
return s;
}
-QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f)
+TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f)
{
Q_UINT8 i;
s >> i; f = (MeetingMsgFlag)i;
@@ -64,13 +64,13 @@ QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f)
}
//-----------------------------------------------------------------------------
-QDataStream &operator << (QDataStream &s, const TextInfo &ti)
+TQDataStream &operator << (TQDataStream &s, const TextInfo &ti)
{
s << (Q_UINT32)ti.i << ti.text;
return s;
}
-QDataStream &operator >> (QDataStream &s, TextInfo &ti)
+TQDataStream &operator >> (TQDataStream &s, TextInfo &ti)
{
Q_UINT32 i;
s >> i >> ti.text; ti.i = i;
@@ -78,13 +78,13 @@ QDataStream &operator >> (QDataStream &s, TextInfo &ti)
}
//-----------------------------------------------------------------------------
-QDataStream &operator << (QDataStream &s, const MeetingCheckBox::Type &t)
+TQDataStream &operator << (TQDataStream &s, const MeetingCheckBox::Type &t)
{
s << (Q_UINT8)t;
return s;
}
-QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t)
+TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t)
{
Q_UINT8 i;
s >> i; t = (MeetingCheckBox::Type)i;
@@ -92,13 +92,13 @@ QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t)
}
//-----------------------------------------------------------------------------
-QDataStream &operator << (QDataStream &s, const TypeInfo &ti)
+TQDataStream &operator << (TQDataStream &s, const TypeInfo &ti)
{
s << (Q_UINT32)ti.i << ti.type;
return s;
}
-QDataStream &operator >> (QDataStream &s, TypeInfo &ti)
+TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti)
{
Q_UINT32 i;
s >> i >> ti.type; ti.i = i;
@@ -106,13 +106,13 @@ QDataStream &operator >> (QDataStream &s, TypeInfo &ti)
}
//-----------------------------------------------------------------------------
-QDataStream &operator << (QDataStream &s, const BoardData &bd)
+TQDataStream &operator << (TQDataStream &s, const BoardData &bd)
{
s << (Q_UINT8)bd.type << bd.name;
return s;
}
-QDataStream &operator >> (QDataStream &s, BoardData &bd)
+TQDataStream &operator >> (TQDataStream &s, BoardData &bd)
{
Q_UINT8 i;
s >> i >> bd.name;
@@ -121,26 +121,26 @@ QDataStream &operator >> (QDataStream &s, BoardData &bd)
}
//-----------------------------------------------------------------------------
-QDataStream &operator << (QDataStream &s, const ExtData &ed)
+TQDataStream &operator << (TQDataStream &s, const ExtData &ed)
{
s << ed.bds << ed.text << ed.type;
return s;
}
-QDataStream &operator >> (QDataStream &s, ExtData &ed)
+TQDataStream &operator >> (TQDataStream &s, ExtData &ed)
{
s >> ed.bds >> ed.text >> ed.type;
return s;
}
//-----------------------------------------------------------------------------
-QDataStream &operator << (QDataStream &s, const MeetingLineData &pld)
+TQDataStream &operator << (TQDataStream &s, const MeetingLineData &pld)
{
s << pld.ed << (Q_UINT8)pld.own;
return s;
}
-QDataStream &operator >> (QDataStream &s, MeetingLineData &pld)
+TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld)
{
Q_UINT8 b;
s >> pld.ed >> b; pld.own = b;
@@ -148,13 +148,13 @@ QDataStream &operator >> (QDataStream &s, MeetingLineData &pld)
}
//-----------------------------------------------------------------------------
-QDataStream &operator << (QDataStream &s, const MetaFlag &f)
+TQDataStream &operator << (TQDataStream &s, const MetaFlag &f)
{
s << (Q_UINT8)f;
return s;
}
-QDataStream &operator >> (QDataStream &s, MetaFlag &f)
+TQDataStream &operator >> (TQDataStream &s, MetaFlag &f)
{
Q_UINT8 i;
s >> i; f = (MetaFlag)i;
@@ -177,7 +177,7 @@ void Stream::clear()
buf.open(mode | IO_Truncate);
}
-void Stream::setArray(QByteArray a)
+void Stream::setArray(TQByteArray a)
{
buf.close();
buf.setBuffer(a);
@@ -194,7 +194,7 @@ void ReadingStream::clearRead()
int i = buf.at();
if ( i==0 ) return;
buf.close();
- QByteArray a;
+ TQByteArray a;
a.duplicate(buffer().data() + i, size() - i);
buf.setBuffer(a);
buf.open(IO_ReadOnly);
@@ -205,7 +205,7 @@ void IOBuffer::writingToReading()
{
// this should do the trick :)
reading.setArray(writing.buffer());
- QByteArray a;
+ TQByteArray a;
writing.setArray(a);
}
@@ -228,7 +228,7 @@ void BufferArray::resize(uint nb)
for (uint i=s; i<nb; i++) a[i] = new IOBuffer;
}
-QDataStream &operator <<(QDataStream &s, const BufferArray &b)
+TQDataStream &operator <<(TQDataStream &s, const BufferArray &b)
{
for (uint i=0; i<b.size(); i++) {
s.writeBytes(b[i]->writing.buffer().data(), b[i]->writing.size());
@@ -238,13 +238,13 @@ QDataStream &operator <<(QDataStream &s, const BufferArray &b)
return s;
}
-QDataStream &operator >>(QDataStream &s, BufferArray &b)
+TQDataStream &operator >>(TQDataStream &s, BufferArray &b)
{
uint size;
char *c;
for (uint i=0; i<b.size(); i++) {
s.readBytes(c, size);
- QByteArray a;
+ TQByteArray a;
a.assign(c, size);
b[i]->reading.setArray(a);
// debug("BUFFERARRAY : >> (i=%i c=%i size=%i s=%i)",
diff --git a/libksirtet/lib/types.h b/libksirtet/lib/types.h
index 2ccdcba0..ee5867fa 100644
--- a/libksirtet/lib/types.h
+++ b/libksirtet/lib/types.h
@@ -1,9 +1,9 @@
#ifndef MTYPES_H
#define MTYPES_H
-#include <qstring.h>
-#include <qbuffer.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqbuffer.h>
+#include <tqvaluelist.h>
#include "miscui.h"
@@ -13,28 +13,28 @@ class cId
{
public:
cId() {}
- cId(const QString &gameName, const QString &gameId);
+ cId(const TQString &gameName, const TQString &gameId);
enum State { Accepted, LibIdClash, GameNameClash, GameIdClash };
void check(const cId &id);
bool accepted() const { return state==Accepted; }
- QString errorMessage(const cId &id) const;
+ TQString errorMessage(const cId &id) const;
- friend QDataStream &operator << (QDataStream &s, const cId &id);
- friend QDataStream &operator >> (QDataStream &s, cId &id);
+ friend TQDataStream &operator << (TQDataStream &s, const cId &id);
+ friend TQDataStream &operator >> (TQDataStream &s, cId &id);
private:
- QString libId, gameName, gameId;
+ TQString libId, gameName, gameId;
State state;
};
-QDataStream &operator << (QDataStream &s, const cId &id);
-QDataStream &operator >> (QDataStream &s, cId &id);
+TQDataStream &operator << (TQDataStream &s, const cId &id);
+TQDataStream &operator >> (TQDataStream &s, cId &id);
/** Flags used for the netmeeting. */
enum MeetingMsgFlag
{ IdFlag = 0, EndFlag, NewFlag, DelFlag, Mod_TextFlag, Mod_TypeFlag, Mod_OptFlag, PlayFlag };
-QDataStream &operator << (QDataStream &s, const MeetingMsgFlag &f);
-QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f);
+TQDataStream &operator << (TQDataStream &s, const MeetingMsgFlag &f);
+TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f);
/** Internal class : used in netmeeting to transport text line. */
class TextInfo
@@ -43,20 +43,20 @@ class TextInfo
TextInfo() {}
uint i;
- QString text;
+ TQString text;
};
-QDataStream &operator << (QDataStream &s, const TextInfo &ti);
-QDataStream &operator >> (QDataStream &s, TextInfo &ti);
+TQDataStream &operator << (TQDataStream &s, const TextInfo &ti);
+TQDataStream &operator >> (TQDataStream &s, TextInfo &ti);
/** Internal class : used in netmeeting to transport readiness status. */
typedef struct {
uint i;
MeetingCheckBox::Type type;
} TypeInfo;
-QDataStream &operator << (QDataStream &s, const MeetingCheckBox::Type &t);
-QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t);
-QDataStream &operator << (QDataStream &s, const TypeInfo &ti);
-QDataStream &operator >> (QDataStream &s, TypeInfo &ti);
+TQDataStream &operator << (TQDataStream &s, const MeetingCheckBox::Type &t);
+TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t);
+TQDataStream &operator << (TQDataStream &s, const TypeInfo &ti);
+TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti);
/* Internal class : store game data. */
class BoardData
@@ -64,27 +64,27 @@ class BoardData
public:
BoardData() {}
- QString name;
+ TQString name;
PlayerComboBox::Type type;
};
-QDataStream &operator <<(QDataStream &, const BoardData &);
-QDataStream &operator >>(QDataStream &, BoardData &);
+TQDataStream &operator <<(TQDataStream &, const BoardData &);
+TQDataStream &operator >>(TQDataStream &, BoardData &);
/* Internal class : store extended game data (used in netmeeting). */
class ExtData
{
public:
ExtData() {}
- ExtData(const QValueList<BoardData> &_bds, const QString &_text,
+ ExtData(const TQValueList<BoardData> &_bds, const TQString &_text,
MeetingCheckBox::Type _type)
: bds(_bds), text(_text), type(_type) {}
- QValueList<BoardData> bds;
- QString text;
+ TQValueList<BoardData> bds;
+ TQString text;
MeetingCheckBox::Type type;
};
-QDataStream &operator << (QDataStream &s, const ExtData &ed);
-QDataStream &operator >> (QDataStream &s, ExtData &ed);
+TQDataStream &operator << (TQDataStream &s, const ExtData &ed);
+TQDataStream &operator >> (TQDataStream &s, ExtData &ed);
/* Internal class : store meeting line data (in netmeeting). */
class MeetingLineData
@@ -95,8 +95,8 @@ class MeetingLineData
ExtData ed;
bool own;
};
-QDataStream &operator << (QDataStream &s, const MeetingLineData &pld);
-QDataStream &operator >> (QDataStream &s, MeetingLineData &pld);
+TQDataStream &operator << (TQDataStream &s, const MeetingLineData &pld);
+TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld);
/* Internal class : store remote host data. */
class Socket;
@@ -107,7 +107,7 @@ class RemoteHostData
RemoteHostData() : socket(0) {}
Socket *socket;
- QValueList<BoardData> bds;
+ TQValueList<BoardData> bds;
};
/* Internal class : store connection data (used by config. wizard). */
@@ -122,36 +122,36 @@ class ConnectionData
/** Flags used for network communication. */
enum MetaFlag { MF_Ask = 0, MF_Data };
-QDataStream &operator << (QDataStream &s, const MetaFlag &f);
-QDataStream &operator >> (QDataStream &s, MetaFlag &f);
+TQDataStream &operator << (TQDataStream &s, const MetaFlag &f);
+TQDataStream &operator >> (TQDataStream &s, MetaFlag &f);
-/** Internal class : encapsulate read/write QBuffer. */
+/** Internal class : encapsulate read/write TQBuffer. */
class Stream : public QDataStream
{
public:
Stream(int mode);
void clear();
- void setArray(QByteArray a);
+ void setArray(TQByteArray a);
- QByteArray buffer() const { return buf.buffer(); }
+ TQByteArray buffer() const { return buf.buffer(); }
uint size() const { return buf.buffer().size(); }
protected:
- QBuffer buf;
+ TQBuffer buf;
private:
int mode;
};
-/** Internal class : encapsulate write QBuffer. */
+/** Internal class : encapsulate write TQBuffer. */
class WritingStream : public Stream
{
public:
WritingStream() : Stream(IO_WriteOnly) {}
};
-/** Internal class : encapsulate read QBuffer. */
+/** Internal class : encapsulate read TQBuffer. */
class ReadingStream : public Stream
{
public:
@@ -187,11 +187,11 @@ class BufferArray
IOBuffer *operator [](uint i) const { return a[i]; }
private:
- QMemArray<IOBuffer *> a;
+ TQMemArray<IOBuffer *> a;
void clear(uint nb);
};
-QDataStream &operator <<(QDataStream &s, const BufferArray &b);
-QDataStream &operator >>(QDataStream &s, BufferArray &b);
+TQDataStream &operator <<(TQDataStream &s, const BufferArray &b);
+TQDataStream &operator >>(TQDataStream &s, BufferArray &b);
#endif // MTYPES_H
diff --git a/libksirtet/lib/wizard.cpp b/libksirtet/lib/wizard.cpp
index 30d5a89d..19d9de34 100644
--- a/libksirtet/lib/wizard.cpp
+++ b/libksirtet/lib/wizard.cpp
@@ -4,14 +4,14 @@
#include <sys/types.h>
#include <netinet/in.h>
-#include <qvbuttongroup.h>
-#include <qradiobutton.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qsignalmapper.h>
-#include <qvgroupbox.h>
-#include <qgrid.h>
-#include <qfile.h>
+#include <tqvbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqsignalmapper.h>
+#include <tqvgroupbox.h>
+#include <tqgrid.h>
+#include <tqfile.h>
#include <kapplication.h>
#include <klocale.h>
@@ -32,7 +32,7 @@
#define MAX_USER_PORT 65535
MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd,
- QWidget *parent, const char *name)
+ TQWidget *parent, const char *name)
: KWizard(parent, name, TRUE), cd(_cd)
{
// setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED
@@ -45,26 +45,26 @@ void MPWizard::setupTypePage()
{
KConfigGroupSaver cg(kapp->config(), MP_GROUP);
- typePage = new QVBox(this);
+ typePage = new TQVBox(this);
typePage->setMargin(KDialogBase::marginHint());
- QVButtonGroup *vbg = new QVButtonGroup(typePage);
- connect(vbg, SIGNAL(clicked(int)), SLOT(typeChanged(int)));
- QRadioButton *b;
- b = new QRadioButton(i18n("Create a local game"), vbg);
- b = new QRadioButton(i18n("Create a network game"), vbg);
- b = new QRadioButton(i18n("Join a network game"), vbg);
+ TQVButtonGroup *vbg = new TQVButtonGroup(typePage);
+ connect(vbg, TQT_SIGNAL(clicked(int)), TQT_SLOT(typeChanged(int)));
+ TQRadioButton *b;
+ b = new TQRadioButton(i18n("Create a local game"), vbg);
+ b = new TQRadioButton(i18n("Create a network game"), vbg);
+ b = new TQRadioButton(i18n("Join a network game"), vbg);
type = (Type)cg.config()->readNumEntry(MP_GAMETYPE, 0);
if ( type<0 || type>2 ) type = Local;
vbg->setButton(type);
typePage->setSpacing(KDialogBase::spacingHint());
- net = new QVGroupBox(i18n("Network Settings"), typePage);
- QGrid *grid = new QGrid(2, net);
- lserver = new QLabel(" ", grid);
+ net = new TQVGroupBox(i18n("Network Settings"), typePage);
+ TQGrid *grid = new TQGrid(2, net);
+ lserver = new TQLabel(" ", grid);
grid->setSpacing(KDialogBase::spacingHint());
- eserver = new QLineEdit(grid);
- (void)new QLabel(i18n("Port:"), grid);
+ eserver = new TQLineEdit(grid);
+ (void)new TQLabel(i18n("Port:"), grid);
int p = cg.config()->readNumEntry(MP_PORT, (uint)MIN_USER_PORT);
eport = new KIntNumInput(p, grid);
eport->setRange(MIN_USER_PORT, MAX_USER_PORT, 1, false);
@@ -77,51 +77,51 @@ void MPWizard::setupTypePage()
//-----------------------------------------------------------------------------
void MPWizard::setupLocalPage(const MPGameInfo &gi)
{
- localPage = new QVBox(this);
+ localPage = new TQVBox(this);
localPage->setMargin(KDialogBase::marginHint());
wl = new WidgetList<PlayerLine>(5, localPage);
- QSignalMapper *husm = new QSignalMapper(this);
- if (gi.humanSettingSlot) connect(husm, SIGNAL(mapped(int)),
+ TQSignalMapper *husm = new TQSignalMapper(this);
+ if (gi.humanSettingSlot) connect(husm, TQT_SIGNAL(mapped(int)),
gi.humanSettingSlot);
- QSignalMapper *aism = new QSignalMapper(this);
- if (gi.AISettingSlot) connect(aism, SIGNAL(mapped(int)), gi.AISettingSlot);
+ TQSignalMapper *aism = new TQSignalMapper(this);
+ if (gi.AISettingSlot) connect(aism, TQT_SIGNAL(mapped(int)), gi.AISettingSlot);
KConfigGroupSaver cg(kapp->config(), MP_GROUP);
- QString n;
+ TQString n;
PlayerComboBox::Type type;
PlayerLine *pl;
Q_ASSERT( gi.maxNbLocalPlayers>0 );
for (uint i=0; i<gi.maxNbLocalPlayers; i++) {
type = (PlayerComboBox::Type)
- cg.config()->readNumEntry(QString(MP_PLAYER_TYPE).arg(i),
+ cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).arg(i),
(i==0 ? PlayerComboBox::Human : PlayerComboBox::None));
- n = cg.config()->readEntry(QString(MP_PLAYER_NAME).arg(i),
+ n = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i),
i18n("Player #%1").arg(i));
pl = new PlayerLine(type, n, gi.humanSettingSlot, gi.AISettingSlot,
i!=0, gi.AIAllowed, wl);
- connect(pl, SIGNAL(typeChanged(int)), SLOT(lineTypeChanged(int)));
+ connect(pl, TQT_SIGNAL(typeChanged(int)), TQT_SLOT(lineTypeChanged(int)));
husm->setMapping(pl, i);
- connect(pl, SIGNAL(setHuman()), husm, SLOT(map()));
+ connect(pl, TQT_SIGNAL(setHuman()), husm, TQT_SLOT(map()));
aism->setMapping(pl, i);
- connect(pl, SIGNAL(setAI()), aism, SLOT(map()));
+ connect(pl, TQT_SIGNAL(setAI()), aism, TQT_SLOT(map()));
wl->append(pl);
}
- ((QVBox *)localPage)->setSpacing(KDialogBase::spacingHint());
+ ((TQVBox *)localPage)->setSpacing(KDialogBase::spacingHint());
-// keys = new QPushButton(i18n("Configure Keys..."), localPage);
-// connect(keys, SIGNAL(clicked()), SLOT(configureKeysSlot()));
+// keys = new TQPushButton(i18n("Configure Keys..."), localPage);
+// connect(keys, TQT_SIGNAL(clicked()), TQT_SLOT(configureKeysSlot()));
addPage(localPage, i18n("Local Player's Settings"));
setHelpEnabled(localPage, FALSE);
lineTypeChanged(0);
}
-QString MPWizard::name(uint i) const
+TQString MPWizard::name(uint i) const
{
- QString s = wl->widget(i)->name();
+ TQString s = wl->widget(i)->name();
if ( s.length()==0 ) s = i18n("Player #%1").arg(i);
return s;
}
@@ -130,7 +130,7 @@ void MPWizard::typeChanged(int t)
{
type = (Type)t;
- QString str;
+ TQString str;
if ( type!=Client ) {
str = "localhost";
lserver->setText(i18n("Hostname:"));
@@ -170,7 +170,7 @@ void MPWizard::accept()
int flags = KExtendedSocket::inetSocket
| KExtendedSocket::streamSocket;
if (cd.server) flags |= KExtendedSocket::passiveSocket;
- QString host = QFile::encodeName(eserver->text());
+ TQString host = TQFile::encodeName(eserver->text());
KExtendedSocket *socket
= new KExtendedSocket(host, eport->value(), flags);
@@ -206,15 +206,15 @@ void MPWizard::accept()
cg.config()->writeEntry(MP_GAMETYPE, (int)type);
for (uint i=0; i<wl->size(); i++) {
- cg.config()->writeEntry(QString(MP_PLAYER_TYPE).arg(i),
+ cg.config()->writeEntry(TQString(MP_PLAYER_TYPE).arg(i),
(int)wl->widget(i)->type());
- cg.config()->writeEntry(QString(MP_PLAYER_NAME).arg(i), name(i));
+ cg.config()->writeEntry(TQString(MP_PLAYER_NAME).arg(i), name(i));
}
KWizard::accept();
}
-void MPWizard::showPage(QWidget *page)
+void MPWizard::showPage(TQWidget *page)
{
if ( page==localPage ) setFinishEnabled(localPage, TRUE);
KWizard::showPage(page);
diff --git a/libksirtet/lib/wizard.h b/libksirtet/lib/wizard.h
index 29287508..fd90a3b8 100644
--- a/libksirtet/lib/wizard.h
+++ b/libksirtet/lib/wizard.h
@@ -1,11 +1,11 @@
#ifndef WIZARD_H
#define WIZARD_H
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qvbox.h>
-#include <qvgroupbox.h>
-#include <qpushbutton.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqvbox.h>
+#include <tqvgroupbox.h>
+#include <tqpushbutton.h>
#include <knuminput.h>
#include <kconfig.h>
@@ -22,9 +22,9 @@ class MPWizard : public KWizard
public:
MPWizard(const MPGameInfo &gi, ConnectionData &cd,
- QWidget *parent = 0, const char *name = 0);
+ TQWidget *parent = 0, const char *name = 0);
- void showPage(QWidget *page);
+ void showPage(TQWidget *page);
signals:
void configureKeys(uint);
@@ -41,17 +41,17 @@ class MPWizard : public KWizard
ConnectionData &cd;
enum Type { Local, Server, Client };
Type type;
- QVBox *typePage, *localPage;
+ TQVBox *typePage, *localPage;
WidgetList<PlayerLine> *wl;
- QLabel *lserver;
- QLineEdit *eserver;
+ TQLabel *lserver;
+ TQLineEdit *eserver;
KIntNumInput *eport;
- QVGroupBox *net;
-// QPushButton *keys;
+ TQVGroupBox *net;
+// TQPushButton *keys;
void setupTypePage();
void setupLocalPage(const MPGameInfo &gi);
- QString name(uint i) const;
+ TQString name(uint i) const;
};
#endif // WIZARD_H