summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-08 22:30:19 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-08 22:30:19 +0300
commit2061d47d50cafad5fd5d412b25c1dae110cd85ab (patch)
tree49f624f61216713368e350ee4f5550acd33184be
parentb17247b5586f7e6a20802a0d3113b96c50810665 (diff)
downloadmv-2061d47d50cafad5fd5d412b25c1dae110cd85ab.tar.gz
mv-2061d47d50cafad5fd5d412b25c1dae110cd85ab.tar.bz2
mv-2061d47d50cafad5fd5d412b25c1dae110cd85ab.tar.xz
mv-2061d47d50cafad5fd5d412b25c1dae110cd85ab.zip
Add option to change pin code into char selection dialog.
-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;