ide: Repo credentials improvements

git-svn-id: svn://ultimatepp.org/upp/trunk@15633 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2021-01-01 15:09:22 +00:00
parent 9147d3efc6
commit c8d032cf11
2 changed files with 11 additions and 1 deletions

View file

@ -70,6 +70,7 @@ bool GetCredentials(const String& url, const String& dir, String& username, Stri
struct CredentialDlg : WithCredentialLayout<TopWindow> {
void Hints(const Vector<String>& url_hints);
void Sync() { password.Password(!show_password); }
CredentialDlg();
};
@ -82,6 +83,8 @@ void CredentialDlg::Hints(const Vector<String>& url_hints)
CredentialDlg::CredentialDlg()
{
CtrlLayoutOKCancel(*this, "Credentials");
Sync();
show_password << [=] { Sync(); };
}
struct CredentialsDlg : WithCredentialsLayout<TopWindow> {
@ -177,6 +180,13 @@ void CredentialsDlg::Sync()
clear.Enable(list.GetCount());
edit.Enable(list.IsCursor());
remove.Enable(list.IsCursor());
list.ColumnAt(2)
.SetConvert(show_passwords ? StdConvert()
: LambdaConvert([](const Value& v) {
return String('*', (~v).GetCount());
})
);
}
CredentialsDlg::CredentialsDlg(const Vector<String>& url_hints)

View file

@ -40,8 +40,8 @@ LAYOUT(CredentialLayout, 368, 116)
ITEM(Upp::EditString, username, LeftPosZ(112, 248).TopPosZ(32, 19))
ITEM(Upp::Label, dv___4, SetLabel(t_("Password")).LeftPosZ(8, 92).TopPosZ(56, 19))
ITEM(Upp::EditString, password, LeftPosZ(112, 248).TopPosZ(56, 19))
ITEM(Upp::Option, show_password, SetLabel(t_("Show password")).LeftPosZ(8, 108).TopPosZ(84, 20))
ITEM(Upp::Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(228, 64).BottomPosZ(8, 24))
ITEM(Upp::Button, ok, SetLabel(t_("OK")).LeftPosZ(296, 64).BottomPosZ(8, 24))
ITEM(Upp::Option, show_passwords, SetLabel(t_("Show password")).LeftPosZ(8, 108).TopPosZ(84, 20))
END_LAYOUT