summaryrefslogtreecommitdiffstats
path: root/libkdegames/highscore/kexthighscore_gui.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 /libkdegames/highscore/kexthighscore_gui.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 'libkdegames/highscore/kexthighscore_gui.cpp')
-rw-r--r--libkdegames/highscore/kexthighscore_gui.cpp190
1 files changed, 95 insertions, 95 deletions
diff --git a/libkdegames/highscore/kexthighscore_gui.cpp b/libkdegames/highscore/kexthighscore_gui.cpp
index 547a885c..3786f529 100644
--- a/libkdegames/highscore/kexthighscore_gui.cpp
+++ b/libkdegames/highscore/kexthighscore_gui.cpp
@@ -20,11 +20,11 @@
#include "kexthighscore_gui.h"
#include "kexthighscore_gui.moc"
-#include <qlayout.h>
-#include <qtextstream.h>
-#include <qheader.h>
-#include <qgrid.h>
-#include <qvgroupbox.h>
+#include <tqlayout.h>
+#include <tqtextstream.h>
+#include <tqheader.h>
+#include <tqgrid.h>
+#include <tqvgroupbox.h>
#include <kapplication.h>
#include <kmessagebox.h>
@@ -45,23 +45,23 @@ namespace KExtHighscore
{
//-----------------------------------------------------------------------------
-ShowItem::ShowItem(QListView *list, bool highlight)
+ShowItem::ShowItem(TQListView *list, bool highlight)
: KListViewItem(list), _highlight(highlight)
{}
-void ShowItem::paintCell(QPainter *p, const QColorGroup &cg,
+void ShowItem::paintCell(TQPainter *p, const TQColorGroup &cg,
int column, int width, int align)
{
- QColorGroup cgrp(cg);
- if (_highlight) cgrp.setColor(QColorGroup::Text, red);
+ TQColorGroup cgrp(cg);
+ if (_highlight) cgrp.setColor(TQColorGroup::Text, red);
KListViewItem::paintCell(p, cgrp, column, width, align);
}
//-----------------------------------------------------------------------------
-ScoresList::ScoresList(QWidget *parent)
+ScoresList::ScoresList(TQWidget *parent)
: KListView(parent)
{
- setSelectionMode(QListView::NoSelection);
+ setSelectionMode(TQListView::NoSelection);
setItemMargin(3);
setAllColumnsShowFocus(true);
setSorting(-1);
@@ -74,16 +74,16 @@ void ScoresList::addHeader(const ItemArray &items)
addLineItem(items, 0, 0);
}
-QListViewItem *ScoresList::addLine(const ItemArray &items,
+TQListViewItem *ScoresList::addLine(const ItemArray &items,
uint index, bool highlight)
{
- QListViewItem *item = new ShowItem(this, highlight);
+ TQListViewItem *item = new ShowItem(this, highlight);
addLineItem(items, index, item);
return item;
}
void ScoresList::addLineItem(const ItemArray &items,
- uint index, QListViewItem *line)
+ uint index, TQListViewItem *line)
{
uint k = 0;
for (uint i=0; i<items.size(); i++) {
@@ -99,11 +99,11 @@ void ScoresList::addLineItem(const ItemArray &items,
}
//-----------------------------------------------------------------------------
-HighscoresList::HighscoresList(QWidget *parent)
+HighscoresList::HighscoresList(TQWidget *parent)
: ScoresList(parent)
{}
-QString HighscoresList::itemText(const ItemContainer &item, uint row) const
+TQString HighscoresList::itemText(const ItemContainer &item, uint row) const
{
return item.pretty(row);
}
@@ -111,26 +111,26 @@ QString HighscoresList::itemText(const ItemContainer &item, uint row) const
void HighscoresList::load(const ItemArray &items, int highlight)
{
clear();
- QListViewItem *line = 0;
+ TQListViewItem *line = 0;
for (int j=items.nbEntries()-1; j>=0; j--) {
- QListViewItem *item = addLine(items, j, j==highlight);
+ TQListViewItem *item = addLine(items, j, j==highlight);
if ( j==highlight ) line = item;
}
if (line) ensureItemVisible(line);
}
//-----------------------------------------------------------------------------
-HighscoresWidget::HighscoresWidget(QWidget *parent)
- : QWidget(parent, "show_highscores_widget"),
+HighscoresWidget::HighscoresWidget(TQWidget *parent)
+ : TQWidget(parent, "show_highscores_widget"),
_scoresUrl(0), _playersUrl(0), _statsTab(0), _histoTab(0)
{
const ScoreInfos &s = internal->scoreInfos();
const PlayerInfos &p = internal->playerInfos();
- QVBoxLayout *vbox = new QVBoxLayout(this, KDialogBase::spacingHint());
+ TQVBoxLayout *vbox = new TQVBoxLayout(this, KDialogBase::spacingHint());
- _tw = new QTabWidget(this);
- connect(_tw, SIGNAL(currentChanged(QWidget *)), SLOT(tabChanged()));
+ _tw = new TQTabWidget(this);
+ connect(_tw, TQT_SIGNAL(currentChanged(TQWidget *)), TQT_SLOT(tabChanged()));
vbox->addWidget(_tw);
// scores tab
@@ -160,15 +160,15 @@ HighscoresWidget::HighscoresWidget(QWidget *parent)
KURL url = internal->queryURL(ManagerPrivate::Scores);
_scoresUrl = new KURLLabel(url.url(),
i18n("View world-wide highscores"), this);
- connect(_scoresUrl, SIGNAL(leftClickedURL(const QString &)),
- SLOT(showURL(const QString &)));
+ connect(_scoresUrl, TQT_SIGNAL(leftClickedURL(const TQString &)),
+ TQT_SLOT(showURL(const TQString &)));
vbox->addWidget(_scoresUrl);
url = internal->queryURL(ManagerPrivate::Players);
_playersUrl = new KURLLabel(url.url(),
i18n("View world-wide players"), this);
- connect(_playersUrl, SIGNAL(leftClickedURL(const QString &)),
- SLOT(showURL(const QString &)));
+ connect(_playersUrl, TQT_SIGNAL(leftClickedURL(const TQString &)),
+ TQT_SLOT(showURL(const TQString &)));
vbox->addWidget(_playersUrl);
}
}
@@ -179,7 +179,7 @@ void HighscoresWidget::changeTab(int i)
_tw->setCurrentPage(i);
}
-void HighscoresWidget::showURL(const QString &url) const
+void HighscoresWidget::showURL(const TQString &url) const
{
(void)new KRun(KURL(url));
}
@@ -197,7 +197,7 @@ void HighscoresWidget::load(int rank)
}
//-----------------------------------------------------------------------------
-HighscoresDialog::HighscoresDialog(int rank, QWidget *parent)
+HighscoresDialog::HighscoresDialog(int rank, TQWidget *parent)
: KDialogBase(internal->nbGameTypes()>1 ? TreeList : Plain,
i18n("Highscores"), Close|User1|User2, Close,
parent, "show_highscores", true, true,
@@ -208,25 +208,25 @@ HighscoresDialog::HighscoresDialog(int rank, QWidget *parent)
if ( internal->nbGameTypes()>1 ) {
for (uint i=0; i<internal->nbGameTypes(); i++) {
- QString title = internal->manager.gameTypeLabel(i, Manager::I18N);
- QString icon = internal->manager.gameTypeLabel(i, Manager::Icon);
- QWidget *w = addVBoxPage(title, QString::null,
+ TQString title = internal->manager.gameTypeLabel(i, Manager::I18N);
+ TQString icon = internal->manager.gameTypeLabel(i, Manager::Icon);
+ TQWidget *w = addVBoxPage(title, TQString::null,
BarIcon(icon, KIcon::SizeLarge));
if ( i==internal->gameType() ) createPage(w);
}
- connect(this, SIGNAL(aboutToShowPage(QWidget *)),
- SLOT(createPage(QWidget *)));
+ connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget *)),
+ TQT_SLOT(createPage(TQWidget *)));
showPage(internal->gameType());
} else {
- QVBoxLayout *vbox = new QVBoxLayout(plainPage());
+ TQVBoxLayout *vbox = new TQVBoxLayout(plainPage());
createPage(plainPage());
vbox->addWidget(_widgets[0]);
setMainWidget(_widgets[0]);
}
}
-void HighscoresDialog::createPage(QWidget *page)
+void HighscoresDialog::createPage(TQWidget *page)
{
internal->hsConfig().readCurrentConfig();
_current = page;
@@ -234,7 +234,7 @@ void HighscoresDialog::createPage(QWidget *page)
int i = (several ? pageIndex(page) : 0);
if ( _widgets[i]==0 ) {
_widgets[i] = new HighscoresWidget(page);
- connect(_widgets[i], SIGNAL(tabChanged(int)), SLOT(tabChanged(int)));
+ connect(_widgets[i], TQT_SIGNAL(tabChanged(int)), TQT_SLOT(tabChanged(int)));
}
uint type = internal->gameType();
if (several) internal->setGameType(i);
@@ -251,7 +251,7 @@ void HighscoresDialog::slotUser1()
void HighscoresDialog::slotUser2()
{
- KURL url = KFileDialog::getSaveURL(QString::null, QString::null, this);
+ KURL url = KFileDialog::getSaveURL(TQString::null, TQString::null, this);
if ( url.isEmpty() ) return;
if ( KIO::NetAccess::exists(url, true, this) ) {
KGuiItem gi = KStdGuiItem::save();
@@ -270,7 +270,7 @@ void HighscoresDialog::slotUser2()
//-----------------------------------------------------------------------------
LastMultipleScoresList::LastMultipleScoresList(
- const QValueVector<Score> &scores, QWidget *parent)
+ const TQValueVector<Score> &scores, TQWidget *parent)
: ScoresList(parent), _scores(scores)
{
const ScoreInfos &s = internal->scoreInfos();
@@ -279,7 +279,7 @@ LastMultipleScoresList::LastMultipleScoresList(
}
void LastMultipleScoresList::addLineItem(const ItemArray &si,
- uint index, QListViewItem *line)
+ uint index, TQListViewItem *line)
{
uint k = 1; // skip "id"
for (uint i=0; i<si.size()-2; i++) {
@@ -294,20 +294,20 @@ void LastMultipleScoresList::addLineItem(const ItemArray &si,
}
}
-QString LastMultipleScoresList::itemText(const ItemContainer &item,
+TQString LastMultipleScoresList::itemText(const ItemContainer &item,
uint row) const
{
- QString name = item.name();
+ TQString name = item.name();
if ( name=="rank" )
- return (_scores[row].type()==Won ? i18n("Winner") : QString::null);
- QVariant v = _scores[row].data(name);
+ return (_scores[row].type()==Won ? i18n("Winner") : TQString::null);
+ TQVariant v = _scores[row].data(name);
if ( name=="name" ) return v.toString();
return item.item()->pretty(row, v);
}
//-----------------------------------------------------------------------------
TotalMultipleScoresList::TotalMultipleScoresList(
- const QValueVector<Score> &scores, QWidget *parent)
+ const TQValueVector<Score> &scores, TQWidget *parent)
: ScoresList(parent), _scores(scores)
{
const ScoreInfos &s = internal->scoreInfos();
@@ -316,7 +316,7 @@ TotalMultipleScoresList::TotalMultipleScoresList(
}
void TotalMultipleScoresList::addLineItem(const ItemArray &si,
- uint index, QListViewItem *line)
+ uint index, TQListViewItem *line)
{
const PlayerInfos &pi = internal->playerInfos();
uint k = 1; // skip "id"
@@ -330,7 +330,7 @@ void TotalMultipleScoresList::addLineItem(const ItemArray &si,
}
if (line) line->setText(i, itemText(*container, index));
else {
- QString label =
+ TQString label =
(i==2 ? i18n("Won Games") : container->item()->label());
addColumn(label);
setColumnAlignment(i, container->item()->alignment());
@@ -338,90 +338,90 @@ void TotalMultipleScoresList::addLineItem(const ItemArray &si,
}
}
-QString TotalMultipleScoresList::itemText(const ItemContainer &item,
+TQString TotalMultipleScoresList::itemText(const ItemContainer &item,
uint row) const
{
- QString name = item.name();
- if ( name=="rank" ) return QString::number(_scores.size()-row);
+ TQString name = item.name();
+ if ( name=="rank" ) return TQString::number(_scores.size()-row);
if ( name=="nb games" )
- return QString::number( _scores[row].data("nb won games").toUInt() );
- QVariant v = _scores[row].data(name);
+ return TQString::number( _scores[row].data("nb won games").toUInt() );
+ TQVariant v = _scores[row].data(name);
if ( name=="name" ) return v.toString();
return item.item()->pretty(row, v);
}
//-----------------------------------------------------------------------------
-ConfigDialog::ConfigDialog(QWidget *parent)
+ConfigDialog::ConfigDialog(TQWidget *parent)
: KDialogBase(Swallow, i18n("Configure Highscores"),
Ok|Apply|Cancel, Cancel,
parent, "configure_highscores", true, true),
_saved(false), _WWHEnabled(0)
{
- QWidget *page = 0;
- QTabWidget *tab = 0;
+ TQWidget *page = 0;
+ TQTabWidget *tab = 0;
if ( internal->isWWHSAvailable() ) {
- tab = new QTabWidget(this);
+ tab = new TQTabWidget(this);
setMainWidget(tab);
- page = new QWidget(tab);
+ page = new TQWidget(tab);
tab->addTab(page, i18n("Main"));
} else {
- page = new QWidget(this);
+ page = new TQWidget(this);
setMainWidget(page);
}
- QGridLayout *pageTop =
- new QGridLayout(page, 2, 2, spacingHint(), spacingHint());
+ TQGridLayout *pageTop =
+ new TQGridLayout(page, 2, 2, spacingHint(), spacingHint());
- QLabel *label = new QLabel(i18n("Nickname:"), page);
+ TQLabel *label = new TQLabel(i18n("Nickname:"), page);
pageTop->addWidget(label, 0, 0);
- _nickname = new QLineEdit(page);
- connect(_nickname, SIGNAL(textChanged(const QString &)),
- SLOT(modifiedSlot()));
- connect(_nickname, SIGNAL(textChanged(const QString &)),
- SLOT(nickNameChanged(const QString &)));
+ _nickname = new TQLineEdit(page);
+ connect(_nickname, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(modifiedSlot()));
+ connect(_nickname, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(nickNameChanged(const TQString &)));
_nickname->setMaxLength(16);
pageTop->addWidget(_nickname, 0, 1);
- label = new QLabel(i18n("Comment:"), page);
+ label = new TQLabel(i18n("Comment:"), page);
pageTop->addWidget(label, 1, 0);
- _comment = new QLineEdit(page);
- connect(_comment, SIGNAL(textChanged(const QString &)),
- SLOT(modifiedSlot()));
+ _comment = new TQLineEdit(page);
+ connect(_comment, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(modifiedSlot()));
_comment->setMaxLength(50);
pageTop->addWidget(_comment, 1, 1);
if (tab) {
_WWHEnabled
- = new QCheckBox(i18n("World-wide highscores enabled"), page);
- connect(_WWHEnabled, SIGNAL(toggled(bool)),
- SLOT(modifiedSlot()));
+ = new TQCheckBox(i18n("World-wide highscores enabled"), page);
+ connect(_WWHEnabled, TQT_SIGNAL(toggled(bool)),
+ TQT_SLOT(modifiedSlot()));
pageTop->addMultiCellWidget(_WWHEnabled, 2, 2, 0, 1);
// advanced tab
- QWidget *page = new QWidget(tab);
+ TQWidget *page = new TQWidget(tab);
tab->addTab(page, i18n("Advanced"));
- QVBoxLayout *pageTop =
- new QVBoxLayout(page, spacingHint(), spacingHint());
+ TQVBoxLayout *pageTop =
+ new TQVBoxLayout(page, spacingHint(), spacingHint());
- QVGroupBox *group = new QVGroupBox(i18n("Registration Data"), page);
+ TQVGroupBox *group = new TQVGroupBox(i18n("Registration Data"), page);
pageTop->addWidget(group);
- QGrid *grid = new QGrid(2, group);
+ TQGrid *grid = new TQGrid(2, group);
grid->setSpacing(spacingHint());
- label = new QLabel(i18n("Nickname:"), grid);
+ label = new TQLabel(i18n("Nickname:"), grid);
_registeredName = new KLineEdit(grid);
_registeredName->setReadOnly(true);
- label = new QLabel(i18n("Key:"), grid);
+ label = new TQLabel(i18n("Key:"), grid);
_key = new KLineEdit(grid);
_key->setReadOnly(true);
KGuiItem gi = KStdGuiItem::clear();
gi.setText(i18n("Remove"));
_removeButton = new KPushButton(gi, grid);
- connect(_removeButton, SIGNAL(clicked()), SLOT(removeSlot()));
+ connect(_removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeSlot()));
}
load();
@@ -429,7 +429,7 @@ ConfigDialog::ConfigDialog(QWidget *parent)
enableButtonApply(false);
}
-void ConfigDialog::nickNameChanged(const QString &text)
+void ConfigDialog::nickNameChanged(const TQString &text)
{
enableButtonOK( !text.isEmpty() );
}
@@ -456,7 +456,7 @@ void ConfigDialog::removeSlot()
i18n("This will permanently remove your "
"registration key. You will not be able to use "
"the currently registered nickname anymore."),
- QString::null, gi);
+ TQString::null, gi);
if ( res==KMessageBox::Continue ) {
internal->playerInfos().removeKey();
_registeredName->clear();
@@ -471,7 +471,7 @@ void ConfigDialog::load()
{
internal->hsConfig().readCurrentConfig();
const PlayerInfos &infos = internal->playerInfos();
- _nickname->setText(infos.isAnonymous() ? QString::null : infos.name());
+ _nickname->setText(infos.isAnonymous() ? TQString::null : infos.name());
_comment->setText(infos.comment());
if (_WWHEnabled) {
_WWHEnabled->setChecked(infos.isWWEnabled());
@@ -491,7 +491,7 @@ bool ConfigDialog::save()
// do not bother the user with "nickname empty" if he has not
// messed with nickname settings ...
- QString newName = _nickname->text();
+ TQString newName = _nickname->text();
if ( newName.isEmpty() && !internal->playerInfos().isAnonymous()
&& !enabled ) return true;
@@ -516,28 +516,28 @@ bool ConfigDialog::save()
}
//-----------------------------------------------------------------------------
-AskNameDialog::AskNameDialog(QWidget *parent)
+AskNameDialog::AskNameDialog(TQWidget *parent)
: KDialogBase(Plain, i18n("Enter Your Nickname"), Ok | Cancel, Ok,
parent, "ask_name_dialog")
{
internal->hsConfig().readCurrentConfig();
- QVBoxLayout *top =
- new QVBoxLayout(plainPage(), marginHint(), spacingHint());
- QLabel *label =
- new QLabel(i18n("Congratulations, you have won!"), plainPage());
+ TQVBoxLayout *top =
+ new TQVBoxLayout(plainPage(), marginHint(), spacingHint());
+ TQLabel *label =
+ new TQLabel(i18n("Congratulations, you have won!"), plainPage());
top->addWidget(label);
- QHBoxLayout *hbox = new QHBoxLayout(top);
- label = new QLabel(i18n("Enter your nickname:"), plainPage());
+ TQHBoxLayout *hbox = new TQHBoxLayout(top);
+ label = new TQLabel(i18n("Enter your nickname:"), plainPage());
hbox->addWidget(label);
- _edit = new QLineEdit(plainPage());
+ _edit = new TQLineEdit(plainPage());
_edit->setFocus();
- connect(_edit, SIGNAL(textChanged(const QString &)), SLOT(nameChanged()));
+ connect(_edit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(nameChanged()));
hbox->addWidget(_edit);
top->addSpacing(spacingHint());
- _checkbox = new QCheckBox(i18n("Do not ask again."), plainPage());
+ _checkbox = new TQCheckBox(i18n("Do not ask again."), plainPage());
top->addWidget(_checkbox);
nameChanged();