summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/gui/buy.cpp8
-rw-r--r--src/gui/sell.cpp5
3 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c12c3bb..54dcddd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-12 Eugenio Favalli <elvenprogrammer@gmail.com>
+
+ * src/buy.cpp, src/sell.cpp: Resetting quantity to 0 after selecting other
+ items in buy/sell dialogs.
+
2005-08-11 Andrej Sinicyn <andrej4000@gmail.com>
* src/resources/image.cpp: Little cleanup and simplification.
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index 86ea764b..ecb1343e 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -164,6 +164,14 @@ void BuyDialog::action(const std::string& eventId)
slider->setEnabled(true);
increaseButton->setEnabled(true);
m_amountItems = 0;
+ slider->setValue(0);
+ oss << m_amountItems;
+ quantityLabel->setCaption(oss.str());
+ quantityLabel->adjustSize();
+ oss.str("price : 0 GP");
+ moneyLabel->setCaption(oss.str());
+ moneyLabel->adjustSize();
+ decreaseButton->setEnabled(false);
m_maxItems = m_money / shopInventory[selectedItem].price;
}
else
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index ae432a43..ed7658f2 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -148,9 +148,14 @@ void SellDialog::action(const std::string& eventId)
{
slider->setEnabled(true);
increaseButton->setEnabled(true);
+ decreaseButton->setEnabled(false);
m_maxItems = shopInventory[selectedItem].quantity;
m_amountItems = 0;
+ slider->setValue(0);
+ oss << m_amountItems;
+ quantityLabel->setCaption(oss.str());
+ quantityLabel->adjustSize();
}
else
{