diff options
Diffstat (limited to 'libksirtet/lib/mp_interface.cpp')
-rw-r--r-- | libksirtet/lib/mp_interface.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
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); } |