summaryrefslogtreecommitdiff
path: root/src/gui/itemamount.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2009-10-29 23:13:06 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2009-10-29 23:23:34 +0100
commit1c0ee2fc301d88c5c696392d9959e82e2acd0086 (patch)
treed7ad6b099e6978ad88690b73c060ae6869dea4f0 /src/gui/itemamount.cpp
parentf1c60e9a64bedb907bb8172c2927dc04aaeef6f0 (diff)
downloadmana-client-1c0ee2fc301d88c5c696392d9959e82e2acd0086.tar.gz
mana-client-1c0ee2fc301d88c5c696392d9959e82e2acd0086.tar.bz2
mana-client-1c0ee2fc301d88c5c696392d9959e82e2acd0086.tar.xz
mana-client-1c0ee2fc301d88c5c696392d9959e82e2acd0086.zip
Small refactoring ItemAmountWindow
Diffstat (limited to 'src/gui/itemamount.cpp')
-rw-r--r--src/gui/itemamount.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp
index 71e19e3c..e0162eda 100644
--- a/src/gui/itemamount.cpp
+++ b/src/gui/itemamount.cpp
@@ -148,6 +148,11 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item,
mItemIcon->addMouseListener(this);
}
+ItemAmountWindow::~ItemAmountWindow()
+{
+ delete mItemPopup;
+}
+
// Show ItemTooltip
void ItemAmountWindow::mouseMoved(gcn::MouseEvent &event)
{
@@ -196,7 +201,7 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
else if (event.getId() == "ok")
{
finish(mItem, amount, mUsage);
- scheduleDelete();
+ close();
return;
}
mItemAmountTextField->setValue(amount);
@@ -205,7 +210,7 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
void ItemAmountWindow::close()
{
- delete mItemPopup;
+ keyboard.setEnabled(mEnabledKeyboard);
scheduleDelete();
}
@@ -229,9 +234,3 @@ void ItemAmountWindow::showWindow(Usage usage, Window *parent, Item *item,
new ItemAmountWindow(usage, parent, item, maxRange);
}
}
-
-void ItemAmountWindow::scheduleDelete()
-{
- keyboard.setEnabled(mEnabledKeyboard);
- Window::scheduleDelete();
-}