summaryrefslogtreecommitdiff
path: root/src/gui/buydialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-06 21:09:10 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-06 21:09:10 +0300
commit50029e25816b261dd5d9659d6da76cef7e392c27 (patch)
treef851a985de99a85c5ec1d9ebd62742134db09a79 /src/gui/buydialog.cpp
parent8e0703fab6ecc275e3cc2e30bb87027a195f80e8 (diff)
downloadplus-50029e25816b261dd5d9659d6da76cef7e392c27.tar.gz
plus-50029e25816b261dd5d9659d6da76cef7e392c27.tar.bz2
plus-50029e25816b261dd5d9659d6da76cef7e392c27.tar.xz
plus-50029e25816b261dd5d9659d6da76cef7e392c27.zip
improve buydialog.
Diffstat (limited to 'src/gui/buydialog.cpp')
-rw-r--r--src/gui/buydialog.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gui/buydialog.cpp b/src/gui/buydialog.cpp
index e19a0a8f1..a6d56e220 100644
--- a/src/gui/buydialog.cpp
+++ b/src/gui/buydialog.cpp
@@ -193,7 +193,7 @@ BuyDialog::BuyDialog(const int npcId) :
Window(_("Buy"), false, nullptr, "buy.xml"),
gcn::ActionListener(),
gcn::SelectionListener(),
- mNpcId(npcId), mMoney(0), mAmountItems(0), mMaxItems(0), mNick(""),
+ mNpcId(npcId), mMoney(0), mAmountItems(0), mMaxItems(0), mNick(),
mSortModel(nullptr),
mSortDropDown(nullptr)
{
@@ -277,9 +277,7 @@ void BuyDialog::init()
mShopItemList->addActionListener(this);
mShopItemList->addSelectionListener(this);
- ContainerPlacer placer;
- placer = getPlacer(0, 0);
-
+ ContainerPlacer placer = getPlacer(0, 0);
placer(0, 0, mScrollArea, 9, 5).setPadding(3);
placer(0, 5, mDecreaseButton);
placer(1, 5, mSlider, 4);
@@ -493,7 +491,6 @@ void BuyDialog::updateButtonsAndLabels()
if (mAmountItems > mMaxItems)
mAmountItems = mMaxItems;
- // Calculate price of pending purchase
price = mAmountItems * itemPrice;
}
}
@@ -503,14 +500,12 @@ void BuyDialog::updateButtonsAndLabels()
mAmountItems = 0;
}
- // Enable or disable buttons and slider
mIncreaseButton->setEnabled(mAmountItems < mMaxItems);
mDecreaseButton->setEnabled(mAmountItems > 1);
mBuyButton->setEnabled(mAmountItems > 0);
mSlider->setEnabled(mMaxItems > 1);
mAmountField->setEnabled(mAmountItems > 0);
- // Update quantity and money labels
mQuantityLabel->setCaption(strprintf("%d / %d", mAmountItems, mMaxItems));
// TRANSLATORS: buy dialog label
mMoneyLabel->setCaption(strprintf(_("Price: %s / Total: %s"),