summaryrefslogtreecommitdiffstats
path: root/kolf/newgame.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /kolf/newgame.cpp
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-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 'kolf/newgame.cpp')
-rw-r--r--kolf/newgame.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/kolf/newgame.cpp b/kolf/newgame.cpp
index 22c6b785..2fd048c1 100644
--- a/kolf/newgame.cpp
+++ b/kolf/newgame.cpp
@@ -35,8 +35,8 @@
#include "newgame.h"
#include "game.h"
-NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name)
- : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, parent, _name)
+NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *tqparent, const char *_name)
+ : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, tqparent, _name)
{
this->enableCourses = enableCourses;
@@ -56,14 +56,14 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_
scroller = new TQScrollView(playerPage);
bigLayout->addWidget(scroller);
- layout = new TQVBox(scroller->viewport());
- if (!TQPixmapCache::find("grass", grass))
+ tqlayout = new TQVBox(scroller->viewport());
+ if (!TQPixmapCache::tqfind("grass", grass))
{
grass.load(locate("appdata", "pics/grass.png"));
TQPixmapCache::insert("grass", grass);
}
scroller->viewport()->setBackgroundPixmap(grass);
- scroller->addChild(layout);
+ scroller->addChild(tqlayout);
TQMap<TQString, TQString> entries = config->entryMap("New Game Dialog");
unsigned int i = 0;
@@ -95,7 +95,7 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_
connect(coursesLink, TQT_SIGNAL(leftClickedURL(const TQString &)), kapp, TQT_SLOT(invokeBrowser(const TQString &)));
coursePageLayout->addWidget(coursesLink);
- TQHBoxLayout *hlayout = new TQHBoxLayout(coursePageLayout, spacingHint());
+ TQHBoxLayout *htqlayout = new TQHBoxLayout(coursePageLayout, spacingHint());
// following use this group
config->setGroup("New Game Dialog Mode");
@@ -123,18 +123,18 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_
}
const TQString newName(i18n("Create New"));
- info[TQString::null] = CourseInfo(newName, newName, i18n("You"), 0, 0);
- names.append(TQString::null);
+ info[TQString()] = CourseInfo(newName, newName, i18n("You"), 0, 0);
+ names.append(TQString());
nameList.append(newName);
courseList = new KListBox(coursePage);
- hlayout->addWidget(courseList);
+ htqlayout->addWidget(courseList);
courseList->insertStringList(nameList);
courseList->setCurrentItem(curItem);
connect(courseList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(courseSelected(int)));
connect(courseList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged()));
- TQVBoxLayout *detailLayout = new TQVBoxLayout(hlayout, spacingHint());
+ TQVBoxLayout *detailLayout = new TQVBoxLayout(htqlayout, spacingHint());
name = new TQLabel(coursePage);
detailLayout->addWidget(name);
author = new TQLabel(coursePage);
@@ -170,15 +170,15 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_
// options page
optionsPage = addPage(i18n("Options"), i18n("Game Options"));
- TQVBoxLayout *vlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint());
+ TQVBoxLayout *vtqlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint());
mode = new TQCheckBox(i18n("&Strict mode"), optionsPage);
- vlayout->addWidget(mode);
+ vtqlayout->addWidget(mode);
mode->setChecked(config->readBoolEntry("competition", false));
TQLabel *desc = new TQLabel(i18n("In strict mode, undo, editing, and switching holes is not allowed. This is generally for competition. Only in strict mode are highscores kept."), optionsPage);
desc->setTextFormat(RichText);
- vlayout->addWidget(desc);
+ vtqlayout->addWidget(desc);
}
void NewGameDialog::slotOk()
@@ -199,7 +199,7 @@ void NewGameDialog::slotOk()
PlayerEditor *curEditor = 0;
int i = 0;
for (curEditor = editors.first(); curEditor; curEditor = editors.next(), ++i)
- config->writeEntry(TQString::number(i) + curEditor->name(), curEditor->color().name());
+ config->writeEntry(TQString::number(i) + curEditor->name(), TQString(curEditor->color().name()));
config->sync();
@@ -212,11 +212,11 @@ void NewGameDialog::courseSelected(int index)
CourseInfo &curinfo = info[currentCourse];
- name->setText(TQString("<strong>%1</strong>").arg(curinfo.name));
+ name->setText(TQString("<strong>%1</strong>").tqarg(curinfo.name));
- author->setText(i18n("By %1").arg(curinfo.author));
- par->setText(i18n("Par %1").arg(curinfo.par));
- holes->setText(i18n("%1 Holes").arg(curinfo.holes));
+ author->setText(i18n("By %1").tqarg(curinfo.author));
+ par->setText(i18n("Par %1").tqarg(curinfo.par));
+ holes->setText(i18n("%1 Holes").tqarg(curinfo.holes));
}
void NewGameDialog::showHighscores()
@@ -224,7 +224,7 @@ void NewGameDialog::showHighscores()
KScoreDialog *scoreDialog = new KScoreDialog(KScoreDialog::Name | KScoreDialog::Custom1 | KScoreDialog::Score, this);
scoreDialog->addField(KScoreDialog::Custom1, i18n("Par"), "Par");
scoreDialog->setConfigGroup(info[currentCourse].untranslatedName + TQString(" Highscores"));
- scoreDialog->setComment(i18n("High Scores for %1").arg(info[currentCourse].name));
+ scoreDialog->setComment(i18n("High Scores for %1").tqarg(info[currentCourse].name));
scoreDialog->show();
}
@@ -235,7 +235,7 @@ void NewGameDialog::removeCourse()
return;
TQString file = *names.at(curItem);
- if (externCourses.contains(file) < 1)
+ if (externCourses.tqcontains(file) < 1)
return;
names.remove(file);
@@ -248,18 +248,18 @@ void NewGameDialog::removeCourse()
void NewGameDialog::selectionChanged()
{
const int curItem = courseList->currentItem();
- remove->setEnabled(!(curItem < 0 || externCourses.contains(*names.at(curItem)) < 1));
+ remove->setEnabled(!(curItem < 0 || externCourses.tqcontains(*names.at(curItem)) < 1));
}
void NewGameDialog::addCourse()
{
- TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::fromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course"));
+ TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::tqfromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course"));
bool hasDuplicates = false;
for (TQStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt)
{
- if (names.contains(*fileIt) > 0)
+ if (names.tqcontains(*fileIt) > 0)
{
hasDuplicates = true;
continue;
@@ -287,7 +287,7 @@ void NewGameDialog::addPlayer()
if (editors.count() >= startColors.count())
return;
- editors.append(new PlayerEditor(i18n("Player %1").arg(editors.count() + 1), *startColors.at(editors.count()), layout));
+ editors.append(new PlayerEditor(i18n("Player %1").tqarg(editors.count() + 1), *startColors.at(editors.count()), tqlayout));
editors.last()->show();
connect(editors.last(), TQT_SIGNAL(deleteEditor(PlayerEditor *)), this, TQT_SLOT(deleteEditor(PlayerEditor *)));
@@ -311,12 +311,12 @@ void NewGameDialog::enableButtons()
/////////////////////////
-PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *parent, const char *_name)
- : TQWidget(parent, _name)
+PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *tqparent, const char *_name)
+ : TQWidget(tqparent, _name)
{
- TQHBoxLayout *layout = new TQHBoxLayout(this, KDialogBase::spacingHint());
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(this, KDialogBase::spacingHint());
- if (!TQPixmapCache::find("grass", grass))
+ if (!TQPixmapCache::tqfind("grass", grass))
{
grass.load(locate("appdata", "pics/grass.png"));
TQPixmapCache::insert("grass", grass);
@@ -324,17 +324,17 @@ PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *par
setBackgroundPixmap(grass);
editor = new KLineEdit(this);
- layout->addWidget(editor);
+ tqlayout->addWidget(editor);
editor->setFrame(false);
editor->setText(startName);
- layout->addStretch();
- layout->addWidget(colorButton = new KColorButton(startColor, this));
+ tqlayout->addStretch();
+ tqlayout->addWidget(colorButton = new KColorButton(startColor, this));
colorButton->setAutoMask(true);
colorButton->setBackgroundPixmap(grass);
KPushButton *remove = new KPushButton(i18n("Remove"), this);
remove->setAutoMask(true);
- layout->addWidget(remove);
+ tqlayout->addWidget(remove);
remove->setBackgroundPixmap(grass);
connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeMe()));
}