diff --git a/data/gui/dialogs/online/change_password.stkgui b/data/gui/dialogs/online/change_password.stkgui index e1a8bf896..fafb98c45 100644 --- a/data/gui/dialogs/online/change_password.stkgui +++ b/data/gui/dialogs/online/change_password.stkgui @@ -1,7 +1,6 @@
-
@@ -30,15 +29,16 @@ -
diff --git a/data/gui/dialogs/online/recovery_info.stkgui b/data/gui/dialogs/online/recovery_info.stkgui index e0c1c6f2e..7b7a53353 100644 --- a/data/gui/dialogs/online/recovery_info.stkgui +++ b/data/gui/dialogs/online/recovery_info.stkgui @@ -2,18 +2,18 @@
+ I18N="In the recovery dialog" text="Account Recovery"/>
diff --git a/data/gui/dialogs/online/recovery_input.stkgui b/data/gui/dialogs/online/recovery_input.stkgui index aaabf0e83..2d4ad75b7 100644 --- a/data/gui/dialogs/online/recovery_input.stkgui +++ b/data/gui/dialogs/online/recovery_input.stkgui @@ -2,12 +2,12 @@
+ I18N="In the recovery dialog" text="Account Recovery"/>
diff --git a/src/states_screens/dialogs/change_password_dialog.cpp b/src/states_screens/dialogs/change_password_dialog.cpp index 362ce6739..556189cc4 100644 --- a/src/states_screens/dialogs/change_password_dialog.cpp +++ b/src/states_screens/dialogs/change_password_dialog.cpp @@ -22,6 +22,7 @@ #include "guiengine/engine.hpp" #include "guiengine/widgets.hpp" #include "online/xml_request.hpp" +#include "states_screens/dialogs/message_dialog.hpp" #include "states_screens/state_manager.hpp" #include "utils/string_utils.hpp" #include "utils/translation.hpp" @@ -42,6 +43,7 @@ using namespace Online; ChangePasswordDialog::ChangePasswordDialog() : ModalDialog(0.8f, 0.7f) { m_self_destroy = false; + m_show_success_dialog = false; m_success = false; loadFromFile("online/change_password.stkgui"); @@ -115,7 +117,7 @@ void ChangePasswordDialog::changePassword(const stringw ¤t_password, request->addParameter("current", current_password); // The server code expects two passwords (and verifies again that they - // are identical), so send the passwod twice. + // are identical), so send the password twice. request->addParameter("new1", new_password); request->addParameter("new2", new_password); request->queue(); @@ -207,12 +209,9 @@ bool ChangePasswordDialog::onEscapePressed() // ---------------------------------------------------------------------------- void ChangePasswordDialog::success() { - m_info_widget->setDefaultColor(); - m_info_widget->setText(_("Password successfully changed."), false); - m_options_widget->setActive(true); - m_current_password_widget->setText(""); - m_new_password1_widget->setText(""); - m_new_password2_widget->setText(""); + // Close this dialog and show success dialog + m_self_destroy = true; + m_show_success_dialog = true; } // success // ---------------------------------------------------------------------------- @@ -243,4 +242,8 @@ void ChangePasswordDialog::onUpdate(float dt) { ModalDialog::dismiss(); } + if (m_show_success_dialog) + { + new MessageDialog(_("Password successfully changed.")); + } } // onUpdate diff --git a/src/states_screens/dialogs/change_password_dialog.hpp b/src/states_screens/dialogs/change_password_dialog.hpp index e1eaaa14e..7cb13b8f1 100644 --- a/src/states_screens/dialogs/change_password_dialog.hpp +++ b/src/states_screens/dialogs/change_password_dialog.hpp @@ -56,6 +56,7 @@ public: private: bool m_self_destroy; + bool m_show_success_dialog; bool m_success; GUIEngine::TextBoxWidget * m_current_password_widget;