summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-09-08 21:56:44 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2010-09-08 21:56:44 +0200
commit173cbf107b35fb191724e5386cf3bcf0106c80ae (patch)
treed37d120c77135230b4f7b16b648cd20027e56ecd /src/gui/inventorywindow.cpp
parentdb2f9e4c7af87074f75af14a183db41e5ccdcc21 (diff)
downloadmana-173cbf107b35fb191724e5386cf3bcf0106c80ae.tar.gz
mana-173cbf107b35fb191724e5386cf3bcf0106c80ae.tar.bz2
mana-173cbf107b35fb191724e5386cf3bcf0106c80ae.tar.xz
mana-173cbf107b35fb191724e5386cf3bcf0106c80ae.zip
Adding missing updates for buttons in InventoryWindow
Reviewed-by: Thorbjorn
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 591ebd2f..16ac5409 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -288,10 +288,18 @@ void InventoryWindow::valueChanged(const gcn::SelectionEvent &event)
(item->getQuantity() - 1));
}
+ updateButtons();
+}
+
+void InventoryWindow::updateButtons()
+{
+ Item *item = mItems->getSelectedItem();
+
if (!item || item->getQuantity() == 0)
{
mUseButton->setEnabled(false);
mDropButton->setEnabled(false);
+ mSplitButton->setEnabled(false);
return;
}
@@ -322,7 +330,6 @@ void InventoryWindow::valueChanged(const gcn::SelectionEvent &event)
mSplitButton->setEnabled(false);
}
-
void InventoryWindow::setSplitAllowed(bool allowed)
{
mSplitButton->setVisible(allowed);