summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-14 21:16:40 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-14 21:16:40 +0300
commit0e13e22e4902eca435812ae002c56ad13233efc6 (patch)
treebaa2a7d2554977854ad50340e5fc208779abee18
parent2763d9c893b3f19485581cb21eabfa38f427eab9 (diff)
downloadplus-0e13e22e4902eca435812ae002c56ad13233efc6.tar.gz
plus-0e13e22e4902eca435812ae002c56ad13233efc6.tar.bz2
plus-0e13e22e4902eca435812ae002c56ad13233efc6.tar.xz
plus-0e13e22e4902eca435812ae002c56ad13233efc6.zip
Use CREATEWIDGET macro in charserverhandler.
-rw-r--r--src/net/ea/charserverhandler.cpp19
-rw-r--r--src/net/eathena/charserverhandler.cpp37
-rw-r--r--src/net/tmwa/charserverhandler.cpp11
3 files changed, 46 insertions, 21 deletions
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp
index e798467e7..eafdaff34 100644
--- a/src/net/ea/charserverhandler.cpp
+++ b/src/net/ea/charserverhandler.cpp
@@ -27,6 +27,8 @@
#include "gui/windows/charcreatedialog.h"
#include "gui/windows/okdialog.h"
+#include "gui/widgets/createwidget.h"
+
#include "net/ea/eaprotocol.h"
#include "net/character.h"
@@ -135,15 +137,17 @@ void CharServerHandler::processCharCreateFailed(Net::MessageIn &msg)
errorMessage = _("Incorrect look.");
break;
}
- // TRANSLATORS: error message header
- (new OkDialog(_("Error"), errorMessage,
+ CREATEWIDGET(OkDialog,
+ // TRANSLATORS: error message header
+ _("Error"),
+ errorMessage,
// TRANSLATORS: ok dialog button
_("OK"),
DialogType::ERROR,
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();
+ 260);
if (mCharCreateDialog)
mCharCreateDialog->unlock();
BLOCK_END("CharServerHandler::processCharCreateFailed")
@@ -157,15 +161,18 @@ void CharServerHandler::processCharDelete(Net::MessageIn &msg A_UNUSED)
mSelectedCharacter = nullptr;
updateCharSelectDialog();
unlockCharSelectDialog();
- // TRANSLATORS: info message
- (new OkDialog(_("Info"), _("Character deleted."),
+ CREATEWIDGET(OkDialog,
+ // TRANSLATORS: info message header
+ _("Info"),
+ // TRANSLATORS: info message
+ _("Character deleted."),
// TRANSLATORS: ok dialog button
_("OK"),
DialogType::OK,
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();
+ 260);
BLOCK_END("CharServerHandler::processCharDelete")
}
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 893be8f4f..692ea5dfb 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -30,6 +30,8 @@
#include "gui/windows/charselectdialog.h"
#include "gui/windows/okdialog.h"
+#include "gui/widgets/createwidget.h"
+
#include "net/character.h"
#include "net/serverfeatures.h"
@@ -578,15 +580,18 @@ void CharServerHandler::processCharCheckRename(Net::MessageIn &msg)
}
else
{
- // TRANSLATORS: info message
- (new OkDialog(_("Error"), _("Character rename error."),
+ CREATEWIDGET(OkDialog,
+ // TRANSLATORS: error header
+ _("Error"),
+ // TRANSLATORS: error message
+ _("Character rename error."),
// TRANSLATORS: ok dialog button
_("Error"),
DialogType::ERROR,
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();
+ 260);
}
}
@@ -596,15 +601,18 @@ void CharServerHandler::processCharRename(Net::MessageIn &msg)
if (!flag)
{
mCharSelectDialog->setName(mRenameId, mNewName);
- // TRANSLATORS: info message
- (new OkDialog(_("Info"), _("Character renamed."),
+ CREATEWIDGET(OkDialog,
+ // TRANSLATORS: info header
+ _("Info"),
+ // TRANSLATORS: info message
+ _("Character renamed."),
// TRANSLATORS: ok dialog button
_("OK"),
DialogType::OK,
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();
+ 260);
}
else
{
@@ -629,15 +637,17 @@ void CharServerHandler::processCharRename(Net::MessageIn &msg)
message = _("Character not found.");
break;
}
- // TRANSLATORS: info message
- (new OkDialog(_("Info"), message,
+ CREATEWIDGET(OkDialog,
+ // TRANSLATORS: info message
+ _("Info"),
+ message,
// TRANSLATORS: ok dialog button
_("OK"),
DialogType::OK,
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();
+ 260);
}
}
@@ -662,15 +672,18 @@ void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg)
BLOCK_START("CharServerHandler::processCharDeleteFailed")
unlockCharSelectDialog();
msg.readUInt8("error");
- // TRANSLATORS: error message
- (new OkDialog(_("Error"), _("Failed to delete character."),
+ CREATEWIDGET(OkDialog,
+ // TRANSLATORS: error header
+ _("Error"),
+ // TRANSLATORS: error message
+ _("Failed to delete character."),
// TRANSLATORS: ok dialog button
_("OK"),
DialogType::ERROR,
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();
+ 260);
BLOCK_END("CharServerHandler::processCharDeleteFailed")
}
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index e27e2c125..859be0bed 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -29,6 +29,8 @@
#include "gui/windows/charcreatedialog.h"
#include "gui/windows/okdialog.h"
+#include "gui/widgets/createwidget.h"
+
#include "net/character.h"
#include "net/serverfeatures.h"
@@ -522,15 +524,18 @@ void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg)
BLOCK_START("CharServerHandler::processCharDeleteFailed")
unlockCharSelectDialog();
msg.readUInt8("error");
- // TRANSLATORS: error message
- (new OkDialog(_("Error"), _("Failed to delete character."),
+ CREATEWIDGET(OkDialog,
+ // TRANSLATORS: error header
+ _("Error"),
+ // TRANSLATORS: error message
+ _("Failed to delete character."),
// TRANSLATORS: ok dialog button
_("OK"),
DialogType::ERROR,
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();
+ 260);
BLOCK_END("CharServerHandler::processCharDeleteFailed")
}