summaryrefslogtreecommitdiff
path: root/src/gui/itemamount.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2009-10-29 21:08:34 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2009-10-29 21:44:31 +0100
commitc8bb01e2284b0570872be5f638b640d22ae247c8 (patch)
tree97aeb14f69d422b03f4b509f422239c7da4c9e6c /src/gui/itemamount.cpp
parent58b3097bf80a830f2082e26930d0a0f180f5f40c (diff)
downloadmana-c8bb01e2284b0570872be5f638b640d22ae247c8.tar.gz
mana-c8bb01e2284b0570872be5f638b640d22ae247c8.tar.bz2
mana-c8bb01e2284b0570872be5f638b640d22ae247c8.tar.xz
mana-c8bb01e2284b0570872be5f638b640d22ae247c8.zip
Disable keyboard shortcuts in windows with text input.
Disable items shortcuts in setup window. Disable all shortcuts in ItemAmount window. Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
Diffstat (limited to 'src/gui/itemamount.cpp')
-rw-r--r--src/gui/itemamount.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp
index 20834c54..71e19e3c 100644
--- a/src/gui/itemamount.cpp
+++ b/src/gui/itemamount.cpp
@@ -33,6 +33,7 @@
#include "gui/widgets/icon.h"
#include "item.h"
+#include "keyboardconfig.h"
#include "net/inventoryhandler.h"
#include "net/net.h"
@@ -73,6 +74,10 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item,
if (!mMax)
mMax = mItem->getQuantity();
+ // Save keyboard state
+ mEnabledKeyboard = keyboard.isEnabled();
+ keyboard.setEnabled(false);
+
// Integer field
mItemAmountTextField = new IntTextField(1);
mItemAmountTextField->setRange(1, mMax);
@@ -224,3 +229,9 @@ void ItemAmountWindow::showWindow(Usage usage, Window *parent, Item *item,
new ItemAmountWindow(usage, parent, item, maxRange);
}
}
+
+void ItemAmountWindow::scheduleDelete()
+{
+ keyboard.setEnabled(mEnabledKeyboard);
+ Window::scheduleDelete();
+}