summaryrefslogtreecommitdiffstats
path: root/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkdegames/kgame/dialogs/kgamedebugdialog.cpp')
-rw-r--r--libkdegames/kgame/dialogs/kgamedebugdialog.cpp218
1 files changed, 109 insertions, 109 deletions
diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
index b112b04c..09a35e56 100644
--- a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
+++ b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
@@ -32,11 +32,11 @@
#include <kpushbutton.h>
#include <kstdguiitem.h>
-#include <qlayout.h>
-#include <qstring.h>
-#include <qintdict.h>
-#include <qlabel.h>
-#include <qdatetime.h>
+#include <tqlayout.h>
+#include <tqstring.h>
+#include <tqintdict.h>
+#include <tqlabel.h>
+#include <tqdatetime.h>
#include <typeinfo>
@@ -85,42 +85,42 @@ public:
const KGame* mGame;
- QFrame* mGamePage;
+ TQFrame* mGamePage;
KListView* mGameProperties;
- QListViewItem* mGameAddress;
- QListViewItem* mGameId;
- QListViewItem* mGameCookie;
- QListViewItem* mGameMaster;
- QListViewItem* mGameAdmin;
- QListViewItem* mGameOffering;
- QListViewItem* mGameStatus;
- QListViewItem* mGameRunning;
- QListViewItem* mGameMaxPlayers;
- QListViewItem* mGameMinPlayers;
- QListViewItem* mGamePlayerCount;
+ TQListViewItem* mGameAddress;
+ TQListViewItem* mGameId;
+ TQListViewItem* mGameCookie;
+ TQListViewItem* mGameMaster;
+ TQListViewItem* mGameAdmin;
+ TQListViewItem* mGameOffering;
+ TQListViewItem* mGameStatus;
+ TQListViewItem* mGameRunning;
+ TQListViewItem* mGameMaxPlayers;
+ TQListViewItem* mGameMinPlayers;
+ TQListViewItem* mGamePlayerCount;
- QFrame* mPlayerPage;
+ TQFrame* mPlayerPage;
KListBox* mPlayerList;
KListView* mPlayerProperties;
- QListViewItem* mPlayerAddress;
- QListViewItem* mPlayerId;
- QListViewItem* mPlayerName;
- QListViewItem* mPlayerGroup;
- QListViewItem* mPlayerUserId;
- QListViewItem* mPlayerMyTurn;
- QListViewItem* mPlayerAsyncInput;
- QListViewItem* mPlayerKGameAddress;
- QListViewItem* mPlayerVirtual;
- QListViewItem* mPlayerActive;
- QListViewItem* mPlayerRtti;
- QListViewItem* mPlayerNetworkPriority;
-
- QFrame* mMessagePage;
+ TQListViewItem* mPlayerAddress;
+ TQListViewItem* mPlayerId;
+ TQListViewItem* mPlayerName;
+ TQListViewItem* mPlayerGroup;
+ TQListViewItem* mPlayerUserId;
+ TQListViewItem* mPlayerMyTurn;
+ TQListViewItem* mPlayerAsyncInput;
+ TQListViewItem* mPlayerKGameAddress;
+ TQListViewItem* mPlayerVirtual;
+ TQListViewItem* mPlayerActive;
+ TQListViewItem* mPlayerRtti;
+ TQListViewItem* mPlayerNetworkPriority;
+
+ TQFrame* mMessagePage;
KListView* mMessageList;
KListBox* mHideIdList;
};
-KGameDebugDialog::KGameDebugDialog(KGame* g, QWidget* parent, bool modal) :
+KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* parent, bool modal) :
KDialogBase(Tabbed, i18n("KGame Debug Dialog"), Close, Close,
parent, 0, modal, true)
{
@@ -141,8 +141,8 @@ KGameDebugDialog::~KGameDebugDialog()
void KGameDebugDialog::initGamePage()
{
d->mGamePage = addPage(i18n("Debug &KGame"));
- QVBoxLayout* topLayout = new QVBoxLayout(d->mGamePage, marginHint(), spacingHint());
- QHBoxLayout* layout = new QHBoxLayout(topLayout);
+ TQVBoxLayout* topLayout = new TQVBoxLayout(d->mGamePage, marginHint(), spacingHint());
+ TQHBoxLayout* layout = new TQHBoxLayout(topLayout);
KListView* v = new KListView(d->mGamePage);
v->addColumn(i18n("Data"));
@@ -155,38 +155,38 @@ void KGameDebugDialog::initGamePage()
d->mGameProperties->addColumn(i18n("Policy"));
layout->addWidget(d->mGameProperties);
- QPushButton* b = new QPushButton(i18n("Update"), d->mGamePage);
- connect(b, SIGNAL(pressed()), this, SLOT(slotUpdateGameData()));
+ TQPushButton* b = new TQPushButton(i18n("Update"), d->mGamePage);
+ connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdateGameData()));
topLayout->addWidget(b);
// game data
- d->mGameAddress = new QListViewItem(v, i18n("KGame Pointer"));
- d->mGameId = new QListViewItem(v, i18n("Game ID"));
- d->mGameCookie = new QListViewItem(v, i18n("Game Cookie"));
- d->mGameMaster = new QListViewItem(v, i18n("Is Master"));
- d->mGameAdmin = new QListViewItem(v, i18n("Is Admin"));
- d->mGameOffering = new QListViewItem(v, i18n("Is Offering Connections"));
- d->mGameStatus = new QListViewItem(v, i18n("Game Status"));
- d->mGameRunning = new QListViewItem(v, i18n("Game is Running"));
- d->mGameMaxPlayers = new QListViewItem(v, i18n("Maximal Players"));
- d->mGameMinPlayers = new QListViewItem(v, i18n("Minimal Players"));
- d->mGamePlayerCount = new QListViewItem(v, i18n("Players"));
+ d->mGameAddress = new TQListViewItem(v, i18n("KGame Pointer"));
+ d->mGameId = new TQListViewItem(v, i18n("Game ID"));
+ d->mGameCookie = new TQListViewItem(v, i18n("Game Cookie"));
+ d->mGameMaster = new TQListViewItem(v, i18n("Is Master"));
+ d->mGameAdmin = new TQListViewItem(v, i18n("Is Admin"));
+ d->mGameOffering = new TQListViewItem(v, i18n("Is Offering Connections"));
+ d->mGameStatus = new TQListViewItem(v, i18n("Game Status"));
+ d->mGameRunning = new TQListViewItem(v, i18n("Game is Running"));
+ d->mGameMaxPlayers = new TQListViewItem(v, i18n("Maximal Players"));
+ d->mGameMinPlayers = new TQListViewItem(v, i18n("Minimal Players"));
+ d->mGamePlayerCount = new TQListViewItem(v, i18n("Players"));
}
void KGameDebugDialog::initPlayerPage()
{
d->mPlayerPage = addPage(i18n("Debug &Players"));
- QVBoxLayout* topLayout = new QVBoxLayout(d->mPlayerPage, marginHint(), spacingHint());
- QHBoxLayout* layout = new QHBoxLayout(topLayout);
+ TQVBoxLayout* topLayout = new TQVBoxLayout(d->mPlayerPage, marginHint(), spacingHint());
+ TQHBoxLayout* layout = new TQHBoxLayout(topLayout);
//TODO: connect to the KGame signals for joined/removed players!!!
- QVBoxLayout* listLayout = new QVBoxLayout(layout);
- QLabel* listLabel = new QLabel(i18n("Available Players"), d->mPlayerPage);
+ TQVBoxLayout* listLayout = new TQVBoxLayout(layout);
+ TQLabel* listLabel = new TQLabel(i18n("Available Players"), d->mPlayerPage);
listLayout->addWidget(listLabel);
d->mPlayerList = new KListBox(d->mPlayerPage);
- connect(d->mPlayerList, SIGNAL(executed(QListBoxItem*)), this, SLOT(slotUpdatePlayerData(QListBoxItem*)));
+ connect(d->mPlayerList, TQT_SIGNAL(executed(TQListBoxItem*)), this, TQT_SLOT(slotUpdatePlayerData(TQListBoxItem*)));
listLayout->addWidget(d->mPlayerList);
- d->mPlayerList->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
+ d->mPlayerList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding));
KListView* v = new KListView(d->mPlayerPage);
layout->addWidget(v);
@@ -199,28 +199,28 @@ void KGameDebugDialog::initPlayerPage()
d->mPlayerProperties->addColumn(i18n("Policy"));
layout->addWidget(d->mPlayerProperties);
- QPushButton* b = new QPushButton(i18n("Update"), d->mPlayerPage);
- connect(b, SIGNAL(pressed()), this, SLOT(slotUpdatePlayerList()));
+ TQPushButton* b = new TQPushButton(i18n("Update"), d->mPlayerPage);
+ connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdatePlayerList()));
topLayout->addWidget(b);
- d->mPlayerAddress = new QListViewItem(v, i18n("Player Pointer"));
- d->mPlayerId = new QListViewItem(v, i18n("Player ID"));
- d->mPlayerName = new QListViewItem(v, i18n("Player Name"));
- d->mPlayerGroup = new QListViewItem(v, i18n("Player Group"));
- d->mPlayerUserId = new QListViewItem(v, i18n("Player User ID"));
- d->mPlayerMyTurn = new QListViewItem(v, i18n("My Turn"));
- d->mPlayerAsyncInput = new QListViewItem(v, i18n("Async Input"));
- d->mPlayerKGameAddress = new QListViewItem(v, i18n("KGame Address"));
- d->mPlayerVirtual = new QListViewItem(v, i18n("Player is Virtual"));
- d->mPlayerActive = new QListViewItem(v, i18n("Player is Active"));
- d->mPlayerRtti = new QListViewItem(v, i18n("RTTI"));
- d->mPlayerNetworkPriority = new QListViewItem(v, i18n("Network Priority"));
+ d->mPlayerAddress = new TQListViewItem(v, i18n("Player Pointer"));
+ d->mPlayerId = new TQListViewItem(v, i18n("Player ID"));
+ d->mPlayerName = new TQListViewItem(v, i18n("Player Name"));
+ d->mPlayerGroup = new TQListViewItem(v, i18n("Player Group"));
+ d->mPlayerUserId = new TQListViewItem(v, i18n("Player User ID"));
+ d->mPlayerMyTurn = new TQListViewItem(v, i18n("My Turn"));
+ d->mPlayerAsyncInput = new TQListViewItem(v, i18n("Async Input"));
+ d->mPlayerKGameAddress = new TQListViewItem(v, i18n("KGame Address"));
+ d->mPlayerVirtual = new TQListViewItem(v, i18n("Player is Virtual"));
+ d->mPlayerActive = new TQListViewItem(v, i18n("Player is Active"));
+ d->mPlayerRtti = new TQListViewItem(v, i18n("RTTI"));
+ d->mPlayerNetworkPriority = new TQListViewItem(v, i18n("Network Priority"));
}
void KGameDebugDialog::initMessagePage()
{
d->mMessagePage = addPage(i18n("Debug &Messages"));
- QGridLayout* layout = new QGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint());
+ TQGridLayout* layout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint());
d->mMessageList = new KListView(d->mMessagePage);
layout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3);
d->mMessageList->addColumn(i18n("Time"));
@@ -229,21 +229,21 @@ void KGameDebugDialog::initMessagePage()
d->mMessageList->addColumn(i18n("Sender"));
d->mMessageList->addColumn(i18n("ID - Text"));
- QPushButton* hide = new QPushButton(i18n("&>>"), d->mMessagePage);
- connect(hide, SIGNAL(pressed()), this, SLOT(slotHideId()));
+ TQPushButton* hide = new TQPushButton(i18n("&>>"), d->mMessagePage);
+ connect(hide, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotHideId()));
layout->addWidget(hide, 4, 4);
- QPushButton* show = new QPushButton(i18n("&<<"), d->mMessagePage);
- connect(show, SIGNAL(pressed()), this, SLOT(slotShowId()));
+ TQPushButton* show = new TQPushButton(i18n("&<<"), d->mMessagePage);
+ connect(show, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotShowId()));
layout->addWidget(show, 6, 4);
- QLabel* l = new QLabel(i18n("Do not show IDs:"), d->mMessagePage);
+ TQLabel* l = new TQLabel(i18n("Do not show IDs:"), d->mMessagePage);
layout->addMultiCellWidget(l, 0, 0, 5, 6);
d->mHideIdList = new KListBox(d->mMessagePage);
layout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6);
- QPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage);
- connect(clear, SIGNAL(pressed()), this, SLOT(slotClearMessages()));
+ TQPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage);
+ connect(clear, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearMessages()));
layout->addMultiCellWidget(clear, 10, 10, 0, 6);
//TODO: "show all but..." and "show nothing but..."
}
@@ -292,12 +292,12 @@ void KGameDebugDialog::slotUpdatePlayerData()
void KGameDebugDialog::slotUpdatePlayerList()
{
- QListBoxItem* i = d->mPlayerList->firstItem();
+ TQListBoxItem* i = d->mPlayerList->firstItem();
for (; i; i = d->mPlayerList->firstItem()) {
removePlayer(i);
}
- QPtrList<KPlayer> list = *d->mGame->playerList();
+ TQPtrList<KPlayer> list = *d->mGame->playerList();
for (KPlayer* p = list.first(); p; p = list.next()) {
addPlayer(p);
}
@@ -312,26 +312,26 @@ void KGameDebugDialog::slotUpdateGameData()
clearGameData();
- QString buf;
+ TQString buf;
buf.sprintf("%p", d->mGame);
d->mGameAddress->setText(1, buf);
- d->mGameId->setText(1, QString::number(d->mGame->gameId()));
- d->mGameCookie->setText(1, QString::number(d->mGame->cookie()));
+ d->mGameId->setText(1, TQString::number(d->mGame->gameId()));
+ d->mGameCookie->setText(1, TQString::number(d->mGame->cookie()));
d->mGameMaster->setText(1, d->mGame->isMaster() ? i18n("True") : i18n("False"));
d->mGameAdmin->setText(1, d->mGame->isAdmin() ? i18n("True") : i18n("False"));
d->mGameOffering->setText(1, d->mGame->isOfferingConnections() ? i18n("True") : i18n("False"));
- d->mGameStatus->setText(1, QString::number(d->mGame->gameStatus()));
+ d->mGameStatus->setText(1, TQString::number(d->mGame->gameStatus()));
d->mGameRunning->setText(1, d->mGame->isRunning() ? i18n("True") : i18n("False"));
- d->mGameMaxPlayers->setText(1, QString::number(d->mGame->maxPlayers()));
- d->mGameMinPlayers->setText(1, QString::number(d->mGame->minPlayers()));
- d->mGamePlayerCount->setText(1, QString::number(d->mGame->playerCount()));
+ d->mGameMaxPlayers->setText(1, TQString::number(d->mGame->maxPlayers()));
+ d->mGameMinPlayers->setText(1, TQString::number(d->mGame->minPlayers()));
+ d->mGamePlayerCount->setText(1, TQString::number(d->mGame->playerCount()));
//TODO ios
KGamePropertyHandler* handler = d->mGame->dataHandler();
- QIntDictIterator<KGamePropertyBase> it(handler->dict());
+ TQIntDictIterator<KGamePropertyBase> it(handler->dict());
while (it.current()) {
- QString policy;
+ TQString policy;
switch (it.current()->policy()) {
case KGamePropertyBase::PolicyClean:
policy = i18n("Clean");
@@ -347,7 +347,7 @@ void KGameDebugDialog::slotUpdateGameData()
policy = i18n("Undefined");
break;
}
- (void) new QListViewItem(d->mGameProperties,
+ (void) new TQListViewItem(d->mGameProperties,
handler->propertyName(it.current()->id()),
handler->propertyValue(it.current()),
policy);
@@ -356,7 +356,7 @@ void KGameDebugDialog::slotUpdateGameData()
}
}
-void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item)
+void KGameDebugDialog::slotUpdatePlayerData(TQListBoxItem* item)
{
if (!item || !d->mGame) {
return;
@@ -371,29 +371,29 @@ void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item)
clearPlayerData();
- QString buf;
+ TQString buf;
buf.sprintf("%p", p);
d->mPlayerAddress->setText(1, buf);
- d->mPlayerId->setText(1, QString::number(p->id()));
+ d->mPlayerId->setText(1, TQString::number(p->id()));
d->mPlayerName->setText(1, p->name());
d->mPlayerGroup->setText(1, p->group());
- d->mPlayerUserId->setText(1, QString::number(p->userId()));
+ d->mPlayerUserId->setText(1, TQString::number(p->userId()));
d->mPlayerMyTurn->setText(1, p->myTurn() ? i18n("True") : i18n("False"));
d->mPlayerAsyncInput->setText(1, p->asyncInput() ? i18n("True") : i18n("False"));
buf.sprintf("%p", p->game());
d->mPlayerKGameAddress->setText(1, buf);
d->mPlayerVirtual->setText(1, p->isVirtual() ? i18n("True") : i18n("False"));
d->mPlayerActive->setText(1, p->isActive() ? i18n("True") : i18n("False"));
- d->mPlayerRtti->setText(1, QString::number(p->rtti()));
- d->mPlayerNetworkPriority->setText(1, QString::number(p->networkPriority()));
+ d->mPlayerRtti->setText(1, TQString::number(p->rtti()));
+ d->mPlayerNetworkPriority->setText(1, TQString::number(p->networkPriority()));
//TODO ios
// Properties
KGamePropertyHandler * handler = p->dataHandler();
- QIntDictIterator<KGamePropertyBase> it((handler->dict()));
+ TQIntDictIterator<KGamePropertyBase> it((handler->dict()));
while (it.current()) {
- QString policy;
+ TQString policy;
switch (it.current()->policy()) {
case KGamePropertyBase::PolicyClean:
policy = i18n("Clean");
@@ -409,7 +409,7 @@ void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item)
policy = i18n("Undefined");
break;
}
- (void)new QListViewItem(d->mPlayerProperties,
+ (void)new TQListViewItem(d->mPlayerProperties,
handler->propertyName(it.current()->id()),
handler->propertyValue(it.current()),
policy);
@@ -431,17 +431,17 @@ void KGameDebugDialog::setKGame(const KGame* g)
d->mGame = g;
if (g) {
//TODO: connect to the KGame signals for joined/removed players!!!
- connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame()));
+ connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame()));
// connect();
- QPtrList<KPlayer> list = *d->mGame->playerList();
+ TQPtrList<KPlayer> list = *d->mGame->playerList();
for (KPlayer* p = list.first(); p; p = list.next()) {
addPlayer(p);
}
slotUpdateGameData();
- connect(d->mGame, SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32)));
+ connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32)));
}
}
@@ -461,11 +461,11 @@ void KGameDebugDialog::addPlayer(KPlayer* p)
return;
}
- (void) new QListBoxText(d->mPlayerList, QString::number(p->id()));
+ (void) new TQListBoxText(d->mPlayerList, TQString::number(p->id()));
//TODO connect to signals, like deleted/removed, ...
}
-void KGameDebugDialog::removePlayer(QListBoxItem* i)
+void KGameDebugDialog::removePlayer(TQListBoxItem* i)
{
if (!i || !d->mGame) {
return;
@@ -486,7 +486,7 @@ void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32
if (!showId(msgid)) {
return;
}
- QString msgidText = KGameMessage::messageId2Text(msgid);
+ TQString msgidText = KGameMessage::messageId2Text(msgid);
if (msgidText.isNull()) {
if (msgid > KGameMessage::IdUser) {
emit signalRequestIdName(msgid-KGameMessage::IdUser, true, msgidText);
@@ -497,9 +497,9 @@ void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32
msgidText = i18n("Unknown");
}
}
- (void) new QListViewItem( d->mMessageList, QTime::currentTime().toString(),
- QString::number(msgid), QString::number(receiver),
- QString::number(sender), msgidText);
+ (void) new TQListViewItem( d->mMessageList, TQTime::currentTime().toString(),
+ TQString::number(msgid), TQString::number(receiver),
+ TQString::number(sender), msgidText);
}
void KGameDebugDialog::slotClearMessages()
@@ -509,7 +509,7 @@ void KGameDebugDialog::slotClearMessages()
void KGameDebugDialog::slotShowId()
{
-/* QListBoxItem* i = d->mHideIdList->firstItem();
+/* TQListBoxItem* i = d->mHideIdList->firstItem();
for (; i; i = i->next()) {
if (i->selected()) {
d->mHideIdList->removeItem(i->);
@@ -530,12 +530,12 @@ void KGameDebugDialog::slotHideId()
if (!showId(msgid)) {
return;
}
- (void)new QListBoxText(d->mHideIdList, QString::number(msgid));
+ (void)new TQListBoxText(d->mHideIdList, TQString::number(msgid));
}
bool KGameDebugDialog::showId(int msgid)
{
- QListBoxItem* i = d->mHideIdList->firstItem();
+ TQListBoxItem* i = d->mHideIdList->firstItem();
for (; i; i = i->next()) {
if (i->text().toInt() == msgid) {
return false;