From c8bb01e2284b0570872be5f638b640d22ae247c8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 29 Oct 2009 21:08:34 +0200 Subject: Disable keyboard shortcuts in windows with text input. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable items shortcuts in setup window. Disable all shortcuts in ItemAmount window. Reviewed-by: Thorbjørn Lindeijer --- src/gui/itemamount.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/itemamount.cpp') 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(); +} -- cgit v1.2.3-70-g09d2