summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/windows/charselectdialog.cpp20
-rw-r--r--src/gui/windows/charselectdialog.h1
2 files changed, 21 insertions, 0 deletions
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)
diff --git a/src/gui/windows/charselectdialog.h b/src/gui/windows/charselectdialog.h
index ea51f0b14..f5105bae5 100644
--- a/src/gui/windows/charselectdialog.h
+++ b/src/gui/windows/charselectdialog.h
@@ -122,6 +122,7 @@ class CharSelectDialog final : public Window,
Button *mInfoButton A_NONNULLPOINTER;
Button *mDeleteButton A_NONNULLPOINTER;
Button *mRenameButton;
+ Button *mChangePinButton;
CharacterViewBase *mCharacterView;
STD_VECTOR<CharacterDisplay*> mCharacterEntries;