X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2FguiPasswordChange.cpp;h=e2f9994be29cf0fe9926dc9350e616e1ea3a22e7;hb=ad4bf2ccf966ac21b94f1778a017ac98f8957ab6;hp=d9a5cc48b9b20ea09f3c88cb07a487919b292080;hpb=9e2a9b55e185b92074b32d3df336920f33b29e5a;p=minetest.git diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index d9a5cc48b..e2f9994be 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -79,7 +79,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) Remove stuff */ removeChildren(); - + /* Calculate new sizes and positions */ @@ -89,7 +89,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) screensize.X/2 + 580/2, screensize.Y/2 + 300/2 ); - + DesiredRect = rect; recalculateAbsolutePosition(false); @@ -103,8 +103,8 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) */ s32 ypos = 50; { - core::rect rect(0, 0, 110, 20); - rect += topleft_client + v2s32(35, ypos+6); + core::rect rect(0, 0, 150, 20); + rect += topleft_client + v2s32(25, ypos+6); text = wgettext("Old Password"); Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; @@ -112,15 +112,15 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); - gui::IGUIEditBox *e = + gui::IGUIEditBox *e = Environment->addEditBox(L"", rect, true, this, ID_oldPassword); Environment->setFocus(e); e->setPasswordBox(true); } ypos += 50; { - core::rect rect(0, 0, 110, 20); - rect += topleft_client + v2s32(35, ypos+6); + core::rect rect(0, 0, 150, 20); + rect += topleft_client + v2s32(25, ypos+6); text = wgettext("New Password"); Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; @@ -128,14 +128,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); - gui::IGUIEditBox *e = + gui::IGUIEditBox *e = Environment->addEditBox(L"", rect, true, this, ID_newPassword1); e->setPasswordBox(true); } ypos += 50; { - core::rect rect(0, 0, 110, 20); - rect += topleft_client + v2s32(35, ypos+6); + core::rect rect(0, 0, 150, 20); + rect += topleft_client + v2s32(25, ypos+6); text = wgettext("Confirm Password"); Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; @@ -143,7 +143,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); - gui::IGUIEditBox *e = + gui::IGUIEditBox *e = Environment->addEditBox(L"", rect, true, this, ID_newPassword2); e->setPasswordBox(true); } @@ -162,7 +162,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 300, 20); rect += topleft_client + v2s32(35, ypos); text = wgettext("Passwords do not match!"); - IGUIElement *e = + IGUIElement *e = Environment->addStaticText( text, rect, false, true, this, ID_message); @@ -177,7 +177,7 @@ void GUIPasswordChange::drawMenu() if (!skin) return; video::IVideoDriver* driver = Environment->getVideoDriver(); - + video::SColor bgcolor(140,0,0,0); driver->draw2DRectangle(bgcolor, AbsoluteRect, &AbsoluteClippingRect); @@ -203,7 +203,8 @@ bool GUIPasswordChange::acceptInput() e->setVisible(true); return false; } - m_client->sendChangePassword(oldpass, newpass); + m_client->sendChangePassword(wide_to_utf8(oldpass), + wide_to_utf8(newpass)); return true; }