summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs/setup_input.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-14 22:52:05 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-14 22:52:05 +0300
commit18ec6c4b67c6636a15e453672569249c30bfb5fa (patch)
treea5f1de60075d7965fefdc0ab4ecc0cdc20dc3409 /src/gui/widgets/tabs/setup_input.cpp
parent5849b9537cd81dfccfc283c20a18d905ea7bf982 (diff)
downloadmanaplus-18ec6c4b67c6636a15e453672569249c30bfb5fa.tar.gz
manaplus-18ec6c4b67c6636a15e453672569249c30bfb5fa.tar.bz2
manaplus-18ec6c4b67c6636a15e453672569249c30bfb5fa.tar.xz
manaplus-18ec6c4b67c6636a15e453672569249c30bfb5fa.zip
Use CREATEWIDGET macro in setup_input.
Diffstat (limited to 'src/gui/widgets/tabs/setup_input.cpp')
-rw-r--r--src/gui/widgets/tabs/setup_input.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp
index cc3b15498..51308aa0c 100644
--- a/src/gui/widgets/tabs/setup_input.cpp
+++ b/src/gui/widgets/tabs/setup_input.cpp
@@ -41,6 +41,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/containerplacer.h"
+#include "gui/widgets/createwidget.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/listbox.h"
#include "gui/widgets/scrollarea.h"
@@ -58,7 +59,7 @@ static const int setupGroups = 9;
Setup_Input::Setup_Input(const Widget2 *const widget) :
SetupTab(widget),
mKeyListModel(new KeyListModel),
- mKeyList(new ListBox(this, mKeyListModel, "")),
+ mKeyList(CREATEWIDGETR(ListBox, this, mKeyListModel, "")),
// TRANSLATORS: button in input settings tab
mAssignKeyButton(new Button(this, _("Assign"), "assign", this)),
// TRANSLATORS: button in input settings tab
@@ -73,7 +74,6 @@ Setup_Input::Setup_Input(const Widget2 *const widget) :
mKeySetting(false),
mActionDataSize(new int [9])
{
- mKeyList->postInit();
inputManager.setSetupInput(this);
// TRANSLATORS: setting tab name
setName(_("Input"));
@@ -153,8 +153,9 @@ void Setup_Input::apply()
const std::string str1 = keyToString(key1);
const std::string str2 = keyToString(key2);
- // TRANSLATORS: input settings error header
- (new OkDialog(_("Key Conflict(s) Detected."),
+ CREATEWIDGET(OkDialog,
+ // TRANSLATORS: input settings error header
+ _("Key Conflict(s) Detected."),
// TRANSLATORS: input settings error
strprintf(_("Conflict \"%s\" and \"%s\" keys. "
"Resolve them, or gameplay may result in strange behaviour."),
@@ -165,7 +166,7 @@ void Setup_Input::apply()
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();
+ 260);
}
keyboard.setEnabled(true);
inputManager.store();