summaryrefslogtreecommitdiffstats
path: root/libkdegames/highscore/kscoredialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkdegames/highscore/kscoredialog.cpp')
-rw-r--r--libkdegames/highscore/kscoredialog.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/libkdegames/highscore/kscoredialog.cpp b/libkdegames/highscore/kscoredialog.cpp
index 37155650..7bed0c6b 100644
--- a/libkdegames/highscore/kscoredialog.cpp
+++ b/libkdegames/highscore/kscoredialog.cpp
@@ -24,13 +24,13 @@ this software.
#include "config.h"
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qwidgetstack.h>
-#include <qtimer.h>
-#include <qevent.h>
-#include <qptrvector.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqwidgetstack.h>
+#include <tqtimer.h>
+#include <tqevent.h>
+#include <tqptrvector.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -42,29 +42,29 @@ this software.
class KScoreDialog::KScoreDialogPrivate
{
public:
- QPtrList<FieldInfo> scores;
- QWidget *page;
- QGridLayout *layout;
- QLineEdit *edit;
- QPtrVector<QWidgetStack> stack;
- QPtrVector<QLabel> labels;
- QLabel *commentLabel;
- QString comment;
+ TQPtrList<FieldInfo> scores;
+ TQWidget *page;
+ TQGridLayout *layout;
+ TQLineEdit *edit;
+ TQPtrVector<TQWidgetStack> stack;
+ TQPtrVector<TQLabel> labels;
+ TQLabel *commentLabel;
+ TQString comment;
int fields;
int newName;
int latest;
int nrCols;
bool loaded;
- QString configGroup;
+ TQString configGroup;
- QMap<int, int> col;
- QMap<int, QString> header;
- QMap<int, QString> key;
- QString player;
+ TQMap<int, int> col;
+ TQMap<int, TQString> header;
+ TQMap<int, TQString> key;
+ TQString player;
};
-KScoreDialog::KScoreDialog(int fields, QWidget *parent, const char *oname)
+KScoreDialog::KScoreDialog(int fields, TQWidget *parent, const char *oname)
: KDialogBase(parent, oname, true, i18n("High Scores"), Ok, Ok, true)
{
d = new KScoreDialogPrivate();
@@ -90,7 +90,7 @@ KScoreDialog::KScoreDialog(int fields, QWidget *parent, const char *oname)
d->key[Score] = "Score";
d->page = makeMainWidget();
- connect(this, SIGNAL(okClicked()), SLOT(slotGotName()));
+ connect(this, TQT_SIGNAL(okClicked()), TQT_SLOT(slotGotName()));
}
KScoreDialog::~KScoreDialog()
@@ -98,18 +98,18 @@ KScoreDialog::~KScoreDialog()
delete d;
}
-void KScoreDialog::setConfigGroup(const QString &group)
+void KScoreDialog::setConfigGroup(const TQString &group)
{
d->configGroup = group;
d->loaded = false;
}
-void KScoreDialog::setComment(const QString &comment)
+void KScoreDialog::setComment(const TQString &comment)
{
d->comment = comment;
}
-void KScoreDialog::addField(int field, const QString &header, const QString &key)
+void KScoreDialog::addField(int field, const TQString &header, const TQString &key)
{
d->fields |= field;
d->header[field] = header;
@@ -126,19 +126,19 @@ void KScoreDialog::setupDialog()
d->col[field] = d->nrCols++;
}
- d->layout = new QGridLayout(d->page, 15, d->nrCols, marginHint() + 20, spacingHint());
+ d->layout = new TQGridLayout(d->page, 15, d->nrCols, marginHint() + 20, spacingHint());
d->layout->addRowSpacing(4, 15);
- d->commentLabel = new QLabel(d->page);
+ d->commentLabel = new TQLabel(d->page);
d->commentLabel->setAlignment(AlignVCenter | AlignHCenter);
d->layout->addMultiCellWidget(d->commentLabel, 1, 1, 0, d->nrCols-1);
- QFont bold = font();
+ TQFont bold = font();
bold.setBold(true);
- QLabel *label;
+ TQLabel *label;
d->layout->addColSpacing(0, 50);
- label = new QLabel(i18n("Rank"), d->page);
+ label = new TQLabel(i18n("Rank"), d->page);
d->layout->addWidget(label, 3, 0);
label->setFont(bold);
@@ -148,7 +148,7 @@ void KScoreDialog::setupDialog()
{
d->layout->addColSpacing(d->col[field], 50);
- label = new QLabel(d->header[field], d->page);
+ label = new TQLabel(d->header[field], d->page);
d->layout->addWidget(label, 3, d->col[field], field <= Name ? AlignLeft : AlignRight);
label->setFont(bold);
}
@@ -160,19 +160,19 @@ void KScoreDialog::setupDialog()
d->labels.resize(d->nrCols * 10);
d->stack.resize(10);
- QString num;
+ TQString num;
for (int i = 1; i <= 10; ++i) {
- QLabel *label;
+ TQLabel *label;
num.setNum(i);
- label = new QLabel(i18n("#%1").arg(num), d->page);
+ label = new TQLabel(i18n("#%1").arg(num), d->page);
d->labels.insert((i-1)*d->nrCols + 0, label);
d->layout->addWidget(label, i+4, 0);
if (d->fields & Name)
{
- QWidgetStack *stack = new QWidgetStack(d->page);
+ TQWidgetStack *stack = new TQWidgetStack(d->page);
d->stack.insert(i-1, stack);
d->layout->addWidget(stack, i+4, d->col[Name]);
- label = new QLabel(d->page);
+ label = new TQLabel(d->page);
d->labels.insert((i-1)*d->nrCols + d->col[Name], label);
stack->addWidget(label);
stack->raiseWidget(label);
@@ -181,7 +181,7 @@ void KScoreDialog::setupDialog()
{
if (d->fields & field)
{
- label = new QLabel(d->page);
+ label = new TQLabel(d->page);
d->labels.insert((i-1)*d->nrCols + d->col[field], label);
d->layout->addWidget(label, i+4, d->col[field], AlignRight);
}
@@ -200,7 +200,7 @@ void KScoreDialog::aboutToShow()
d->commentLabel->setText(d->comment);
if (d->comment.isEmpty())
{
- d->commentLabel->setMinimumSize(QSize(1,1));
+ d->commentLabel->setMinimumSize(TQSize(1,1));
d->commentLabel->hide();
d->layout->addRowSpacing(0, -15);
d->layout->addRowSpacing(2, -15);
@@ -212,15 +212,15 @@ void KScoreDialog::aboutToShow()
d->layout->addRowSpacing(0, -10);
d->layout->addRowSpacing(2, 10);
}
- d->comment = QString::null;
+ d->comment = TQString::null;
- QFont normal = font();
- QFont bold = normal;
+ TQFont normal = font();
+ TQFont bold = normal;
bold.setBold(true);
- QString num;
+ TQString num;
for (int i = 1; i <= 10; ++i) {
- QLabel *label;
+ TQLabel *label;
num.setNum(i);
FieldInfo *score = d->scores.at(i-1);
label = d->labels[(i-1)*d->nrCols + 0];
@@ -233,14 +233,14 @@ void KScoreDialog::aboutToShow()
{
if (d->newName == i)
{
- QWidgetStack *stack = d->stack[i-1];
- d->edit = new QLineEdit(d->player, stack);
+ TQWidgetStack *stack = d->stack[i-1];
+ d->edit = new TQLineEdit(d->player, stack);
d->edit->setMinimumWidth(40);
stack->addWidget(d->edit);
stack->raiseWidget(d->edit);
d->edit->setFocus();
- connect(d->edit, SIGNAL(returnPressed()),
- this, SLOT(slotGotReturn()));
+ connect(d->edit, TQT_SIGNAL(returnPressed()),
+ this, TQT_SLOT(slotGotReturn()));
}
else
{
@@ -272,14 +272,14 @@ void KScoreDialog::aboutToShow()
void KScoreDialog::loadScores()
{
- QString key, value;
+ TQString key, value;
d->loaded = true;
d->scores.clear();
KConfigGroup config(kapp->config(), d->configGroup.utf8());
d->player = config.readEntry("LastPlayer");
- QString num;
+ TQString num;
for (int i = 1; i <= 10; ++i) {
num.setNum(i);
FieldInfo *score = new FieldInfo();
@@ -297,12 +297,12 @@ void KScoreDialog::loadScores()
void KScoreDialog::saveScores()
{
- QString key, value;
+ TQString key, value;
KConfigGroup config(kapp->config(), d->configGroup.utf8());
config.writeEntry("LastPlayer", d->player);
- QString num;
+ TQString num;
for (int i = 1; i <= 10; ++i) {
num.setNum(i);
FieldInfo *score = d->scores.at(i-1);
@@ -365,7 +365,7 @@ void KScoreDialog::show()
void KScoreDialog::slotGotReturn()
{
- QTimer::singleShot(0, this, SLOT(slotGotName()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotGotName()));
}
void KScoreDialog::slotGotName()
@@ -377,10 +377,10 @@ void KScoreDialog::slotGotName()
(*d->scores.at(d->newName-1))[Name] = d->player;
saveScores();
- QFont bold = font();
+ TQFont bold = font();
bold.setBold(true);
- QLabel *label = d->labels[(d->newName-1)*d->nrCols + d->col[Name]];
+ TQLabel *label = d->labels[(d->newName-1)*d->nrCols + d->col[Name]];
label->setFont(bold);
label->setText(d->player);
d->stack[(d->newName-1)]->raiseWidget(label);
@@ -397,7 +397,7 @@ int KScoreDialog::highScore()
return (*d->scores.first())[Score].toInt();
}
-void KScoreDialog::keyPressEvent( QKeyEvent *ev)
+void KScoreDialog::keyPressEvent( TQKeyEvent *ev)
{
if ((d->newName != -1) && (ev->key() == Key_Return))
{