From 2061d47d50cafad5fd5d412b25c1dae110cd85ab Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Mar 2018 22:30:19 +0300 Subject: Add option to change pin code into char selection dialog. --- src/gui/windows/charselectdialog.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/gui/windows/charselectdialog.cpp') diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index d48a1a162..638e5caa0 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -82,6 +82,7 @@ CharSelectDialog::CharSelectDialog(LoginData &data) : mDeleteButton(new Button(this, _("Delete"), "delete", this)), // TRANSLATORS: char select dialog. button. mRenameButton(nullptr), + mChangePinButton(nullptr), mCharacterView(nullptr), mCharacterEntries(0), mCharServerHandler(charServerHandler), @@ -116,6 +117,18 @@ CharSelectDialog::CharSelectDialog(LoginData &data) : placer(n, 0, mRenameButton, 1, 1); n ++; } +#ifdef TMWA_SUPPORT + if (serverFeatures->havePincode()) +#endif + { + mChangePinButton = new Button(this, + // TRANSLATORS: change pincode button + _("Change pin"), + "changepin", + this); + placer(n, 0, mChangePinButton, 1, 1); + n ++; + } placer(n, 0, mInfoButton, 1, 1); n ++; @@ -321,6 +334,13 @@ void CharSelectDialog::action(const ActionEvent &event) } mDeleteIndex = -1; } + else if (eventId == "changepin") + { + if (blocked) + return; + pincodeManager.setState(PincodeState::Change); + pincodeManager.updateState(); + } } void CharSelectDialog::use(const int selected) -- cgit v1.2.3-70-g09d2