summaryrefslogtreecommitdiff
path: root/src/gui/trade.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-03-19 20:43:10 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-03-19 20:43:10 +0000
commit654d24e74c56d240b8d622840c135e22a029636d (patch)
tree5eb8b94f7832bdbb6d21c7ded6e6da6b5f8f3464 /src/gui/trade.cpp
parent3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (diff)
downloadmana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.gz
mana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.bz2
mana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.xz
mana-client-654d24e74c56d240b8d622840c135e22a029636d.zip
Unreverted latest change by Doener due to my lack of proper communication abilities.
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r--src/gui/trade.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp
index ee7bca06..9b98fa09 100644
--- a/src/gui/trade.cpp
+++ b/src/gui/trade.cpp
@@ -43,6 +43,8 @@
#include "../resources/iteminfo.h"
+#include "../utils/tostring.h"
+
TradeWindow::TradeWindow(Network *network):
Window("Trade: You"),
mNetwork(network),
@@ -130,9 +132,7 @@ TradeWindow::~TradeWindow()
void TradeWindow::addMoney(int amount)
{
- std::stringstream tempMoney;
- tempMoney << "You get: " << amount << "z";
- mMoneyLabel->setCaption(tempMoney.str());
+ mMoneyLabel->setCaption("You get: " + toString(amount) + "z");
mMoneyLabel->adjustSize();
}
@@ -292,14 +292,12 @@ void TradeWindow::action(const std::string &eventId)
}
else if (eventId == "ok")
{
- std::stringstream tempMoney[2];
- tempMoney[0] << mMoneyField->getText();
+ std::stringstream tempMoney(mMoneyField->getText());
int tempInt;
- if (tempMoney[0] >> tempInt)
+ if (tempMoney >> tempInt)
{
- tempMoney[1] << tempInt;
- mMoneyField->setText(tempMoney[1].str());
-
+ mMoneyField->setText(toString(tempInt));
+
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST);
outMsg.writeInt16(0);