summaryrefslogtreecommitdiffstats
path: root/atlantik/libatlantikui/trade_widget.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 /atlantik/libatlantikui/trade_widget.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 'atlantik/libatlantikui/trade_widget.cpp')
-rw-r--r--atlantik/libatlantikui/trade_widget.cpp104
1 files changed, 52 insertions, 52 deletions
diff --git a/atlantik/libatlantikui/trade_widget.cpp b/atlantik/libatlantikui/trade_widget.cpp
index b2658abb..be8b2749 100644
--- a/atlantik/libatlantikui/trade_widget.cpp
+++ b/atlantik/libatlantikui/trade_widget.cpp
@@ -16,15 +16,15 @@
#include <iostream>
-#include <qlayout.h>
-#include <qhgroupbox.h>
-#include <qheader.h>
-#include <qpopupmenu.h>
-#include <qcursor.h>
-#include <qvalidator.h>
-#include <qmap.h>
-#include <qlabel.h>
-#include <qspinbox.h>
+#include <tqlayout.h>
+#include <tqhgroupbox.h>
+#include <tqheader.h>
+#include <tqpopupmenu.h>
+#include <tqcursor.h>
+#include <tqvalidator.h>
+#include <tqmap.h>
+#include <tqlabel.h>
+#include <tqspinbox.h>
#include <klocale.h>
#include <klistview.h>
@@ -44,8 +44,8 @@
#include "trade_widget.moc"
-TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *parent, const char *name)
- : QWidget(parent, name,
+TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *parent, const char *name)
+ : TQWidget(parent, name,
WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title |
WStyle_Minimize | WStyle_ContextHelp )
{
@@ -54,21 +54,21 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa
setCaption(i18n("Trade %1").arg(trade->tradeId()));
- QVBoxLayout *listCompBox = new QVBoxLayout(this, KDialog::marginHint());
+ TQVBoxLayout *listCompBox = new TQVBoxLayout(this, KDialog::marginHint());
- m_updateComponentBox = new QHGroupBox(i18n("Add Component"), this);
+ m_updateComponentBox = new TQHGroupBox(i18n("Add Component"), this);
listCompBox->addWidget(m_updateComponentBox);
m_editTypeCombo = new KComboBox(m_updateComponentBox);
m_editTypeCombo->insertItem(i18n("Estate"));
m_editTypeCombo->insertItem(i18n("Money"));
- connect(m_editTypeCombo, SIGNAL(activated(int)), this, SLOT(setTypeCombo(int)));
+ connect(m_editTypeCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setTypeCombo(int)));
m_estateCombo = new KComboBox(m_updateComponentBox);
- QPtrList<Estate> estateList = m_atlanticCore->estates();
+ TQPtrList<Estate> estateList = m_atlanticCore->estates();
Estate *estate;
- for (QPtrListIterator<Estate> it(estateList); *it; ++it)
+ for (TQPtrListIterator<Estate> it(estateList); *it; ++it)
{
if ((estate = *it) && estate->isOwned())
{
@@ -78,22 +78,22 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa
}
}
- connect(m_estateCombo, SIGNAL(activated(int)), this, SLOT(setEstateCombo(int)));
+ connect(m_estateCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setEstateCombo(int)));
- m_moneyBox = new QSpinBox(0, 10000, 1, m_updateComponentBox);
+ m_moneyBox = new TQSpinBox(0, 10000, 1, m_updateComponentBox);
- QPtrList<Player> playerList = m_atlanticCore->players();
+ TQPtrList<Player> playerList = m_atlanticCore->players();
Player *player, *pSelf = m_atlanticCore->playerSelf();
- m_fromLabel = new QLabel(m_updateComponentBox);
+ m_fromLabel = new TQLabel(m_updateComponentBox);
m_fromLabel->setText(i18n("From"));
m_playerFromCombo = new KComboBox(m_updateComponentBox);
- m_toLabel = new QLabel(m_updateComponentBox);
+ m_toLabel = new TQLabel(m_updateComponentBox);
m_toLabel->setText(i18n("To"));
m_playerTargetCombo = new KComboBox(m_updateComponentBox);
- for (QPtrListIterator<Player> it(playerList); *it; ++it)
+ for (TQPtrListIterator<Player> it(playerList); *it; ++it)
{
if ((player = *it) && player->game() == pSelf->game())
{
@@ -105,14 +105,14 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa
m_playerTargetMap[m_playerTargetCombo->count() - 1] = player;
m_playerTargetRevMap[player] = m_playerTargetCombo->count() - 1;
- connect(player, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *)));
+ connect(player, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *)));
}
}
m_updateButton = new KPushButton(i18n("Update"), m_updateComponentBox);
m_updateButton->setEnabled(false);
- connect(m_updateButton, SIGNAL(clicked()), this, SLOT(updateComponent()));
+ connect(m_updateButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateComponent()));
m_componentList = new KListView(this, "componentList");
listCompBox->addWidget(m_componentList);
@@ -122,26 +122,26 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa
m_componentList->addColumn(i18n("Player"));
m_componentList->addColumn(i18n("Item"));
- connect(m_componentList, SIGNAL(contextMenu(KListView*, QListViewItem *, const QPoint&)), SLOT(contextMenu(KListView *, QListViewItem *, const QPoint&)));
- connect(m_componentList, SIGNAL(clicked(QListViewItem *)), this, SLOT(setCombos(QListViewItem *)));
+ connect(m_componentList, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem *, const TQPoint&)), TQT_SLOT(contextMenu(KListView *, TQListViewItem *, const TQPoint&)));
+ connect(m_componentList, TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(setCombos(TQListViewItem *)));
- QHBoxLayout *actionBox = new QHBoxLayout(this, 0, KDialog::spacingHint());
+ TQHBoxLayout *actionBox = new TQHBoxLayout(this, 0, KDialog::spacingHint());
listCompBox->addItem(actionBox);
- actionBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
+ actionBox->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
m_rejectButton = new KPushButton(BarIcon("cancel", KIcon::SizeSmall), i18n("Reject"), this);
actionBox->addWidget(m_rejectButton);
- connect(m_rejectButton, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(m_rejectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject()));
m_acceptButton = new KPushButton(BarIcon("ok", KIcon::SizeSmall), i18n("Accept"), this);
// m_acceptButton->setEnabled(false);
actionBox->addWidget(m_acceptButton);
- connect(m_acceptButton, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(m_acceptButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()));
- m_status = new QLabel(this);
+ m_status = new TQLabel(this);
listCompBox->addWidget(m_status);
m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).arg( m_trade->count( true ) ).arg( m_trade->count( false ) ) );
@@ -149,14 +149,14 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa
// mPlayerList->setRootIsDecorated(true);
// mPlayerList->setResizeMode(KListView::AllColumns);
- connect(m_trade, SIGNAL(itemAdded(TradeItem *)), this, SLOT(tradeItemAdded(TradeItem *)));
- connect(m_trade, SIGNAL(itemRemoved(TradeItem *)), this, SLOT(tradeItemRemoved(TradeItem *)));
- connect(m_trade, SIGNAL(changed(Trade *)), this, SLOT(tradeChanged()));
- connect(m_trade, SIGNAL(rejected(Player *)), this, SLOT(tradeRejected(Player *)));
- connect(this, SIGNAL(updateEstate(Trade *, Estate *, Player *)), m_trade, SIGNAL(updateEstate(Trade *, Estate *, Player *)));
- connect(this, SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)), m_trade, SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)));
- connect(this, SIGNAL(reject(Trade *)), m_trade, SIGNAL(reject(Trade *)));
- connect(this, SIGNAL(accept(Trade *)), m_trade, SIGNAL(accept(Trade *)));
+ connect(m_trade, TQT_SIGNAL(itemAdded(TradeItem *)), this, TQT_SLOT(tradeItemAdded(TradeItem *)));
+ connect(m_trade, TQT_SIGNAL(itemRemoved(TradeItem *)), this, TQT_SLOT(tradeItemRemoved(TradeItem *)));
+ connect(m_trade, TQT_SIGNAL(changed(Trade *)), this, TQT_SLOT(tradeChanged()));
+ connect(m_trade, TQT_SIGNAL(rejected(Player *)), this, TQT_SLOT(tradeRejected(Player *)));
+ connect(this, TQT_SIGNAL(updateEstate(Trade *, Estate *, Player *)), m_trade, TQT_SIGNAL(updateEstate(Trade *, Estate *, Player *)));
+ connect(this, TQT_SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)), m_trade, TQT_SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)));
+ connect(this, TQT_SIGNAL(reject(Trade *)), m_trade, TQT_SIGNAL(reject(Trade *)));
+ connect(this, TQT_SIGNAL(accept(Trade *)), m_trade, TQT_SIGNAL(accept(Trade *)));
setTypeCombo(m_editTypeCombo->currentItem());
setEstateCombo(m_estateCombo->currentItem());
@@ -164,7 +164,7 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, QWidget *pa
m_contextTradeItem = 0;
}
-void TradeDisplay::closeEvent(QCloseEvent *e)
+void TradeDisplay::closeEvent(TQCloseEvent *e)
{
// Don't send network event when trade is already rejected
if (m_trade->isRejected())
@@ -177,11 +177,11 @@ void TradeDisplay::closeEvent(QCloseEvent *e)
void TradeDisplay::tradeItemAdded(TradeItem *tradeItem)
{
- KListViewItem *item = new KListViewItem(m_componentList, (tradeItem->from() ? tradeItem->from()->name() : QString("?")), i18n("gives is transitive ;)", "gives"), (tradeItem->to() ? tradeItem->to()->name() : QString("?")), tradeItem->text());
- connect(tradeItem, SIGNAL(changed(TradeItem *)), this, SLOT(tradeItemChanged(TradeItem *)));
+ KListViewItem *item = new KListViewItem(m_componentList, (tradeItem->from() ? tradeItem->from()->name() : TQString("?")), i18n("gives is transitive ;)", "gives"), (tradeItem->to() ? tradeItem->to()->name() : TQString("?")), tradeItem->text());
+ connect(tradeItem, TQT_SIGNAL(changed(TradeItem *)), this, TQT_SLOT(tradeItemChanged(TradeItem *)));
- item->setPixmap(0, QPixmap(SmallIcon("personal")));
- item->setPixmap(2, QPixmap(SmallIcon("personal")));
+ item->setPixmap(0, TQPixmap(SmallIcon("personal")));
+ item->setPixmap(2, TQPixmap(SmallIcon("personal")));
if (TradeEstate *tradeEstate = dynamic_cast<TradeEstate*>(tradeItem))
item->setPixmap(3, PortfolioEstate::drawPixmap(tradeEstate->estate()));
@@ -204,10 +204,10 @@ void TradeDisplay::tradeItemChanged(TradeItem *t)
KListViewItem *item = m_componentMap[t];
if (item)
{
- item->setText(0, t->from() ? t->from()->name() : QString("?"));
- item->setPixmap(0, QPixmap(SmallIcon("personal")));
- item->setText(2, t->to() ? t->to()->name() : QString("?"));
- item->setPixmap(2, QPixmap(SmallIcon("personal")));
+ item->setText(0, t->from() ? t->from()->name() : TQString("?"));
+ item->setPixmap(0, TQPixmap(SmallIcon("personal")));
+ item->setText(2, t->to() ? t->to()->name() : TQString("?"));
+ item->setPixmap(2, TQPixmap(SmallIcon("personal")));
item->setText(3, t->text());
}
}
@@ -225,7 +225,7 @@ void TradeDisplay::playerChanged(Player *player)
m_playerTargetCombo->changeItem(player->name(), m_playerTargetRevMap[player]);
TradeItem *item = 0;
- for (QMap<KListViewItem *, TradeItem *>::Iterator it=m_componentRevMap.begin() ; it != m_componentRevMap.end() && (item = *it) ; ++it)
+ for (TQMap<KListViewItem *, TradeItem *>::Iterator it=m_componentRevMap.begin() ; it != m_componentRevMap.end() && (item = *it) ; ++it)
tradeItemChanged(item);
}
@@ -291,7 +291,7 @@ void TradeDisplay::setEstateCombo(int index)
m_playerFromCombo->setCurrentItem( m_playerFromRevMap[estate->owner()] );
}
-void TradeDisplay::setCombos(QListViewItem *i)
+void TradeDisplay::setCombos(TQListViewItem *i)
{
TradeItem *item = m_componentRevMap[(KListViewItem *)(i)];
if (TradeEstate *tradeEstate = dynamic_cast<TradeEstate*>(item))
@@ -348,7 +348,7 @@ void TradeDisplay::accept()
emit accept(m_trade);
}
-void TradeDisplay::contextMenu(KListView *, QListViewItem *i, const QPoint& p)
+void TradeDisplay::contextMenu(KListView *, TQListViewItem *i, const TQPoint& p)
{
m_contextTradeItem = m_componentRevMap[(KListViewItem *)(i)];
@@ -356,7 +356,7 @@ void TradeDisplay::contextMenu(KListView *, QListViewItem *i, const QPoint& p)
// rmbMenu->insertTitle( ... );
rmbMenu->insertItem(i18n("Remove From Trade"), 0);
- connect(rmbMenu, SIGNAL(activated(int)), this, SLOT(contextMenuClicked(int)));
+ connect(rmbMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(contextMenuClicked(int)));
rmbMenu->exec(p);
}