summaryrefslogtreecommitdiffstats
path: root/konquest/newgamedlg.cc
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 /konquest/newgamedlg.cc
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 'konquest/newgamedlg.cc')
-rw-r--r--konquest/newgamedlg.cc84
1 files changed, 42 insertions, 42 deletions
diff --git a/konquest/newgamedlg.cc b/konquest/newgamedlg.cc
index c1beae4f..232e6415 100644
--- a/konquest/newgamedlg.cc
+++ b/konquest/newgamedlg.cc
@@ -1,13 +1,13 @@
-#include <qheader.h>
-#include <qlayout.h>
-#include <qcolor.h>
-#include <qlabel.h>
-#include <qslider.h>
-#include <qevent.h>
-#include <qkeycode.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
+#include <tqheader.h>
+#include <tqlayout.h>
+#include <tqcolor.h>
+#include <tqlabel.h>
+#include <tqslider.h>
+#include <tqevent.h>
+#include <tqkeycode.h>
+#include <tqlistview.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -25,7 +25,7 @@
New Game Dialog Members
************************************************************************/
-NewGameDlg::NewGameDlg( QWidget *parent, Map *pmap, PlayerList *players,
+NewGameDlg::NewGameDlg( TQWidget *parent, Map *pmap, PlayerList *players,
Player *neutralPlayer, PlanetList *planets )
: KDialogBase( parent, "new_game_dialog", true, i18n("Start New Game"),
KDialogBase::Ok|KDialogBase::Default|KDialogBase::Cancel, KDialogBase::NoDefault, true ),
@@ -37,19 +37,19 @@ NewGameDlg::NewGameDlg( QWidget *parent, Map *pmap, PlayerList *players,
w->listPlayers->header()->hide();
// w->listPlayers->setMinimumSize( 100, 150 );
w->listPlayers->setSortColumn(-1);
- w->listPlayers->setHScrollBarMode(QScrollView::AlwaysOff);
+ w->listPlayers->setHScrollBarMode(TQScrollView::AlwaysOff);
w->sliderPlayers->setMinimumWidth(270);
w->sliderPlanets->setMinimumWidth(270);
w->newPlayer->setMaxLength( 8 );
- connect(w->sliderPlayers, SIGNAL(valueChanged(int)), this, SLOT(slotPlayerCount(int)));
- connect(w->sliderPlanets, SIGNAL(valueChanged(int)), this, SLOT(slotNewMap()));
- connect(w->sliderTurns, SIGNAL(valueChanged(int)), this, SLOT(slotTurns()));
- connect(w->rejectMap, SIGNAL(clicked()), this, SLOT(slotNewMap()));
- connect(w->newPlayer, SIGNAL(textChanged(const QString &)), this, SLOT(slotNewPlayer()));
- connect(w->newPlayer, SIGNAL(returnPressed()), this, SLOT(slotAddPlayer()));
- connect(w->addPlayer, SIGNAL(clicked()), this, SLOT(slotAddPlayer()));
+ connect(w->sliderPlayers, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotPlayerCount(int)));
+ connect(w->sliderPlanets, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotNewMap()));
+ connect(w->sliderTurns, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotTurns()));
+ connect(w->rejectMap, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewMap()));
+ connect(w->newPlayer, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotNewPlayer()));
+ connect(w->newPlayer, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotAddPlayer()));
+ connect(w->addPlayer, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddPlayer()));
init();
@@ -93,12 +93,12 @@ NewGameDlg::init()
// Restore player names
int plrNum = 0;
- for( QListViewItem *item = w->listPlayers->firstChild();
+ for( TQListViewItem *item = w->listPlayers->firstChild();
item; item = item->nextSibling(), plrNum++ )
{
- QString key = QString("Player_%1").arg(plrNum);
+ TQString key = TQString("Player_%1").arg(plrNum);
- QString playerName = config->readEntry(key);
+ TQString playerName = config->readEntry(key);
if (playerName.isEmpty())
continue;
@@ -120,11 +120,11 @@ NewGameDlg::slotNewPlayer()
void
NewGameDlg::slotAddPlayer()
{
- QString playerName = w->newPlayer->text();
+ TQString playerName = w->newPlayer->text();
if (playerName.isEmpty())
return;
- QListViewItem *item;
+ TQListViewItem *item;
do
{
item = w->listPlayers->firstChild();
@@ -151,7 +151,7 @@ NewGameDlg::slotAddPlayer()
item->setText(1, i18n("Human Player"));
item->setText(0, playerName);
- w->newPlayer->setText(QString::null);
+ w->newPlayer->setText(TQString::null);
updateMiniMap();
updateLabels();
@@ -160,14 +160,14 @@ NewGameDlg::slotAddPlayer()
void
NewGameDlg::setPlayerCount(int playerCount)
{
- QColor PlayerColors[MAX_PLAYERS] = { QColor( 130, 130, 255 ), yellow, red, green,
- white, cyan, magenta, QColor( 235, 153, 46 ),
- QColor( 106, 157, 104 ), QColor( 131, 153, 128) };
+ TQColor PlayerColors[MAX_PLAYERS] = { TQColor( 130, 130, 255 ), yellow, red, green,
+ white, cyan, magenta, TQColor( 235, 153, 46 ),
+ TQColor( 106, 157, 104 ), TQColor( 131, 153, 128) };
int i = 0;
- QListViewItem *lastItem = 0;
- QListViewItem *item = 0;
- QListViewItem *nextItem = w->listPlayers->firstChild();
+ TQListViewItem *lastItem = 0;
+ TQListViewItem *item = 0;
+ TQListViewItem *nextItem = w->listPlayers->firstChild();
while( (item = nextItem) )
{
nextItem = item->nextSibling();
@@ -184,11 +184,11 @@ NewGameDlg::setPlayerCount(int playerCount)
while(w->listPlayers->childCount() < playerCount)
{
- QString playerName = i18n("Generated AI player name", "Comp%1").arg(i+1);
- QPixmap pm(16,16);
- QColor color(PlayerColors[i]);
+ TQString playerName = i18n("Generated AI player name", "Comp%1").arg(i+1);
+ TQPixmap pm(16,16);
+ TQColor color(PlayerColors[i]);
pm.fill(color);
- QListViewItem *item = new QListViewItem(w->listPlayers, lastItem, playerName, i18n("Computer Player"), "A", color.name());
+ TQListViewItem *item = new TQListViewItem(w->listPlayers, lastItem, playerName, i18n("Computer Player"), "A", color.name());
item->setPixmap(0, pm);
lastItem = item;
i++;
@@ -238,7 +238,7 @@ void
NewGameDlg::slotOk()
{
bool hasHumans = false;
- for( QListViewItem *item = w->listPlayers->firstChild();
+ for( TQListViewItem *item = w->listPlayers->firstChild();
item; item = item->nextSibling() )
{
bool ai = (item->text(2) == "A");
@@ -266,11 +266,11 @@ NewGameDlg::save()
config->writeEntry("NrOfTurns", w->sliderTurns->value());
int plrNum = 0;
- for( QListViewItem *item = w->listPlayers->firstChild();
+ for( TQListViewItem *item = w->listPlayers->firstChild();
item; item = item->nextSibling() )
{
- QString key = QString("Player_%1").arg(plrNum);
- QString playerName = item->text(0);
+ TQString key = TQString("Player_%1").arg(plrNum);
+ TQString playerName = item->text(0);
bool ai = (item->text(2) == "A");
if (ai)
{
@@ -307,12 +307,12 @@ NewGameDlg::updateMiniMap()
// Make player list
// Does the name already exist in the list
int plrNum = 0;
- for( QListViewItem *item = w->listPlayers->firstChild();
+ for( TQListViewItem *item = w->listPlayers->firstChild();
item; item = item->nextSibling() )
{
- QString playerName = item->text(0);
+ TQString playerName = item->text(0);
bool ai = (item->text(2) == "A");
- QColor color(item->text(3));
+ TQColor color(item->text(3));
plrList->append( Player::createPlayer( playerName, color, plrNum, ai ));
plrNum++;
}