X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=src%2FguiPasswordChange.cpp;h=0e19f571d9881d9dd6e142b765032ec4b564fb57;hb=c7a78037809a2f9c431441f7ef91f84eb8744fff;hp=98b11b43214495c168e95a9591f11765be6e74b1;hpb=e1a2b8f600ff9845ecff0f06c85d4d2c29970414;p=dragonfireclient.git diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index 98b11b432..0e19f571d 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -1,27 +1,32 @@ /* -Minetest-c55 -Copyright (C) 2010-11 celeron55, Perttu Ahola -Copyright (C) 2011 Ciaran Gultnieks - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +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 +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "guiPasswordChange.h" #include "debug.h" #include "serialization.h" #include +#include +#include +#include +#include +#include + +#include "gettext.h" const int ID_oldPassword = 256; const int ID_newPassword1 = 257; @@ -90,17 +95,19 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) v2s32 size = rect.getSize(); v2s32 topleft_client(40, 0); - v2s32 size_client = size - v2s32(40, 0); + + const wchar_t *text; /* Add stuff */ s32 ypos = 50; { - core::rect rect(0, 0, 110, 20); - rect += topleft_client + v2s32(35, ypos+6); - const wchar_t *text = L"Old Password"; + 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; } { core::rect rect(0, 0, 230, 30); @@ -112,10 +119,11 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) } ypos += 50; { - core::rect rect(0, 0, 110, 20); - rect += topleft_client + v2s32(35, ypos+6); - const wchar_t *text = L"New Password"; + 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; } { core::rect rect(0, 0, 230, 30); @@ -126,10 +134,11 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) } ypos += 50; { - core::rect rect(0, 0, 110, 20); - rect += topleft_client + v2s32(35, ypos+6); - const wchar_t *text = L"Confirm Password"; + 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; } { core::rect rect(0, 0, 230, 30); @@ -143,19 +152,23 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); - Environment->addButton(rect, this, ID_change, L"Change"); + 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); - const wchar_t *text = L"Passwords do not match!"; + text = wgettext("Passwords do not match!"); IGUIElement *e = - Environment->addStaticText(text, rect, false, true, this, ID_message); + Environment->addStaticText( + text, + rect, false, true, this, ID_message); e->setVisible(false); + delete[] text; } - } void GUIPasswordChange::drawMenu()