summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-14 18:00:29 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-14 18:00:29 +0300
commitb58f0063f5863ae22a973e5dd1c7bae70ca2e0ba (patch)
tree0a34dc725e053a1985b766eac6c27a754f3508a9
parent7fc40dc16d5871e65c3bf61ac4cf8272fa2a03fd (diff)
downloadmv-b58f0063f5863ae22a973e5dd1c7bae70ca2e0ba.tar.gz
mv-b58f0063f5863ae22a973e5dd1c7bae70ca2e0ba.tar.bz2
mv-b58f0063f5863ae22a973e5dd1c7bae70ca2e0ba.tar.xz
mv-b58f0063f5863ae22a973e5dd1c7bae70ca2e0ba.zip
Use CREATEWIDGET macro in popupmenu.
-rw-r--r--src/gui/popups/popupmenu.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index b3821a12d..3686b29cd 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -52,6 +52,7 @@
#include "gui/windowmenu.h"
#include "gui/widgets/button.h"
+#include "gui/widgets/createwidget.h"
#include "gui/widgets/progressbar.h"
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/textfield.h"
@@ -1033,10 +1034,10 @@ void PopupMenu::handleLink(const std::string &link,
{
mRenameListener.setMapItem(mMapItem);
// TRANSLATORS: number of chars in string should be near original
- mDialog = new TextDialog(_("Rename map sign "),
+ CREATEWIDGETV(mDialog, TextDialog,
+ _("Rename map sign "),
// TRANSLATORS: number of chars in string should be near original
_("Name: "));
- mDialog->postInit();
mRenameListener.setDialog(mDialog);
mDialog->setText(mMapItem->getComment());
mDialog->setActionEventId("ok");
@@ -1044,7 +1045,7 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "edit spell" && mSpell)
{
- (new TextCommandEditor(mSpell))->postInit();
+ CREATEWIDGET(TextCommandEditor, mSpell);
}
else if (link == "undress" && being)
{
@@ -1053,11 +1054,10 @@ void PopupMenu::handleLink(const std::string &link,
else if (link == "addcomment" && !mNick.empty())
{
// TRANSLATORS: number of chars in string should be near original
- TextDialog *const dialog = new TextDialog(
+ TextDialog *const dialog = CREATEWIDGETR(TextDialog,
_("Player comment "),
// TRANSLATORS: number of chars in string should be near original
_("Comment: "));
- dialog->postInit();
mPlayerListener.setDialog(dialog);
mPlayerListener.setNick(mNick);
mPlayerListener.setType(mType);