X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2FguiPasswordChange.cpp;h=c8a2214b6e2ea1ddc76ce5e93df1bf657e5f472c;hb=5ca336ea9281e87d8a2de95cef337e056266838d;hp=2a7fb009a02db28c2998177837947e8927024bc5;hpb=7ece67727dcc1ff7a6634e4b911eeb82ed3eaf45;p=dragonfireclient.git diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index 2a7fb009a..c8a2214b6 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -1,7 +1,7 @@ /* -Part of Minetest-c55 -Copyright (C) 2011 celeron55, Perttu Ahola -Copyright (C) 2011 Ciaran Gultnieks +Part of Minetest +Copyright (C) 2013 celeron55, Perttu Ahola +Copyright (C) 2013 Ciaran Gultnieks Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -20,6 +20,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "debug.h" #include "serialization.h" #include +#include +#include +#include +#include +#include #include "gettext.h" @@ -90,20 +95,18 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) v2s32 size = rect.getSize(); v2s32 topleft_client(40, 0); - v2s32 size_client = size - v2s32(40, 0); /* Add stuff */ s32 ypos = 50; - changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("Old Password")), - rect, false, true, this, -1); + wchar_t* text = wgettext("Old Password"); + Environment->addStaticText(text, rect, false, true, this, -1); + delete[] text; } - changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -113,14 +116,13 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } ypos += 50; - changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("New Password")), - rect, false, true, this, -1); + wchar_t* text = wgettext("New Password"); + Environment->addStaticText(text, rect, false, true, this, -1); + delete[] text; } - changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -129,14 +131,13 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } ypos += 50; - changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), - rect, false, true, this, -1); + wchar_t* text = wgettext("Confirm Password"); + Environment->addStaticText(text, rect, false, true, this, -1); + delete[] text; } - changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -146,25 +147,26 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) } ypos += 50; - changeCtype(""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); - Environment->addButton(rect, this, ID_change, chartowchar_t(gettext("Change"))); + wchar_t* text = wgettext("Change"); + Environment->addButton(rect, this, ID_change, text); + delete[] text; } ypos += 50; { core::rect rect(0, 0, 300, 20); rect += topleft_client + v2s32(35, ypos); + wchar_t* text = wgettext("Passwords do not match!"); IGUIElement *e = Environment->addStaticText( - chartowchar_t(gettext("Passwords do not match!")), + text, rect, false, true, this, ID_message); e->setVisible(false); + delete[] text; } - changeCtype("C"); - } void GUIPasswordChange::drawMenu()