summaryrefslogtreecommitdiffstats
path: root/kbackgammon/engines/nextgen/kbgng.cpp
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/engines/nextgen/kbgng.cpp
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/engines/nextgen/kbgng.cpp')
-rw-r--r--kbackgammon/engines/nextgen/kbgng.cpp78
1 files changed, 39 insertions, 39 deletions
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