From 7fc4b120bf35daa5d3d96eb565ec7d79ce153653 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 19 Oct 2009 14:18:04 -0600 Subject: Fix RegisterDialog tab order and detail lengths --- src/gui/changeemaildialog.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/gui/changeemaildialog.cpp') diff --git a/src/gui/changeemaildialog.cpp b/src/gui/changeemaildialog.cpp index f536bd4f..32e10e98 100644 --- a/src/gui/changeemaildialog.cpp +++ b/src/gui/changeemaildialog.cpp @@ -32,6 +32,8 @@ #include "gui/widgets/textfield.h" #include "net/logindata.h" +#include "net/loginhandler.h" +#include "net/net.h" #include "utils/gettext.h" #include "utils/stringutils.h" @@ -116,20 +118,21 @@ void ChangeEmailDialog::action(const gcn::ActionEvent &event) std::stringstream errorMessage; int error = 0; - if (newFirstEmail.length() < LEN_MIN_PASSWORD) + unsigned int min = Net::getLoginHandler()->getMinPasswordLength(); + unsigned int max = Net::getLoginHandler()->getMaxPasswordLength(); + + if (newFirstEmail.length() < min) { // First email address too short errorMessage << strprintf(_("The new email address needs to be at " - "least %d characters long."), - LEN_MIN_PASSWORD); + "least %d characters long."), min); error = 1; } - else if (newFirstEmail.length() > LEN_MAX_PASSWORD - 1 ) + else if (newFirstEmail.length() > max - 1 ) { // First email address too long errorMessage << strprintf(_("The new email address needs to be " - "less than %d characters long."), - LEN_MAX_PASSWORD); + "less than %d characters long."), max); error = 1; } else if (newFirstEmail != newSecondEmail) -- cgit v1.2.3-70-g09d2