diff options
Diffstat (limited to 'libkdegames/kgame/dialogs/kgamedialogconfig.cpp')
-rw-r--r-- | libkdegames/kgame/dialogs/kgamedialogconfig.cpp | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp index 27f91cd1..44eaa3c7 100644 --- a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp +++ b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp @@ -31,13 +31,13 @@ #include <klistbox.h> #include <kmessagebox.h> -#include <qlayout.h> -#include <qhgroupbox.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qvbox.h> -#include <qptrdict.h> +#include <tqlayout.h> +#include <tqhgroupbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> +#include <tqvbox.h> +#include <tqptrdict.h> #include "kgamedialogconfig.moc" @@ -57,7 +57,7 @@ public: KPlayer* mOwner; }; -KGameDialogConfig::KGameDialogConfig(QWidget* parent) : QWidget(parent) +KGameDialogConfig::KGameDialogConfig(TQWidget* parent) : TQWidget(parent) { d = new KGameDialogConfigPrivate; } @@ -104,42 +104,42 @@ public: } - // QPushButton* mInitConnection; - QHGroupBox* mInitConnection; - QLabel* mNetworkLabel; - QPushButton *mDisconnectButton; + // TQPushButton* mInitConnection; + TQHGroupBox* mInitConnection; + TQLabel* mNetworkLabel; + TQPushButton *mDisconnectButton; bool mDefaultServer; - QString mDefaultHost; + TQString mDefaultHost; unsigned short int mDefaultPort; KGameConnectWidget *mConnect; }; -KGameDialogNetworkConfig::KGameDialogNetworkConfig(QWidget* parent) +KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* parent) : KGameDialogConfig(parent) { // kdDebug(11001) << k_funcinfo << ": this=" << this << endl; d = new KGameDialogNetworkConfigPrivate(); - QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout"); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout"); - QHBoxLayout *hb = new QHBoxLayout(topLayout, KDialog::spacingHint()); + TQHBoxLayout *hb = new TQHBoxLayout(topLayout, KDialog::spacingHint()); - d->mNetworkLabel = new QLabel(this); + d->mNetworkLabel = new TQLabel(this); hb->addWidget(d->mNetworkLabel); - d->mDisconnectButton=new QPushButton(i18n("Disconnect"),this); - connect(d->mDisconnectButton, SIGNAL(clicked()), this, SLOT(slotExitConnection())); + d->mDisconnectButton=new TQPushButton(i18n("Disconnect"),this); + connect(d->mDisconnectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExitConnection())); hb->addWidget(d->mDisconnectButton); - d->mInitConnection = new QHGroupBox(i18n("Network Configuration"), this); + d->mInitConnection = new TQHGroupBox(i18n("Network Configuration"), this); topLayout->addWidget(d->mInitConnection); d->mConnect = new KGameConnectWidget(d->mInitConnection); - connect(d->mConnect, SIGNAL(signalNetworkSetup()), this, SLOT(slotInitConnection())); - connect(d->mConnect, SIGNAL(signalServerTypeChanged(int)), - this, SIGNAL(signalServerTypeChanged(int))); + connect(d->mConnect, TQT_SIGNAL(signalNetworkSetup()), this, TQT_SLOT(slotInitConnection())); + connect(d->mConnect, TQT_SIGNAL(signalServerTypeChanged(int)), + this, TQT_SIGNAL(signalServerTypeChanged(int))); // Needs to be AFTER the creation of the dialogs setConnected(false); @@ -165,7 +165,7 @@ void KGameDialogNetworkConfig::slotInitConnection() bool connected = false; bool master = true; unsigned short int port = d->mConnect->port(); - QString host = d->mConnect->host(); + TQString host = d->mConnect->host(); if (host.isNull()) { master = true; @@ -180,8 +180,8 @@ void KGameDialogNetworkConfig::slotInitConnection() } // We need to learn about failed connections if (game()) { - connect(game(), SIGNAL(signalConnectionBroken()), - this, SLOT(slotConnectionBroken())); + connect(game(), TQT_SIGNAL(signalConnectionBroken()), + this, TQT_SLOT(slotConnectionBroken())); } } setConnected(connected, master); @@ -225,7 +225,7 @@ void KGameDialogNetworkConfig::setKGame(KGame* g) setConnected(game()->isNetwork(), game()->isMaster()); } -void KGameDialogNetworkConfig::setDefaultNetworkInfo(const QString& host, unsigned short int port,bool server) +void KGameDialogNetworkConfig::setDefaultNetworkInfo(const TQString& host, unsigned short int port,bool server) { d->mDefaultPort = port; d->mDefaultHost = host; @@ -240,7 +240,7 @@ void KGameDialogNetworkConfig::setDefaultNetworkInfo(const QString& host, unsign } } -void KGameDialogNetworkConfig::setDiscoveryInfo(const QString& type, const QString& name) +void KGameDialogNetworkConfig::setDiscoveryInfo(const TQString& type, const TQString& name) { d->mConnect->setType(type); d->mConnect->setName(name); @@ -256,26 +256,26 @@ public: mName = 0; } - QLineEdit* mName; + TQLineEdit* mName; - QVBoxLayout* mTopLayout; + TQVBoxLayout* mTopLayout; }; -KGameDialogGeneralConfig::KGameDialogGeneralConfig(QWidget* parent, bool initializeGUI) +KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* parent, bool initializeGUI) : KGameDialogConfig(parent) { // kdDebug(11001) << k_funcinfo << ": this=" << this << endl; d = new KGameDialogGeneralConfigPrivate; if (initializeGUI) { - d->mTopLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + d->mTopLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); d->mTopLayout->setAutoAdd(true); - QWidget* nameWidget = new QWidget(this); - QHBoxLayout* l = new QHBoxLayout(nameWidget); - QLabel* nameLabel = new QLabel(i18n("Your name:"), nameWidget); + TQWidget* nameWidget = new TQWidget(this); + TQHBoxLayout* l = new TQHBoxLayout(nameWidget); + TQLabel* nameLabel = new TQLabel(i18n("Your name:"), nameWidget); l->addWidget(nameLabel); - d->mName = new QLineEdit(nameWidget); + d->mName = new TQLineEdit(nameWidget); l->addWidget(d->mName); } } @@ -286,16 +286,16 @@ KGameDialogGeneralConfig::~KGameDialogGeneralConfig() delete d; } -void KGameDialogGeneralConfig::setPlayerName(const QString& name) +void KGameDialogGeneralConfig::setPlayerName(const TQString& name) { if (d->mName) { d->mName->setText(name); } } -QString KGameDialogGeneralConfig::playerName() const +TQString KGameDialogGeneralConfig::playerName() const { - return d->mName ? d->mName->text() : QString::null; + return d->mName ? d->mName->text() : TQString::null; } void KGameDialogGeneralConfig::setOwner(KPlayer* p) @@ -309,8 +309,8 @@ void KGameDialogGeneralConfig::setOwner(KPlayer* p) // maybe call hide() return; } - connect(owner(), SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), - this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); + connect(owner(), TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); setPlayerName(p->name()); //TODO: connect signalPropertyChanged and check for playername changes! } @@ -373,29 +373,29 @@ public: noMaster = 0; } - QVBoxLayout* senderLayout; - QHBoxLayout* localLayout; + TQVBoxLayout* senderLayout; + TQHBoxLayout* localLayout; - QPushButton* changeMaxClients; - QPushButton* changeAdmin; - QPushButton* removeClient; - QLabel* noAdmin; + TQPushButton* changeMaxClients; + TQPushButton* changeAdmin; + TQPushButton* removeClient; + TQLabel* noAdmin; - QLabel* noMaster; + TQLabel* noMaster; }; // TODO: change ADMIN ID, remove CLIENTS, change MAXCLIENTS // we do everything here with QPushButtons as we want to wait a moment before // continuing - the message must be sent over network first -KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(QWidget* parent) +KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* parent) : KGameDialogConfig(parent) { d = new KGameDialogMsgServerConfigPrivate; - QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - d->senderLayout = new QVBoxLayout(topLayout); - d->localLayout = new QHBoxLayout(topLayout); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + d->senderLayout = new TQVBoxLayout(topLayout); + d->localLayout = new TQHBoxLayout(topLayout); } KGameDialogMsgServerConfig::~KGameDialogMsgServerConfig() @@ -408,7 +408,7 @@ void KGameDialogMsgServerConfig::setKGame(KGame* g) { KGameDialogConfig::setKGame(g); //TODO display the ID of the admin if we aren't - // connect(g, SIGNAL(signalAdminChanged(int)), this, SLOT(slotChangeIsAdmin(int)));//TODO + // connect(g, TQT_SIGNAL(signalAdminChanged(int)), this, TQT_SLOT(slotChangeIsAdmin(int)));//TODO if (!game()) { // we cannot do anything without a KGame object! setAdmin(false); @@ -430,17 +430,17 @@ void KGameDialogMsgServerConfig::slotChangeMaxClients() return; } int max; -// edit->setText(QString::number()); // current max clients! //TODO +// edit->setText(TQString::number()); // current max clients! //TODO - QDialog* dialog = new QDialog(); + TQDialog* dialog = new TQDialog(); dialog->setCaption(i18n("Maximal Number of Clients")); - QHBoxLayout* l = new QHBoxLayout(dialog, KDialog::marginHint(), KDialog::spacingHint()); + TQHBoxLayout* l = new TQHBoxLayout(dialog, KDialog::marginHint(), KDialog::spacingHint()); l->setAutoAdd(true); - (void) new QLabel(i18n("Maximal number of clients (-1 = infinite):"), dialog); - QLineEdit* edit = new QLineEdit(dialog);//TODO: use KIntNumInput -// edit->setText(QString::number(max)); // current max clients! //TODO - if (dialog->exec() == QDialog::Accepted) { + (void) new TQLabel(i18n("Maximal number of clients (-1 = infinite):"), dialog); + TQLineEdit* edit = new TQLineEdit(dialog);//TODO: use KIntNumInput +// edit->setText(TQString::number(max)); // current max clients! //TODO + if (dialog->exec() == TQDialog::Accepted) { bool ok; max = edit->text().toInt(&ok); if (ok) { @@ -487,12 +487,12 @@ void KGameDialogMsgServerConfig::setAdmin(bool a) delete d->noAdmin; d->noAdmin = 0; } - d->changeMaxClients = new QPushButton(i18n("Change Maximal Number of Clients"), this); - connect(d->changeMaxClients, SIGNAL(pressed()), this, SLOT(slotChangeMaxClients())); - d->changeAdmin = new QPushButton(i18n("Change Admin"), this); - connect(d->changeAdmin, SIGNAL(pressed()), this, SLOT(slotChangeAdmin())); - d->removeClient = new QPushButton(i18n("Remove Client with All Players"), this); - connect(d->removeClient, SIGNAL(pressed()), this, SLOT(slotRemoveClient())); + d->changeMaxClients = new TQPushButton(i18n("Change Maximal Number of Clients"), this); + connect(d->changeMaxClients, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChangeMaxClients())); + d->changeAdmin = new TQPushButton(i18n("Change Admin"), this); + connect(d->changeAdmin, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChangeAdmin())); + d->removeClient = new TQPushButton(i18n("Remove Client with All Players"), this); + connect(d->removeClient, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotRemoveClient())); d->senderLayout->addWidget(d->changeMaxClients); d->senderLayout->addWidget(d->changeAdmin); d->senderLayout->addWidget(d->removeClient); @@ -509,7 +509,7 @@ void KGameDialogMsgServerConfig::setAdmin(bool a) delete d->removeClient; d->removeClient = 0; } - d->noAdmin = new QLabel(i18n("Only the admin can configure the message server!"), this); + d->noAdmin = new TQLabel(i18n("Only the admin can configure the message server!"), this); d->senderLayout->addWidget(d->noAdmin); } } @@ -520,7 +520,7 @@ void KGameDialogMsgServerConfig::setHasMsgServer(bool has) if (!has) { // delete all inputs if (!d->noMaster) { - d->noMaster = new QLabel(i18n("You don't own the message server"), this); + d->noMaster = new TQLabel(i18n("You don't own the message server"), this); d->localLayout->addWidget(d->noMaster); } return; @@ -547,13 +547,13 @@ public: KGameChat* mChat; }; -KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, QWidget* parent) +KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* parent) : KGameDialogConfig(parent) { d = new KGameDialogChatConfigPrivate; - QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); topLayout->setAutoAdd(true); - QHGroupBox* b = new QHGroupBox(i18n("Chat"), this); + TQHGroupBox* b = new TQHGroupBox(i18n("Chat"), this); d->mChat = new KGameChat(0, chatMsgId, b); } @@ -595,18 +595,18 @@ public: mPlayerBox = 0; } - QPtrDict<KPlayer> mItem2Player; + TQPtrDict<KPlayer> mItem2Player; KListBox* mPlayerBox; }; -KGameDialogConnectionConfig::KGameDialogConnectionConfig(QWidget* parent) +KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* parent) : KGameDialogConfig(parent) { //TODO: prevent player to ban himself d = new KGameDialogConnectionConfigPrivate; - QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); topLayout->setAutoAdd(true); - QHGroupBox* b = new QHGroupBox(i18n("Connected Players"), this); + TQHGroupBox* b = new TQHGroupBox(i18n("Connected Players"), this); d->mPlayerBox = new KListBox(b); setMinimumHeight(100); } @@ -627,10 +627,10 @@ void KGameDialogConnectionConfig::setKGame(KGame* g) slotClearPlayers(); if (game()) { // react to changes in KGame::playerList() - connect(game(), SIGNAL(signalPlayerJoinedGame(KPlayer*)), - this, SLOT(slotPlayerJoinedGame(KPlayer*))); - connect(game(), SIGNAL(signalPlayerLeftGame(KPlayer*)), - this, SLOT(slotPlayerLeftGame(KPlayer*))); + connect(game(), TQT_SIGNAL(signalPlayerJoinedGame(KPlayer*)), + this, TQT_SLOT(slotPlayerJoinedGame(KPlayer*))); + connect(game(), TQT_SIGNAL(signalPlayerLeftGame(KPlayer*)), + this, TQT_SLOT(slotPlayerLeftGame(KPlayer*))); KGame::KGamePlayerList l = *game()->playerList(); for (KPlayer* p = l.first(); p; p = l.next()) { @@ -650,21 +650,21 @@ void KGameDialogConnectionConfig::setAdmin(bool a) return; } if (admin()) { - disconnect(game(), SIGNAL(executed(QListBoxItem*)), this, 0); + disconnect(game(), TQT_SIGNAL(executed(TQListBoxItem*)), this, 0); } KGameDialogConfig::setAdmin(a); if (admin()) { - connect(d->mPlayerBox, SIGNAL(executed(QListBoxItem*)), this, - SLOT(slotKickPlayerOut(QListBoxItem*))); + connect(d->mPlayerBox, TQT_SIGNAL(executed(TQListBoxItem*)), this, + TQT_SLOT(slotKickPlayerOut(TQListBoxItem*))); } } -QListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const +TQListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const { - QPtrDictIterator<KPlayer> it(d->mItem2Player); + TQPtrDictIterator<KPlayer> it(d->mItem2Player); while (it.current()) { if (it.current() == p) { - return (QListBoxItem*)it.currentKey(); + return (TQListBoxItem*)it.currentKey(); } ++it; } @@ -673,7 +673,7 @@ QListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const void KGameDialogConnectionConfig::slotClearPlayers() { - QPtrDictIterator<KPlayer> it(d->mItem2Player); + TQPtrDictIterator<KPlayer> it(d->mItem2Player); while (it.current()) { slotPlayerLeftGame(it.current()); ++it; @@ -700,12 +700,12 @@ void KGameDialogConnectionConfig::slotPlayerJoinedGame(KPlayer* p) return; } kdDebug(11001) << k_funcinfo << ": add player " << p->id() << endl; - QListBoxText* t = new QListBoxText(p->name()); + TQListBoxText* t = new TQListBoxText(p->name()); d->mItem2Player.insert(t, p); d->mPlayerBox->insertItem(t); - connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), - this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); + connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), + this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); } @@ -722,7 +722,7 @@ void KGameDialogConnectionConfig::slotPlayerLeftGame(KPlayer* p) } -void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item) +void KGameDialogConnectionConfig::slotKickPlayerOut(TQListBoxItem* item) { kdDebug(11001) << "kick player out" << endl; KPlayer* p = d->mItem2Player[item]; @@ -744,7 +744,7 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item) } if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").arg( - p->name()), QString::null, i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) { + p->name()), TQString::null, 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 @@ -756,15 +756,15 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item) void KGameDialogConnectionConfig::slotPropertyChanged(KGamePropertyBase* prop, KPlayer* player) { if(prop->id() == KGamePropertyBase::IdName) { - QListBoxText* old = 0; - QPtrDictIterator<KPlayer> it(d->mItem2Player); + TQListBoxText* old = 0; + TQPtrDictIterator<KPlayer> it(d->mItem2Player); while (it.current() && !old) { if (it.current() == player) { - old = (QListBoxText*)it.currentKey(); + old = (TQListBoxText*)it.currentKey(); } ++it; } - QListBoxText* t = new QListBoxText(player->name()); + TQListBoxText* t = new TQListBoxText(player->name()); d->mPlayerBox->changeItem(t, d->mPlayerBox->index(old)); d->mItem2Player.remove(old); d->mItem2Player.insert(t, player); |