summaryrefslogtreecommitdiffstats
path: root/kbackgammon/engines/fibs/kplayerlist.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 /kbackgammon/engines/fibs/kplayerlist.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 'kbackgammon/engines/fibs/kplayerlist.cpp')
-rw-r--r--kbackgammon/engines/fibs/kplayerlist.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/kbackgammon/engines/fibs/kplayerlist.cpp b/kbackgammon/engines/fibs/kplayerlist.cpp
index 102c354d..06b724e5 100644
--- a/kbackgammon/engines/fibs/kplayerlist.cpp
+++ b/kbackgammon/engines/fibs/kplayerlist.cpp
@@ -24,15 +24,15 @@
#include "kplayerlist.moc"
#include "kplayerlist.h"
-#include <qlayout.h>
-#include <qiconset.h>
-#include <qgroupbox.h>
-#include <qpopupmenu.h>
-#include <qcheckbox.h>
-#include <qlistview.h>
-#include <qwhatsthis.h>
-#include <qdatetime.h>
-#include <qlabel.h>
+#include <tqlayout.h>
+#include <tqiconset.h>
+#include <tqgroupbox.h>
+#include <tqpopupmenu.h>
+#include <tqcheckbox.h>
+#include <tqlistview.h>
+#include <tqwhatsthis.h>
+#include <tqdatetime.h>
+#include <tqlabel.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -63,13 +63,13 @@ public:
int index, width;
bool show;
- QCheckBox *cb;
- QString key, name;
+ TQCheckBox *cb;
+ TQString key, name;
};
/*
- * Extension of the QListViewItem class that has a custom key function
+ * Extension of the TQListViewItem class that has a custom key function
* that can deal with the different items of the player list.
*/
class KFibsPlayerListLVI : public KListViewItem {
@@ -89,11 +89,11 @@ public:
/*
* Overloaded key function for sorting
*/
- virtual QString key(int col, bool) const
+ virtual TQString key(int col, bool) const
{
int real_col = _plist->cIndex(col);
- QString s = text(col);
+ TQString s = text(col);
switch (real_col) {
case KFibsPlayerList::Player:
@@ -155,7 +155,7 @@ public:
/*
* Context menus for player related commands
*/
- QPopupMenu *mPm[2];
+ TQPopupMenu *mPm[2];
/*
* ID of the invite menu in the context menu
@@ -175,22 +175,22 @@ public:
/*
* Short abbreviations for Blind, Ready, and Away.
*/
- QString mAbrv[KFibsPlayerList::MaxStatus];
+ TQString mAbrv[KFibsPlayerList::MaxStatus];
/*
* Name of the last selected player - for internal purposes
*/
- QString mUser;
+ TQString mUser;
/*
* Our own name
*/
- QString mName;
+ TQString mName;
/*
* Email address of the last selected player - for internal purposes
*/
- QString mMail;
+ TQString mMail;
};
@@ -200,7 +200,7 @@ public:
/*
* Construct the playerlist and do some initial setup
*/
-KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name)
+KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name)
: KListView(parent, name)
{
d = new KFibsPlayerListPrivate();
@@ -246,7 +246,7 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name)
d->mAbrv[Away ] = i18n("abreviate away", "A");
d->mAbrv[Ready] = i18n("abreviate ready", "R");
- d->mName = QString::null;
+ d->mName = TQString::null;
d->mWatch = false;
@@ -256,7 +256,7 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name)
*/
updateCaption();
setIcon(kapp->miniIcon());
- QWhatsThis::add(this, i18n("This window contains the player list. It shows "
+ TQWhatsThis::add(this, i18n("This window contains the player list. It shows "
"all players that are currently logged into FIBS."
"Use the right mouse button to get a context "
"menu with helpful information and commands."));
@@ -280,51 +280,51 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name)
/*
* Create context menus
*/
- d->mPm[0] = new QPopupMenu();
- d->mPm[1] = new QPopupMenu();
+ d->mPm[0] = new TQPopupMenu();
+ d->mPm[1] = new TQPopupMenu();
/*
* Create the whole set of actions
*/
d->mAct[KFibsPlayerListPrivate::Info] = new KAction(i18n("Info"),
- QIconSet(kapp->iconLoader()->loadIcon
+ TQIconSet(kapp->iconLoader()->loadIcon
("help.xpm", KIcon::Small)),
- 0, this, SLOT(slotInfo()), actions);
+ 0, this, TQT_SLOT(slotInfo()), actions);
d->mAct[KFibsPlayerListPrivate::Talk] = new KAction(i18n("Talk"),
- QIconSet(kapp->iconLoader()->loadIcon
+ TQIconSet(kapp->iconLoader()->loadIcon
(PROG_NAME "-chat.png", KIcon::Small)),
- 0, this, SLOT(slotTalk()), actions);
+ 0, this, TQT_SLOT(slotTalk()), actions);
- d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, SLOT(slotLook()), actions);
- d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, SLOT(slotWatch()), actions);
- d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, SLOT(slotUnwatch()),actions);
- d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, SLOT(slotBlind()), actions);
- d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, SLOT(slotUpdate()), actions);
+ d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, TQT_SLOT(slotLook()), actions);
+ d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, TQT_SLOT(slotWatch()), actions);
+ d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, TQT_SLOT(slotUnwatch()),actions);
+ d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, TQT_SLOT(slotBlind()), actions);
+ d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, TQT_SLOT(slotUpdate()), actions);
- d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, SLOT(slotReload()), actions);
- d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, SLOT(slotMail()), actions);
- d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, SLOT(hide()), actions);
+ d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, TQT_SLOT(slotReload()), actions);
+ d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, TQT_SLOT(slotMail()), actions);
+ d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions);
d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this,
- SLOT(slotInviteD()), actions);
+ TQT_SLOT(slotInviteD()), actions);
d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this,
- SLOT(slotInvite1()), actions);
+ TQT_SLOT(slotInvite1()), actions);
d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this,
- SLOT(slotInvite2()), actions);
+ TQT_SLOT(slotInvite2()), actions);
d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this,
- SLOT(slotInvite3()), actions);
+ TQT_SLOT(slotInvite3()), actions);
d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this,
- SLOT(slotInvite4()), actions);
+ TQT_SLOT(slotInvite4()), actions);
d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this,
- SLOT(slotInvite5()), actions);
+ TQT_SLOT(slotInvite5()), actions);
d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this,
- SLOT(slotInvite6()), actions);
+ TQT_SLOT(slotInvite6()), actions);
d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this,
- SLOT(slotInvite7()), actions);
+ TQT_SLOT(slotInvite7()), actions);
d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this,
- SLOT(slotInviteU()), actions);
+ TQT_SLOT(slotInviteU()), actions);
d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, this,
- SLOT(slotInviteR()), actions);
+ TQT_SLOT(slotInviteR()), actions);
/*
* Fill normal context menu
@@ -363,10 +363,10 @@ KFibsPlayerList::KFibsPlayerList(QWidget *parent, const char *name)
/*
* Right mouse button gets context menu, double click gets player info
*/
- connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)),
- this, SLOT(showContextMenu(KListView *, QListViewItem *, const QPoint &)));
- connect(this, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)),
- this, SLOT(getPlayerInfo(QListViewItem *, const QPoint &, int)));
+ connect(this, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint &)),
+ this, TQT_SLOT(showContextMenu(KListView *, TQListViewItem *, const TQPoint &)));
+ connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem *, const TQPoint &, int)),
+ this, TQT_SLOT(getPlayerInfo(TQListViewItem *, const TQPoint &, int)));
}
/*
@@ -444,13 +444,13 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space)
/*
* Main Widget
*/
- QWidget *w = new QWidget(nb);
- QGridLayout *gl = new QGridLayout(w, 2, 1, space);
+ TQWidget *w = new TQWidget(nb);
+ TQGridLayout *gl = new TQGridLayout(w, 2, 1, space);
/*
* Label
*/
- QGroupBox *gbl = new QGroupBox(w);
+ TQGroupBox *gbl = new TQGroupBox(w);
gbl->setTitle(i18n("Column Selection"));
gl->addWidget(gbl, 0, 0);
@@ -458,15 +458,15 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space)
/*
* Note that the first column (Player == 0) is always there
*/
- QLabel *lb = new QLabel(i18n("Select all the columns that you would\n"
+ TQLabel *lb = new TQLabel(i18n("Select all the columns that you would\n"
"like to be shown in the player list."), gbl);
for (i = 1; i < LVEnd; i++) {
- d->mCol[i]->cb = new QCheckBox(d->mCol[i]->name, gbl);
+ d->mCol[i]->cb = new TQCheckBox(d->mCol[i]->name, gbl);
d->mCol[i]->cb->setChecked(d->mCol[i]->show);
}
- gl = new QGridLayout(gbl, LVEnd, 2, 20);
+ gl = new TQGridLayout(gbl, LVEnd, 2, 20);
gl->addWidget(lb, 0, 0);
// two column layout....
@@ -483,7 +483,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space)
*/
nb->addTab(w, i18n("&Playerlist"));
- connect(nb, SIGNAL(applyButtonPressed()), this, SLOT(setupOk()));
+ connect(nb, TQT_SIGNAL(applyButtonPressed()), this, TQT_SLOT(setupOk()));
}
/*
@@ -525,7 +525,7 @@ void KFibsPlayerList::readConfig()
KConfig* config = kapp->config();
config->setGroup(name());
- QPoint pos, defpos(10, 10);
+ TQPoint pos, defpos(10, 10);
pos = config->readPointEntry("ori", &defpos);
setGeometry(pos.x(), pos.y(), config->readNumEntry("wdt",460),
config->readNumEntry("hgt",190));
@@ -562,12 +562,12 @@ void KFibsPlayerList::saveConfig()
/*
* Save selected player, update the menu entries and show the popup menu
*/
-void KFibsPlayerList::showContextMenu(KListView *, QListViewItem *i, const QPoint &p)
+void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPoint &p)
{
/*
* Get the name of the selected player
*/
- d->mUser = (i ? i->text(Player) : QString::null);
+ d->mUser = (i ? i->text(Player) : TQString::null);
d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).arg(d->mUser));
d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).arg(d->mUser));
@@ -589,7 +589,7 @@ void KFibsPlayerList::showContextMenu(KListView *, QListViewItem *i, const QPoin
d->mPm[0]->setItemEnabled(d->mInID, i && d->mName != d->mUser);
d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").arg(d->mUser));
- d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : QString::null);
+ d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString::null);
d->mAct[KFibsPlayerListPrivate::Mail]->setEnabled(!d->mMail.isEmpty());
if (i && d->mCol[Status]->show)
@@ -657,7 +657,7 @@ void KFibsPlayerList::slotLook()
*/
void KFibsPlayerList::slotMail()
{
- kapp->invokeMailer(d->mMail, QString::null);
+ kapp->invokeMailer(d->mMail, TQString::null);
}
/*
@@ -680,7 +680,7 @@ void KFibsPlayerList::slotWatch()
/*
* Request information about the selected user
*/
-void KFibsPlayerList::getPlayerInfo(QListViewItem *i, const QPoint &, int col)
+void KFibsPlayerList::getPlayerInfo(TQListViewItem *i, const TQPoint &, int col)
{
int num = cIndex(col);
if (col < 0 || num < 0 || num > 2 || i->text(num).isEmpty())
@@ -713,13 +713,13 @@ void KFibsPlayerList::slotInviteR() { emit fibsCommand("invite " + d->mUser); }
* Add or change the entry of player with the corresponding string
* from the server - rawwho
*/
-void KFibsPlayerList::changePlayer(const QString &line)
+void KFibsPlayerList::changePlayer(const TQString &line)
{
char entry[LVEnd][100];
char ready[2], away[2];
- QListViewItem *i;
- QDateTime fromEpoch;
- QString str_entry[LVEnd], tmp;
+ TQListViewItem *i;
+ TQDateTime fromEpoch;
+ TQString str_entry[LVEnd], tmp;
entry[Status][0] = '\0';
@@ -746,7 +746,7 @@ void KFibsPlayerList::changePlayer(const QString &line)
setUpdatesEnabled(false);
// try to find the item in the list
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
for ( ; it.current(); ++it) {
if (it.current()->text(0) == str_entry[Player]) {
i = it.current();
@@ -789,9 +789,9 @@ void KFibsPlayerList::changePlayer(const QString &line)
/*
* Remove player from the list
*/
-void KFibsPlayerList::deletePlayer(const QString &player)
+void KFibsPlayerList::deletePlayer(const TQString &player)
{
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
for ( ; it.current(); ++it) {
if (it.current()->text(0) == player) {
if (it.current()->text(Client).contains(PROG_NAME))
@@ -808,14 +808,14 @@ void KFibsPlayerList::deletePlayer(const QString &player)
/*
* Set/Unset the status stat in the corresponding column of the list
*/
-void KFibsPlayerList::changePlayerStatus(const QString &player, int stat, bool flag)
+void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool flag)
{
- QListViewItem *i = 0;
+ TQListViewItem *i = 0;
/*
* Find the correct line
*/
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
for ( ; it.current(); ++it) {
if (it.current()->text(Player) == player) {
i = it.current();
@@ -847,7 +847,7 @@ int KFibsPlayerList::cIndex(int col)
/*
* Catch hide events, so the engine's menu can be update.
*/
-void KFibsPlayerList::showEvent(QShowEvent *e)
+void KFibsPlayerList::showEvent(TQShowEvent *e)
{
KListView::showEvent(e);
emit windowVisible(true);
@@ -856,7 +856,7 @@ void KFibsPlayerList::showEvent(QShowEvent *e)
/*
* Catch hide events, so the engine's menu can be update.
*/
-void KFibsPlayerList::hideEvent(QHideEvent *e)
+void KFibsPlayerList::hideEvent(TQHideEvent *e)
{
emit windowVisible(false);
KListView::hideEvent(e);
@@ -875,7 +875,7 @@ void KFibsPlayerList::stopUpdate()
* Knowing our own name allows us to disable certain menu entries for
* ourselves.
*/
-void KFibsPlayerList::setName(const QString &name)
+void KFibsPlayerList::setName(const TQString &name)
{
d->mName = name;
}
@@ -896,7 +896,7 @@ void KFibsPlayerList::clear()
{
d->mCount[0] = 0;
d->mCount[1] = 0;
- QListView::clear();
+ TQListView::clear();
}
// EOF