diff options
author | jonkoorm <jonkoorm@users.noreply.gitlab.com> | 2021-10-24 15:54:49 -0500 |
---|---|---|
committer | jonkoorm <jonkoorm@users.noreply.gitlab.com> | 2021-10-24 16:07:26 -0500 |
commit | 4d3f49696ef96e78b8d1653c86b83b257f4dbec8 (patch) | |
tree | 81b0117d15984af28411f4dea3b4cfca72453984 /src/gui | |
parent | b47e02f1e70a1f303bee370110448d92bc0a3684 (diff) | |
download | mv-keep_password.tar.gz mv-keep_password.tar.bz2 mv-keep_password.tar.xz mv-keep_password.zip |
Enable password remembering in user loginkeep_password
Password is recorded in the 'password' option in config.xml
The 'remember_password' option is added to save the status
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/logindialog.cpp | 23 | ||||
-rw-r--r-- | src/gui/windows/logindialog.h | 1 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 168b1b76a..787f741fc 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -74,14 +74,12 @@ LoginDialog::LoginDialog(LoginData &data, mUserField(new TextField(this, mLoginData->username, LoseFocusOnTab_true, nullptr, std::string(), false)), mPassField(new PasswordField(this, mLoginData->password)), -#ifdef SAVE_PASSWORD // TRANSLATORS: login dialog label - mKeepCheck(new CheckBox(this, _("Remember user and password"), -#else + mKeepCheck(new CheckBox(this, _("username"), + mLoginData->remember, nullptr, std::string())), // TRANSLATORS: login dialog label - mKeepCheck(new CheckBox(this, _("Remember username"), -#endif - mLoginData->remember, nullptr, std::string())), + mKeepPwCheck(new CheckBox(this, _("password"), + mLoginData->remember_password, nullptr, std::string())), // TRANSLATORS: login dialog label mUpdateTypeLabel(new Label(this, _("Update:"))), mUpdateTypeModel(new UpdateTypeModel), @@ -124,6 +122,8 @@ LoginDialog::LoginDialog(LoginData &data, Label *const userLabel = new Label(this, _("Name:")); // TRANSLATORS: login dialog label Label *const passLabel = new Label(this, _("Password:")); + // TRANSLATORS: login dialog label + Label *const rememberLabel = new Label(this, _("Remember:")); if (mServer->updateHosts.size() > 1) { mUpdateListModel = new UpdateListModel(mServer); @@ -177,10 +177,12 @@ LoginDialog::LoginDialog(LoginData &data, } place(0, n, mCustomUpdateHost, 9, 1); place(0, n + 1, mUpdateHostText, 9, 1); - place(0, n + 2, mKeepCheck, 9, 1); - place(0, n + 3, mRegisterButton, 1, 1).setHAlign(LayoutCell::LEFT); - place(2, n + 3, mServerButton, 1, 1); - place(3, n + 3, mLoginButton, 1, 1); + place(0, n + 2, rememberLabel, 1, 1); + place(2, n + 2, mKeepCheck, 1, 1); + place(2, n + 3, mKeepPwCheck, 1, 1); + place(0, n + 4, mRegisterButton, 1, 1).setHAlign(LayoutCell::LEFT); + place(2, n + 4, mServerButton, 1, 1); + place(3, n + 4, mLoginButton, 1, 1); addKeyListener(this); } @@ -324,6 +326,7 @@ void LoginDialog::prepareUpdate() mLoginData->username = mUserField->getText(); mLoginData->password = mPassField->getText(); mLoginData->remember = mKeepCheck->isSelected(); + mLoginData->remember_password = mKeepPwCheck->isSelected(); UpdateTypeT updateType = static_cast<UpdateTypeT>( mUpdateTypeDropDown->getSelected()); diff --git a/src/gui/windows/logindialog.h b/src/gui/windows/logindialog.h index f57eb882b..b859308c0 100644 --- a/src/gui/windows/logindialog.h +++ b/src/gui/windows/logindialog.h @@ -95,6 +95,7 @@ class LoginDialog final : public Window, TextField *mUserField A_NONNULLPOINTER; TextField *mPassField A_NONNULLPOINTER; CheckBox *mKeepCheck A_NONNULLPOINTER; + CheckBox *mKeepPwCheck A_NONNULLPOINTER; Label *mUpdateTypeLabel A_NONNULLPOINTER; UpdateTypeModel *mUpdateTypeModel A_NONNULLPOINTER; DropDown *mUpdateTypeDropDown A_NONNULLPOINTER; |