summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-16 17:21:24 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-16 17:21:24 +0300
commit396b3e298b21677ebe3c6f5c2f5b837ac25625f2 (patch)
tree01cfca3609db046afebe5c9e11ba0a5a803e378f /src/gui/windows
parente50013d92b22faeffb8711d07a8f344ab71e9e57 (diff)
downloadManaVerse-396b3e298b21677ebe3c6f5c2f5b837ac25625f2.tar.gz
ManaVerse-396b3e298b21677ebe3c6f5c2f5b837ac25625f2.tar.bz2
ManaVerse-396b3e298b21677ebe3c6f5c2f5b837ac25625f2.tar.xz
ManaVerse-396b3e298b21677ebe3c6f5c2f5b837ac25625f2.zip
Move dialog type into separate file.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/changeemaildialog.cpp2
-rw-r--r--src/gui/windows/changepassworddialog.cpp2
-rw-r--r--src/gui/windows/charcreatedialog.cpp2
-rw-r--r--src/gui/windows/charselectdialog.cpp5
-rw-r--r--src/gui/windows/editserverdialog.cpp2
-rw-r--r--src/gui/windows/okdialog.cpp4
-rw-r--r--src/gui/windows/okdialog.h17
-rw-r--r--src/gui/windows/registerdialog.cpp2
-rw-r--r--src/gui/windows/socialwindow.cpp2
-rw-r--r--src/gui/windows/unregisterdialog.cpp2
10 files changed, 19 insertions, 21 deletions
diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp
index 420dc3b76..1e5b526d7 100644
--- a/src/gui/windows/changeemaildialog.cpp
+++ b/src/gui/windows/changeemaildialog.cpp
@@ -165,7 +165,7 @@ void ChangeEmailDialog::action(const ActionEvent &event)
// TRANSLATORS: change email error header
OkDialog *const dlg = new OkDialog(_("Error"),
- errorMsg.str(), DIALOG_ERROR);
+ errorMsg.str(), DialogType::ERROR);
dlg->addActionListener(mWrongDataNoticeListener);
}
else
diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp
index ea9084c5c..e8f6a5c0b 100644
--- a/src/gui/windows/changepassworddialog.cpp
+++ b/src/gui/windows/changepassworddialog.cpp
@@ -155,7 +155,7 @@ void ChangePasswordDialog::action(const ActionEvent &event)
// TRANSLATORS: change password error header
OkDialog *const dlg = new OkDialog(_("Error"),
- errorMsg.str(), DIALOG_ERROR);
+ errorMsg.str(), DialogType::ERROR);
dlg->addActionListener(mWrongDataNoticeListener);
}
else
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 34b4b5b5a..203ab01d2 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -356,7 +356,7 @@ void CharCreateDialog::action(const ActionEvent &event)
new OkDialog(_("Error"),
// TRANSLATORS: char creation error
_("Your name needs to be at least 4 characters."),
- DIALOG_ERROR, true, this);
+ DialogType::ERROR, true, this);
}
}
else if (id == "cancel")
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index 559b1f349..5c12c5441 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -242,7 +242,7 @@ void CharSelectDialog::action(const ActionEvent &event)
character->data.mAttributes[Attributes::EXP]),
Units::formatCurrency(
character->data.mAttributes[Attributes::MONEY]).c_str());
- new OkDialog(data->getName(), msg, DIALOG_SILENCE);
+ new OkDialog(data->getName(), msg, DialogType::SILENCE);
}
}
if (eventId == "switch")
@@ -274,7 +274,8 @@ void CharSelectDialog::action(const ActionEvent &event)
else
{
// TRANSLATORS: error message
- new OkDialog(_("Error"), _("Incorrect password"), DIALOG_ERROR);
+ new OkDialog(_("Error"), _("Incorrect password"),
+ DialogType::ERROR);
}
mDeleteIndex = -1;
}
diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp
index a3b687113..516efea4d 100644
--- a/src/gui/windows/editserverdialog.cpp
+++ b/src/gui/windows/editserverdialog.cpp
@@ -192,7 +192,7 @@ void EditServerDialog::action(const ActionEvent &event)
OkDialog *const dlg = new OkDialog(_("Error"),
// TRANSLATORS: edit server dialog error message
_("Please at least type both the address and the port "
- "of the server."), DIALOG_ERROR);
+ "of the server."), DialogType::ERROR);
dlg->addActionListener(this);
}
else
diff --git a/src/gui/windows/okdialog.cpp b/src/gui/windows/okdialog.cpp
index 3d734b7ad..5ab5356ca 100644
--- a/src/gui/windows/okdialog.cpp
+++ b/src/gui/windows/okdialog.cpp
@@ -78,9 +78,9 @@ OkDialog::OkDialog(const std::string &restrict title,
setVisible(true);
okButton->requestFocus();
- if (soundEvent == DIALOG_OK)
+ if (soundEvent == DialogType::OK)
soundManager.playGuiSound(SOUND_INFO);
- else if (soundEvent == DIALOG_ERROR)
+ else if (soundEvent == DialogType::ERROR)
soundManager.playGuiSound(SOUND_ERROR);
}
diff --git a/src/gui/windows/okdialog.h b/src/gui/windows/okdialog.h
index b8236dfbc..5017207cd 100644
--- a/src/gui/windows/okdialog.h
+++ b/src/gui/windows/okdialog.h
@@ -23,20 +23,15 @@
#ifndef GUI_WINDOWS_OKDIALOG_H
#define GUI_WINDOWS_OKDIALOG_H
-#include "localconsts.h"
+#include "gui/dialogtype.h"
#include "gui/widgets/window.h"
#include "listeners/actionlistener.h"
-class TextBox;
+#include "localconsts.h"
-enum
-{
- DIALOG_OK = 0,
- DIALOG_ERROR,
- DIALOG_SILENCE
-};
+class TextBox;
/**
* An 'Ok' button dialog.
@@ -54,8 +49,10 @@ class OkDialog final : public Window,
*/
OkDialog(const std::string &restrict title,
const std::string &restrict msg,
- const int soundEvent = DIALOG_OK, const bool modal = true,
- const bool showCenter = true, Window *const parent = nullptr,
+ const int soundEvent = DialogType::OK,
+ const bool modal = true,
+ const bool showCenter = true,
+ Window *const parent = nullptr,
const int minWidth = 260);
A_DELETE_COPY(OkDialog)
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp
index 375a34137..0f0d85c9c 100644
--- a/src/gui/windows/registerdialog.cpp
+++ b/src/gui/windows/registerdialog.cpp
@@ -258,7 +258,7 @@ void RegisterDialog::action(const ActionEvent &event)
OkDialog *const dlg = new OkDialog(
// TRANSLATORS: error message
- _("Error"), errorMsg, DIALOG_ERROR);
+ _("Error"), errorMsg, DialogType::ERROR);
dlg->addActionListener(mWrongDataNoticeListener);
}
else
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index 28d27e82b..711f5b8bc 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -1683,7 +1683,7 @@ void SocialWindow::showPartyCreate()
// TRANSLATORS: party creation message
new OkDialog(_("Create Party"),
_("Cannot create party. You are already in a party"),
- DIALOG_ERROR, true, true, this);
+ DialogType::ERROR, true, true, this);
return;
}
diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp
index e35c27aa2..8b9721f40 100644
--- a/src/gui/windows/unregisterdialog.cpp
+++ b/src/gui/windows/unregisterdialog.cpp
@@ -144,7 +144,7 @@ void UnRegisterDialog::action(const ActionEvent &event)
// TRANSLATORS: unregister dialog. error message.
OkDialog *const dlg = new OkDialog(_("Error"),
- errorMsg.str(), DIALOG_ERROR);
+ errorMsg.str(), DialogType::ERROR);
dlg->addActionListener(mWrongDataNoticeListener);
}
else