diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /libkdegames/kgame/dialogs | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip |
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdegames/kgame/dialogs')
-rw-r--r-- | libkdegames/kgame/dialogs/kgameconnectdialog.cpp | 14 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgameconnectdialog.h | 22 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgamedebugdialog.cpp | 48 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgamedebugdialog.h | 7 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgamedialog.cpp | 34 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgamedialog.h | 25 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgamedialogconfig.cpp | 40 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgamedialogconfig.h | 32 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgameerrordialog.cpp | 30 | ||||
-rw-r--r-- | libkdegames/kgame/dialogs/kgameerrordialog.h | 16 |
10 files changed, 140 insertions, 128 deletions
diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp index 575b3090..f0e0c606 100644 --- a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp +++ b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp @@ -56,7 +56,7 @@ class KGameConnectWidgetPrivate TQString mType; }; -KGameConnectWidget::KGameConnectWidget(TQWidget* parent) : TQWidget(parent) +KGameConnectWidget::KGameConnectWidget(TQWidget* tqparent) : TQWidget(tqparent) { d = new KGameConnectWidgetPrivate; @@ -165,7 +165,7 @@ TQString KGameConnectWidget::host() const if (d->mHost->isEnabled()) { return d->mHost->text(); } else { - return TQString::null; + return TQString(); } } @@ -212,9 +212,9 @@ class KGameConnectDialogPrivate KGameConnectWidget* mConnect; }; -// buttonmask =Ok|Cancel -KGameConnectDialog::KGameConnectDialog(TQWidget* parent,int buttonmask) : KDialogBase(Plain, - i18n("Network Game"),buttonmask , Ok, parent, 0, true, buttonmask!=0) +// buttontqmask =Ok|Cancel +KGameConnectDialog::KGameConnectDialog(TQWidget* tqparent,int buttontqmask) : KDialogBase(Plain, + i18n("Network Game"),buttontqmask , Ok, tqparent, 0, true, buttontqmask!=0) { d = new KGameConnectDialogPrivate; TQVBoxLayout* vb = new TQVBoxLayout(plainPage(), spacingHint()); @@ -228,9 +228,9 @@ KGameConnectDialog::~KGameConnectDialog() } int KGameConnectDialog::initConnection( unsigned short int& port, - TQString& host, TQWidget* parent, bool server) + TQString& host, TQWidget* tqparent, bool server) { - KGameConnectDialog d(parent); + KGameConnectDialog d(tqparent); d.setHost(host); d.setPort(port); if (server) { diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.h b/libkdegames/kgame/dialogs/kgameconnectdialog.h index fdb0be4f..ad4ff7d1 100644 --- a/libkdegames/kgame/dialogs/kgameconnectdialog.h +++ b/libkdegames/kgame/dialogs/kgameconnectdialog.h @@ -26,11 +26,12 @@ class KGameConnectDialogPrivate; class KGameConnectWidgetPrivate; -class KGameConnectWidget : public QWidget +class KGameConnectWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KGameConnectWidget(TQWidget* parent); + KGameConnectWidget(TQWidget* tqparent); virtual ~KGameConnectWidget(); /** @@ -39,7 +40,7 @@ public: void setHost(const TQString& host); /** - * @return The host to connect to or TQString::null if the user wants to + * @return The host to connect to or TQString() if the user wants to * be the MASTER **/ TQString host() const; @@ -108,16 +109,17 @@ private: * @short Dialog to ask for host and port * * This Dialog is used to create a game. You call initConnection(port, - * TQString::null, parent, true) to create a network game (as a server) - * or initConnection(port, host, parent) to join a network game. + * TQString(), tqparent, true) to create a network game (as a server) + * or initConnection(port, host, tqparent) to join a network game. * * @author Andreas Beckermann <[email protected]> **/ class KGameConnectDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KGameConnectDialog(TQWidget* parent = 0,int buttonmask=Ok|Cancel); + KGameConnectDialog(TQWidget* tqparent = 0,int buttontqmask=Ok|Cancel); virtual ~KGameConnectDialog(); /** @@ -125,12 +127,12 @@ public: * server game, depending on user's choice. * @param port The port the user wants to connect to. * @param host The host the user wants to connect to. Will be - * TQString::null if server game is chosen - * @param parent The parent of the dialog + * TQString() if server game is chosen + * @param tqparent The tqparent of the dialog * @param server True to create a network game per default, false to * join a game by default **/ - static int initConnection(unsigned short int& port, TQString& host, TQWidget* parent, bool server = false); + static int initConnection(unsigned short int& port, TQString& host, TQWidget* tqparent, bool server = false); /** * @param host The host to connect to by default @@ -138,7 +140,7 @@ public: void setHost(const TQString& host); /** - * @return The host to connect to or TQString::null if the user wants to + * @return The host to connect to or TQString() if the user wants to * be the MASTER **/ TQString host() const; diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp index 09a35e56..06987aad 100644 --- a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp +++ b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp @@ -56,7 +56,7 @@ public: mGameMaster = 0; mGameAdmin = 0; mGameOffering = 0; - mGameStatus = 0; + mGametqStatus = 0; mGameRunning = 0; mGameMaxPlayers = 0; mGameMinPlayers = 0; @@ -93,7 +93,7 @@ public: TQListViewItem* mGameMaster; TQListViewItem* mGameAdmin; TQListViewItem* mGameOffering; - TQListViewItem* mGameStatus; + TQListViewItem* mGametqStatus; TQListViewItem* mGameRunning; TQListViewItem* mGameMaxPlayers; TQListViewItem* mGameMinPlayers; @@ -120,9 +120,9 @@ public: KListBox* mHideIdList; }; -KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* parent, bool modal) : +KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* tqparent, bool modal) : KDialogBase(Tabbed, i18n("KGame Debug Dialog"), Close, Close, - parent, 0, modal, true) + tqparent, 0, modal, true) { d = new KGameDebugDialogPrivate; @@ -142,18 +142,18 @@ void KGameDebugDialog::initGamePage() { d->mGamePage = addPage(i18n("Debug &KGame")); TQVBoxLayout* topLayout = new TQVBoxLayout(d->mGamePage, marginHint(), spacingHint()); - TQHBoxLayout* layout = new TQHBoxLayout(topLayout); + TQHBoxLayout* tqlayout = new TQHBoxLayout(topLayout); KListView* v = new KListView(d->mGamePage); v->addColumn(i18n("Data")); v->addColumn(i18n("Value")); - layout->addWidget(v); + tqlayout->addWidget(v); d->mGameProperties = new KListView(d->mGamePage); d->mGameProperties->addColumn(i18n("Property")); d->mGameProperties->addColumn(i18n("Value")); d->mGameProperties->addColumn(i18n("Policy")); - layout->addWidget(d->mGameProperties); + tqlayout->addWidget(d->mGameProperties); TQPushButton* b = new TQPushButton(i18n("Update"), d->mGamePage); connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdateGameData())); @@ -166,7 +166,7 @@ void KGameDebugDialog::initGamePage() 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->mGametqStatus = new TQListViewItem(v, i18n("Game tqStatus")); 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")); @@ -177,19 +177,19 @@ void KGameDebugDialog::initPlayerPage() { d->mPlayerPage = addPage(i18n("Debug &Players")); TQVBoxLayout* topLayout = new TQVBoxLayout(d->mPlayerPage, marginHint(), spacingHint()); - TQHBoxLayout* layout = new TQHBoxLayout(topLayout); + TQHBoxLayout* tqlayout = new TQHBoxLayout(topLayout); //TODO: connect to the KGame signals for joined/removed players!!! - TQVBoxLayout* listLayout = new TQVBoxLayout(layout); + TQVBoxLayout* listLayout = new TQVBoxLayout(tqlayout); TQLabel* listLabel = new TQLabel(i18n("Available Players"), d->mPlayerPage); listLayout->addWidget(listLabel); d->mPlayerList = new KListBox(d->mPlayerPage); connect(d->mPlayerList, TQT_SIGNAL(executed(TQListBoxItem*)), this, TQT_SLOT(slotUpdatePlayerData(TQListBoxItem*))); listLayout->addWidget(d->mPlayerList); - d->mPlayerList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); + d->mPlayerList->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); KListView* v = new KListView(d->mPlayerPage); - layout->addWidget(v); + tqlayout->addWidget(v); v->addColumn(i18n("Data")); v->addColumn(i18n("Value")); @@ -197,7 +197,7 @@ void KGameDebugDialog::initPlayerPage() d->mPlayerProperties->addColumn(i18n("Property")); d->mPlayerProperties->addColumn(i18n("Value")); d->mPlayerProperties->addColumn(i18n("Policy")); - layout->addWidget(d->mPlayerProperties); + tqlayout->addWidget(d->mPlayerProperties); TQPushButton* b = new TQPushButton(i18n("Update"), d->mPlayerPage); connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdatePlayerList())); @@ -220,9 +220,9 @@ void KGameDebugDialog::initPlayerPage() void KGameDebugDialog::initMessagePage() { d->mMessagePage = addPage(i18n("Debug &Messages")); - TQGridLayout* layout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint()); + TQGridLayout* tqlayout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint()); d->mMessageList = new KListView(d->mMessagePage); - layout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3); + tqlayout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3); d->mMessageList->addColumn(i18n("Time")); d->mMessageList->addColumn(i18n("ID")); d->mMessageList->addColumn(i18n("Receiver")); @@ -231,20 +231,20 @@ void KGameDebugDialog::initMessagePage() TQPushButton* hide = new TQPushButton(i18n("&>>"), d->mMessagePage); connect(hide, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotHideId())); - layout->addWidget(hide, 4, 4); + tqlayout->addWidget(hide, 4, 4); TQPushButton* show = new TQPushButton(i18n("&<<"), d->mMessagePage); connect(show, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotShowId())); - layout->addWidget(show, 6, 4); + tqlayout->addWidget(show, 6, 4); TQLabel* l = new TQLabel(i18n("Do not show IDs:"), d->mMessagePage); - layout->addMultiCellWidget(l, 0, 0, 5, 6); + tqlayout->addMultiCellWidget(l, 0, 0, 5, 6); d->mHideIdList = new KListBox(d->mMessagePage); - layout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6); + tqlayout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6); TQPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage); connect(clear, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearMessages())); - layout->addMultiCellWidget(clear, 10, 10, 0, 6); + tqlayout->addMultiCellWidget(clear, 10, 10, 0, 6); //TODO: "show all but..." and "show nothing but..." } @@ -274,7 +274,7 @@ void KGameDebugDialog::clearGameData() d->mGameMaster->setText(1, ""); d->mGameAdmin->setText(1, ""); d->mGameOffering->setText(1, ""); - d->mGameStatus->setText(1, ""); + d->mGametqStatus->setText(1, ""); d->mGameRunning->setText(1, ""); d->mGameMaxPlayers->setText(1, ""); d->mGameMinPlayers->setText(1, ""); @@ -320,7 +320,7 @@ void KGameDebugDialog::slotUpdateGameData() 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, TQString::number(d->mGame->gameStatus())); + d->mGametqStatus->setText(1, TQString::number(d->mGame->gametqStatus())); d->mGameRunning->setText(1, d->mGame->isRunning() ? i18n("True") : i18n("False")); d->mGameMaxPlayers->setText(1, TQString::number(d->mGame->maxPlayers())); d->mGameMinPlayers->setText(1, TQString::number(d->mGame->minPlayers())); @@ -441,7 +441,7 @@ void KGameDebugDialog::setKGame(const KGame* g) slotUpdateGameData(); - connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32))); + connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, TQ_UINT32, TQ_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, TQ_UINT32, TQ_UINT32))); } } @@ -481,7 +481,7 @@ void KGameDebugDialog::removePlayer(TQListBoxItem* i) delete i; } -void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32 sender) +void KGameDebugDialog::slotMessageUpdate(int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { if (!showId(msgid)) { return; diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.h b/libkdegames/kgame/dialogs/kgamedebugdialog.h index 57f20c34..924037ff 100644 --- a/libkdegames/kgame/dialogs/kgamedebugdialog.h +++ b/libkdegames/kgame/dialogs/kgamedebugdialog.h @@ -34,8 +34,9 @@ class KGameDebugDialogPrivate; class KDE_EXPORT KGameDebugDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KGameDebugDialog(KGame* g, TQWidget* parent, bool modal = false); + KGameDebugDialog(KGame* g, TQWidget* tqparent, bool modal = false); ~KGameDebugDialog(); /** @@ -77,7 +78,7 @@ public slots: signals: /** - * This signal is emitted when the "debug messages" page couldn't find + * This signal is emitted when the "debug messages" page couldn't tqfind * the name of a message id. This is usually the case for user-defined * messages. KGameDebugDialog asks you to give the msgid a name. * @param messageid The ID of the message. As given to @ref @@ -134,7 +135,7 @@ protected slots: /** * A message has been received - see @ref KGame::signalMessageUpdate **/ - void slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32 sender); + void slotMessageUpdate(int msgid, TQ_UINT32 receiver, TQ_UINT32 sender); private: void initGamePage(); diff --git a/libkdegames/kgame/dialogs/kgamedialog.cpp b/libkdegames/kgame/dialogs/kgamedialog.cpp index c03df4ff..f589333e 100644 --- a/libkdegames/kgame/dialogs/kgamedialog.cpp +++ b/libkdegames/kgame/dialogs/kgamedialog.cpp @@ -64,17 +64,17 @@ public: }; KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title, - TQWidget* parent, bool modal) + TQWidget* tqparent, bool modal) : KDialogBase(Tabbed, title, Ok|Default|Apply, - Ok, parent, 0, modal, true) + Ok, tqparent, 0, modal, true) { init(g, owner); } KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title, - TQWidget* parent, long initConfigs, int chatMsgId, bool modal) + TQWidget* tqparent, long initConfigs, int chatMsgId, bool modal) : KDialogBase(Tabbed, title, Ok|Default|Apply, - Ok, parent, 0, modal, true) + Ok, tqparent, 0, modal, true) { init(g, owner); if ((ConfigOptions)initConfigs!=NoConfig) { @@ -165,34 +165,34 @@ void KGameDialog::addMsgServerConfig(KGameDialogMsgServerConfig* msgConf) d->mMsgServerPage = addConfigPage(msgConf, i18n("&Message Server")); } -void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent) +void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, TQVBox* tqparent) { if (!chat) { return; } - if (!parent) { - parent = d->mGamePage; + if (!tqparent) { + tqparent = d->mGamePage; } - if (!parent) { + if (!tqparent) { kdError(11001) << "cannot add chat widget without page" << endl; return; } - addConfigWidget(chat, parent); + addConfigWidget(chat, tqparent); } -void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent) +void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, TQVBox* tqparent) { if (!c) { return; } - if (!parent) { - parent = d->mNetworkPage; + if (!tqparent) { + tqparent = d->mNetworkPage; } - if (!parent) { + if (!tqparent) { kdError(11001) << "Cannot add connection list without page" << endl; return; } - addConfigWidget(c, parent); + addConfigWidget(c, tqparent); } TQVBox *KGameDialog::configPage(ConfigOptions which) @@ -226,18 +226,18 @@ TQVBox* KGameDialog::addConfigPage(KGameDialogConfig* widget, const TQString& ti return page; } -void KGameDialog::addConfigWidget(KGameDialogConfig* widget, TQWidget* parent) +void KGameDialog::addConfigWidget(KGameDialogConfig* widget, TQWidget* tqparent) { if (!widget) { kdError(11001) << "Cannot add NULL config widget" << endl; return; } - if (!parent) { + if (!tqparent) { kdError(11001) << "Cannot reparent to NULL widget" << endl; return; } // kdDebug(11001) << "reparenting widget" << endl; - widget->reparent(parent, TQPoint(0,0)); + widget->reparent(tqparent, TQPoint(0,0)); d->mConfigWidgets.append(widget); connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(slotRemoveConfigWidget(TQObject*))); if (!d->mGame) { diff --git a/libkdegames/kgame/dialogs/kgamedialog.h b/libkdegames/kgame/dialogs/kgamedialog.h index 709f71c6..cb731993 100644 --- a/libkdegames/kgame/dialogs/kgamedialog.h +++ b/libkdegames/kgame/dialogs/kgamedialog.h @@ -74,6 +74,7 @@ class KGameDialogPrivate; class KDE_EXPORT KGameDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: enum ConfigOptions @@ -94,11 +95,11 @@ public: * @param owner The KPlayer object who is responsible for this * dialog, aka "the local player" * @param title The title of the dialog - see KDialog::setCaption - * @param parent The parent of the dialog + * @param tqparent The tqparent of the dialog * @param modal Whether the dialog is modal or not **/ KGameDialog(KGame* g, KPlayer* owner, const TQString& title, - TQWidget* parent, bool modal = false); + TQWidget* tqparent, bool modal = false); /** * Create a KGameDialog with the standard configuration widgets. This @@ -121,7 +122,7 @@ public: * @param owner The KPlayer object who is responsible for this * dialog, aka "the local player" * @param title The title of the dialog - see KDialog::setCaption - * @param parent The parent of the dialog + * @param tqparent The tqparent of the dialog * @param modal Whether the dialog is modal or not * @param initConfigs whether the default KGameDialogConfig widgets * shall be created using initDefaultDialog. Use false if you want @@ -130,7 +131,7 @@ public: * if initConfigs = false **/ KGameDialog(KGame* g, KPlayer* owner, const TQString& title, - TQWidget* parent, long initConfigs = AllConfig, + TQWidget* tqparent, long initConfigs = AllConfig, int chatMsgId = 15432, bool modal = false); virtual ~KGameDialog(); @@ -168,14 +169,14 @@ public: virtual void submitToKGame(); /** - * Adds a KGameChat to the dialog. If no parent is specified the + * Adds a KGameChat to the dialog. If no tqparent is specified the * game page will be used. * @param chat The chat widget - * @param parent The parent of the chat widget. This MUST be an + * @param tqparent The tqparent of the chat widget. This MUST be an * already added config widget. Note that the game page will be used - * if parent is 0. + * if tqparent is 0. **/ - void addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent = 0); + void addChatWidget(KGameDialogChatConfig* chat, TQVBox* tqparent = 0); /** * Add a connection list to the dialog. The list consists of a @@ -186,10 +187,10 @@ public: * This is another not-really-config-config-widget. It just displays the * connections and lets you ban players. * @param c The KGameDialogConnectionConfig object - * @param parent The parent of the widget. If 0 the networkConfig + * @param tqparent The tqparent of the widget. If 0 the networkConfig * page is used. **/ - void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent = 0); + void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* tqparent = 0); /** * Add a new page to the dialog. The page will contain you new config @@ -222,12 +223,12 @@ public: KGameDialogGeneralConfig* gameConfig() const; /** - * Add a config widget to the specified parent. Usually you call + * Add a config widget to the specified tqparent. Usually you call * addConfigPage for one widget and addConfigWidget for another to add * it to the same page. Just use the returned page of * addConfigPage. **/ - void addConfigWidget(KGameDialogConfig* widget, TQWidget* parent); + void addConfigWidget(KGameDialogConfig* widget, TQWidget* tqparent); /** * Used to add the main network config widget in a new page. Use this to diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp index 44eaa3c7..af0172ef 100644 --- a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp +++ b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp @@ -57,7 +57,7 @@ public: KPlayer* mOwner; }; -KGameDialogConfig::KGameDialogConfig(TQWidget* parent) : TQWidget(parent) +KGameDialogConfig::KGameDialogConfig(TQWidget* tqparent) : TQWidget(tqparent) { d = new KGameDialogConfigPrivate; } @@ -116,13 +116,13 @@ public: }; -KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* parent) - : KGameDialogConfig(parent) +KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* tqparent) + : KGameDialogConfig(tqparent) { // kdDebug(11001) << k_funcinfo << ": this=" << this << endl; d = new KGameDialogNetworkConfigPrivate(); - TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout"); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toptqlayout"); TQHBoxLayout *hb = new TQHBoxLayout(topLayout, KDialog::spacingHint()); @@ -261,8 +261,8 @@ public: TQVBoxLayout* mTopLayout; }; -KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* parent, bool initializeGUI) - : KGameDialogConfig(parent) +KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* tqparent, bool initializeGUI) + : KGameDialogConfig(tqparent) { // kdDebug(11001) << k_funcinfo << ": this=" << this << endl; d = new KGameDialogGeneralConfigPrivate; @@ -295,7 +295,7 @@ void KGameDialogGeneralConfig::setPlayerName(const TQString& name) TQString KGameDialogGeneralConfig::playerName() const { - return d->mName ? d->mName->text() : TQString::null; + return d->mName ? d->mName->text() : TQString(); } void KGameDialogGeneralConfig::setOwner(KPlayer* p) @@ -386,10 +386,10 @@ public: // TODO: change ADMIN ID, remove CLIENTS, change MAXCLIENTS -// we do everything here with QPushButtons as we want to wait a moment before +// we do everything here with TQPushButtons as we want to wait a moment before // continuing - the message must be sent over network first -KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* parent) - : KGameDialogConfig(parent) +KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* tqparent) + : KGameDialogConfig(tqparent) { d = new KGameDialogMsgServerConfigPrivate; @@ -465,12 +465,12 @@ void KGameDialogMsgServerConfig::slotChangeAdmin() return; } //TODO - Q_UINT32 newAdmin = 0; + TQ_UINT32 newAdmin = 0; // newAdmin = ; game()->electAdmin(newAdmin); } -void KGameDialogMsgServerConfig::removeClient(Q_UINT32 /*id*/) +void KGameDialogMsgServerConfig::removeClient(TQ_UINT32 /*id*/) { //TODO } @@ -531,7 +531,7 @@ void KGameDialogMsgServerConfig::setHasMsgServer(bool has) } //TODO // list all connections, data (max clients) and so on - // cannot be done above (together with QPushButtons) as it is possible that + // cannot be done above (together with TQPushButtons) as it is possible that // this client is ADMIN but not MASTER (i.e. doesn't own the messageserver) } @@ -547,8 +547,8 @@ public: KGameChat* mChat; }; -KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* parent) - : KGameDialogConfig(parent) +KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* tqparent) + : KGameDialogConfig(tqparent) { d = new KGameDialogChatConfigPrivate; TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); @@ -599,8 +599,8 @@ public: KListBox* mPlayerBox; }; -KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* parent) - : KGameDialogConfig(parent) +KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* tqparent) + : KGameDialogConfig(tqparent) { //TODO: prevent player to ban himself d = new KGameDialogConnectionConfigPrivate; @@ -714,7 +714,7 @@ void KGameDialogConnectionConfig::slotPlayerLeftGame(KPlayer* p) // disconnect first this->disconnect(p); if (!item(p)) { - kdError(11001) << k_funcinfo << ": cannot find " << p->id() + kdError(11001) << k_funcinfo << ": cannot tqfind " << p->id() << " in list" << endl; return; } @@ -743,8 +743,8 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(TQListBoxItem* item) return; } - if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").arg( - p->name()), TQString::null, i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) { + if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").tqarg( + p->name()), TQString(), i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) { kdDebug(11001) << "will remove player " << p << endl; game()->removePlayer(p); // d->mPlayerBox->removeItem(d->mPlayerBox->index(item)); // should be done by signalPlayerLeftGame diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.h b/libkdegames/kgame/dialogs/kgamedialogconfig.h index 911c63aa..7c42d05d 100644 --- a/libkdegames/kgame/dialogs/kgamedialogconfig.h +++ b/libkdegames/kgame/dialogs/kgamedialogconfig.h @@ -48,11 +48,12 @@ class KGameDialogConfigPrivate; * @short Base class for configuration widgets * @author Andreas Beckermann <[email protected]> **/ -class KDE_EXPORT KGameDialogConfig : public QWidget +class KDE_EXPORT KGameDialogConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KGameDialogConfig(TQWidget* parent = 0); + KGameDialogConfig(TQWidget* tqparent = 0); virtual ~KGameDialogConfig(); /** @@ -136,7 +137,7 @@ private: * The main game configuration widget. * * It currently contains a line edit for the name of the player only. You can - * add widgets by using the KGameDialogGeneralConfig as parent parameter as it + * add widgets by using the KGameDialogGeneralConfig as tqparent parameter as it * uses TQLayout::autoAdd == true. * @author Andreas Beckermann <[email protected]> **/ @@ -144,23 +145,24 @@ class KGameDialogGeneralConfigPrivate; class KGameDialogGeneralConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: /** * Construct a KGameDialogGeneralConfig. Currently it contains a line * edit widget to change the player name only. * * If you just want to add more widgets you can just create your widgets - * with the KGameDialogGeneralConfig as parent as it uses + * with the KGameDialogGeneralConfig as tqparent as it uses * TQLayout::setAutoAdd(true). * - * @param parent Parent widget for this dialog. + * @param tqparent Parent widget for this dialog. * @param initializeGUI If you really don't want to use the - * predefined widget and/or layout use FALSE here. Note that then none + * predefined widget and/or tqlayout use FALSE here. Note that then none * of the predefined widgets (currently only the name of the player) * will exist anymore. * **/ - KGameDialogGeneralConfig(TQWidget* parent = 0, bool initializeGUI = true); + KGameDialogGeneralConfig(TQWidget* tqparent = 0, bool initializeGUI = true); virtual ~KGameDialogGeneralConfig(); /** @@ -211,8 +213,9 @@ class KGameDialogNetworkConfigPrivate; class KDE_EXPORT KGameDialogNetworkConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: - KGameDialogNetworkConfig(TQWidget* parent = 0); + KGameDialogNetworkConfig(TQWidget* tqparent = 0); virtual ~KGameDialogNetworkConfig(); @@ -248,7 +251,7 @@ public: * @param type Service type (something like _kwin4._tcp). It should be unique for application. * @since 3.4 **/ - void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null); + void setDiscoveryInfo(const TQString& type, const TQString& name=TQString()); signals: /** @@ -277,8 +280,9 @@ class KGameDialogMsgServerConfigPrivate; class KGameDialogMsgServerConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: - KGameDialogMsgServerConfig(TQWidget* parent = 0); + KGameDialogMsgServerConfig(TQWidget* tqparent = 0); virtual ~KGameDialogMsgServerConfig(); virtual void submitToKGame(KGame*, KPlayer*) {} @@ -294,7 +298,7 @@ protected slots: void slotRemoveClient(); protected: - void removeClient(Q_UINT32 id); + void removeClient(TQ_UINT32 id); private: KGameDialogMsgServerConfigPrivate* d; @@ -310,8 +314,9 @@ class KGameDialogChatConfigPrivate; class KGameDialogChatConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: - KGameDialogChatConfig(int chatMsgId, TQWidget* parent = 0); + KGameDialogChatConfig(int chatMsgId, TQWidget* tqparent = 0); virtual ~KGameDialogChatConfig(); virtual void setKGame(KGame* g); @@ -331,8 +336,9 @@ class KGameDialogConnectionConfigPrivate; class KGameDialogConnectionConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: - KGameDialogConnectionConfig(TQWidget* parent = 0); + KGameDialogConnectionConfig(TQWidget* tqparent = 0); virtual ~KGameDialogConnectionConfig(); virtual void setKGame(KGame* g); diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.cpp b/libkdegames/kgame/dialogs/kgameerrordialog.cpp index 7c3b0509..d5df6ba3 100644 --- a/libkdegames/kgame/dialogs/kgameerrordialog.cpp +++ b/libkdegames/kgame/dialogs/kgameerrordialog.cpp @@ -37,7 +37,7 @@ public: const KGame* mGame; }; -KGameErrorDialog::KGameErrorDialog(TQWidget* parent) : TQObject(parent) +KGameErrorDialog::KGameErrorDialog(TQWidget* tqparent) : TQObject(tqparent) { d = new KGameErrorDialogPrivate; } @@ -59,8 +59,8 @@ void KGameErrorDialog::setKGame(const KGame* g) this, TQT_SLOT(slotError(int, TQString))); connect(d->mGame, TQT_SIGNAL(signalConnectionBroken()), this, TQT_SLOT(slotServerConnectionLost())); - connect(d->mGame, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)), - this, TQT_SLOT(slotClientConnectionLost(Q_UINT32,bool))); + connect(d->mGame, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32,bool)), + this, TQT_SLOT(slotClientConnectionLost(TQ_UINT32,bool))); } void KGameErrorDialog::slotUnsetKGame() @@ -71,33 +71,33 @@ void KGameErrorDialog::slotUnsetKGame() d->mGame = 0; } -void KGameErrorDialog::error(const TQString& errorText, TQWidget* parent) -{ KMessageBox::error(parent, errorText); } +void KGameErrorDialog::error(const TQString& errorText, TQWidget* tqparent) +{ KMessageBox::error(tqparent, errorText); } void KGameErrorDialog::slotServerConnectionLost() { // TODO: add IP/port of the server TQString message = i18n("Connection to the server has been lost!"); - error(message, (TQWidget*)parent()); + error(message, (TQWidget*)tqparent()); } -void KGameErrorDialog::slotClientConnectionLost(Q_UINT32 /*id*/,bool) +void KGameErrorDialog::slotClientConnectionLost(TQ_UINT32 /*id*/,bool) { //TODO: add IP/port of the client TQString message; // if (c) { -// message = i18n("Connection to client has been lost!\nID: %1\nIP: %2").arg(c->id()).arg(c->IP()); +// message = i18n("Connection to client has been lost!\nID: %1\nIP: %2").tqarg(c->id()).tqarg(c->IP()); // } else { // message = i18n("Connection to client has been lost!"); // } message = i18n("Connection to client has been lost!"); - error(message, (TQWidget*)parent()); + error(message, (TQWidget*)tqparent()); } void KGameErrorDialog::slotError(int errorNo, TQString text) { - TQString message = i18n("Received a network error!\nError number: %1\nError message: %2").arg(errorNo).arg(text); - error(message, (TQWidget*)parent()); + TQString message = i18n("Received a network error!\nError number: %1\nError message: %2").tqarg(errorNo).tqarg(text); + error(message, (TQWidget*)tqparent()); } void KGameErrorDialog::connectionError(TQString s) @@ -106,17 +106,17 @@ void KGameErrorDialog::connectionError(TQString s) if (s.isNull()) { message = i18n("No connection could be created."); } else { - message = i18n("No connection could be created.\nThe error message was:\n%1").arg(s); + message = i18n("No connection could be created.\nThe error message was:\n%1").tqarg(s); } - error(message, (TQWidget*)parent()); + error(message, (TQWidget*)tqparent()); } // should become the real dialog - currently we just use messageboxes // -> maybe unused forever -KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* parent) - : KDialogBase(Plain, i18n("Error"), Ok, Ok, parent, 0, true, true) +KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* tqparent) + : KDialogBase(Plain, i18n("Error"), Ok, Ok, tqparent, 0, true, true) { } diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.h b/libkdegames/kgame/dialogs/kgameerrordialog.h index 3883399b..b8d34c1a 100644 --- a/libkdegames/kgame/dialogs/kgameerrordialog.h +++ b/libkdegames/kgame/dialogs/kgameerrordialog.h @@ -36,11 +36,12 @@ class KGameErrorDialogPrivate; * @short Error handling for KGame * @author Andreas Beckermann <[email protected]> **/ -class KGameErrorDialog : public QObject +class KGameErrorDialog : public TQObject { Q_OBJECT + TQ_OBJECT public: - KGameErrorDialog(TQWidget* parent); + KGameErrorDialog(TQWidget* tqparent); ~KGameErrorDialog(); /** @@ -55,9 +56,9 @@ public: * KGame couldn't establish a connection. Use this if * KGame::initConnection returns false * @param s A string that describes the error further (like port is - * already in use). Will be ignored if TQString::null + * already in use). Will be ignored if TQString() **/ - void connectionError(TQString s = TQString::null); + void connectionError(TQString s = TQString()); public slots: void slotError(int error, TQString text); @@ -74,7 +75,7 @@ public slots: * * See @ref KGameNetwork::signalClientDisconnected **/ - void slotClientConnectionLost(Q_UINT32 clientID,bool broken); + void slotClientConnectionLost(TQ_UINT32 clientID,bool broken); /** * Unsets a @ref KGame which has been set using @ref setKGame before. @@ -87,7 +88,7 @@ public slots: void slotUnsetKGame(); protected: - void error(const TQString& errorText, TQWidget* parent = 0); + void error(const TQString& errorText, TQWidget* tqparent = 0); private: KGameErrorDialogPrivate* d; @@ -103,8 +104,9 @@ private: class KGameErrorMessageDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KGameErrorMessageDialog(TQWidget* parent); + KGameErrorMessageDialog(TQWidget* tqparent); ~KGameErrorMessageDialog(); private: |