summaryrefslogtreecommitdiffstats
path: root/atlantik/client/selectconfiguration_widget.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 /atlantik/client/selectconfiguration_widget.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 'atlantik/client/selectconfiguration_widget.cpp')
-rw-r--r--atlantik/client/selectconfiguration_widget.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/atlantik/client/selectconfiguration_widget.cpp b/atlantik/client/selectconfiguration_widget.cpp
index 0e7d5cdb..b40bdd4f 100644
--- a/atlantik/client/selectconfiguration_widget.cpp
+++ b/atlantik/client/selectconfiguration_widget.cpp
@@ -16,8 +16,8 @@
#include <iostream>
-#include <qcheckbox.h>
-#include <qradiobutton.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
#include <kdebug.h>
#include <kdialog.h>
@@ -33,47 +33,47 @@
#include "selectconfiguration_widget.moc"
-SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, QWidget *parent, const char *name) : QWidget(parent, name)
+SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *parent, const char *name) : TQWidget(parent, name)
{
m_atlanticCore = atlanticCore;
m_game = 0;
- m_mainLayout = new QVBoxLayout(this, KDialog::marginHint());
+ m_mainLayout = new TQVBoxLayout(this, KDialog::marginHint());
Q_CHECK_PTR(m_mainLayout);
// Game configuration.
- m_configBox = new QVGroupBox(i18n("Game Configuration"), this, "configBox");
+ m_configBox = new TQVGroupBox(i18n("Game Configuration"), this, "configBox");
m_mainLayout->addWidget(m_configBox);
// Player buttons.
- QHBoxLayout *playerButtons = new QHBoxLayout(m_mainLayout, KDialog::spacingHint());
+ TQHBoxLayout *playerButtons = new TQHBoxLayout(m_mainLayout, KDialog::spacingHint());
playerButtons->setMargin(0);
- playerButtons->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
+ playerButtons->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
// Vertical spacer.
- m_mainLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
+ m_mainLayout->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
// Server buttons.
- QHBoxLayout *serverButtons = new QHBoxLayout(m_mainLayout, KDialog::spacingHint());
+ TQHBoxLayout *serverButtons = new TQHBoxLayout(m_mainLayout, KDialog::spacingHint());
serverButtons->setMargin(0);
m_backButton = new KPushButton(SmallIcon("back"), i18n("Leave Game"), this);
serverButtons->addWidget(m_backButton);
- connect(m_backButton, SIGNAL(clicked()), this, SIGNAL(leaveGame()));
+ connect(m_backButton, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(leaveGame()));
- serverButtons->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
+ serverButtons->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
m_startButton = new KPushButton(SmallIconSet("forward"), i18n("Start Game"), this);
serverButtons->addWidget(m_startButton);
m_startButton->setEnabled(false);
- connect(m_startButton, SIGNAL(clicked()), this, SIGNAL(startGame()));
+ connect(m_startButton, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(startGame()));
Player *playerSelf = m_atlanticCore->playerSelf();
playerChanged(playerSelf);
- connect(playerSelf, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *)));
+ connect(playerSelf, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *)));
emit statusMessage(i18n("Retrieving configuration list..."));
}
@@ -86,22 +86,22 @@ void SelectConfiguration::initGame()
void SelectConfiguration::addConfigOption(ConfigOption *configOption)
{
// FIXME: only bool types supported!
- QCheckBox *checkBox = new QCheckBox(configOption->description(), m_configBox, "checkbox");
- m_configMap[(QObject *)checkBox] = configOption;
+ TQCheckBox *checkBox = new TQCheckBox(configOption->description(), m_configBox, "checkbox");
+ m_configMap[(TQObject *)checkBox] = configOption;
m_configBoxMap[configOption] = checkBox;
checkBox->setChecked( configOption->value().toInt() );
checkBox->setEnabled( configOption->edit() && m_atlanticCore->selfIsMaster() );
checkBox->show();
- connect(checkBox, SIGNAL(clicked()), this, SLOT(changeOption()));
- connect(configOption, SIGNAL(changed(ConfigOption *)), this, SLOT(optionChanged(ConfigOption *)));
+ connect(checkBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(changeOption()));
+ connect(configOption, TQT_SIGNAL(changed(ConfigOption *)), this, TQT_SLOT(optionChanged(ConfigOption *)));
}
-void SelectConfiguration::gameOption(QString title, QString type, QString value, QString edit, QString command)
+void SelectConfiguration::gameOption(TQString title, TQString type, TQString value, TQString edit, TQString command)
{
// Find if option exists in GUI yet
- if (QCheckBox *checkBox = dynamic_cast<QCheckBox *>(m_checkBoxMap[command]))
+ if (TQCheckBox *checkBox = dynamic_cast<TQCheckBox *>(m_checkBoxMap[command]))
{
checkBox->setChecked(value.toInt());
checkBox->setEnabled(edit.toInt());
@@ -111,14 +111,14 @@ void SelectConfiguration::gameOption(QString title, QString type, QString value,
// Create option
if (type == "bool")
{
- QCheckBox *checkBox = new QCheckBox(title, m_configBox, "checkbox");
- m_optionCommandMap[(QObject *)checkBox] = command;
+ TQCheckBox *checkBox = new TQCheckBox(title, m_configBox, "checkbox");
+ m_optionCommandMap[(TQObject *)checkBox] = command;
m_checkBoxMap[command] = checkBox;
checkBox->setChecked(value.toInt());
checkBox->setEnabled(edit.toInt());
checkBox->show();
- connect(checkBox, SIGNAL(clicked()), this, SLOT(optionChanged()));
+ connect(checkBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(optionChanged()));
}
// TODO: create options other than type=bool
@@ -127,17 +127,17 @@ void SelectConfiguration::gameOption(QString title, QString type, QString value,
void SelectConfiguration::changeOption()
{
- ConfigOption *configOption = m_configMap[(QObject *)QObject::sender()];
+ ConfigOption *configOption = m_configMap[(TQObject *)TQObject::sender()];
if (configOption)
{
- kdDebug() << "checked " << ((QCheckBox *)QObject::sender())->isChecked() << endl;
- emit changeOption( configOption->id(), QString::number( ((QCheckBox *)QObject::sender())->isChecked() ) );
+ kdDebug() << "checked " << ((TQCheckBox *)TQObject::sender())->isChecked() << endl;
+ emit changeOption( configOption->id(), TQString::number( ((TQCheckBox *)TQObject::sender())->isChecked() ) );
}
}
void SelectConfiguration::optionChanged(ConfigOption *configOption)
{
- QCheckBox *checkBox = m_configBoxMap[configOption];
+ TQCheckBox *checkBox = m_configBoxMap[configOption];
if (checkBox)
{
checkBox->setText( configOption->description() );
@@ -148,11 +148,11 @@ void SelectConfiguration::optionChanged(ConfigOption *configOption)
void SelectConfiguration::optionChanged()
{
- QString command = m_optionCommandMap[(QObject *)QObject::sender()];
+ TQString command = m_optionCommandMap[(TQObject *)TQObject::sender()];
- if (QCheckBox *checkBox = m_checkBoxMap[command])
+ if (TQCheckBox *checkBox = m_checkBoxMap[command])
{
- command.append(QString::number(checkBox->isChecked()));
+ command.append(TQString::number(checkBox->isChecked()));
emit buttonCommand(command);
}
}
@@ -171,12 +171,12 @@ void SelectConfiguration::playerChanged(Player *player)
kdDebug() << "playerChanged::change" << endl;
if (m_game)
- disconnect(m_game, SIGNAL(changed(Game *)), this, SLOT(gameChanged(Game *)));
+ disconnect(m_game, TQT_SIGNAL(changed(Game *)), this, TQT_SLOT(gameChanged(Game *)));
m_game = player->game();
if (m_game)
- connect(m_game, SIGNAL(changed(Game *)), this, SLOT(gameChanged(Game *)));
+ connect(m_game, TQT_SIGNAL(changed(Game *)), this, TQT_SLOT(gameChanged(Game *)));
}
}
@@ -184,6 +184,6 @@ void SelectConfiguration::gameChanged(Game *game)
{
m_startButton->setEnabled( game->master() == m_atlanticCore->playerSelf() );
- for (QMapIterator<ConfigOption *, QCheckBox *> it = m_configBoxMap.begin() ; it != m_configBoxMap.end() ; ++it)
+ for (TQMapIterator<ConfigOption *, TQCheckBox *> it = m_configBoxMap.begin() ; it != m_configBoxMap.end() ; ++it)
(*it)->setEnabled( it.key()->edit() && m_atlanticCore->selfIsMaster() );
}