From 7cb3d0c5c9558f5ab32c913ede673fac5233dc76 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 14 Jun 2015 18:13:01 +0300 Subject: Use CREATEWIDGET macro in setupitem. --- src/gui/widgets/setupitem.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index b359cc952..18196a739 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -31,6 +31,7 @@ #include "gui/widgets/button.h" #include "gui/widgets/checkbox.h" +#include "gui/widgets/createwidget.h" #include "gui/widgets/dropdown.h" #include "gui/widgets/horizontcontainer.h" #include "gui/widgets/inttextfield.h" @@ -409,9 +410,10 @@ void SetupItemTextField::action(const ActionEvent &event) } else if (eventId == mEventName + "_EDIT") { - mEditDialog = new EditDialog(mText, mTextField->getText(), + mEditDialog = CREATEWIDGETR(EditDialog, + mText, + mTextField->getText(), mEventName + "_EDIT_OK"); - mEditDialog->postInit(); mEditDialog->addActionListener(this); } else if (eventId == mEventName + "_EDIT_OK") @@ -546,9 +548,10 @@ void SetupItemIntTextField::action(const ActionEvent &event) } else if (eventId == mEventName + "_EDIT") { - mEditDialog = new EditDialog(mText, mTextField->getText(), + mEditDialog = CREATEWIDGETR(EditDialog, + mText, + mTextField->getText(), mEventName + "_EDIT_OK"); - mEditDialog->postInit(); mEditDialog->addActionListener(this); } else if (eventId == mEventName + "_EDIT_OK") -- cgit v1.2.3-70-g09d2