From bf36fd86bf7f929db45794d68978036ec0517c87 Mon Sep 17 00:00:00 2001 From: joss17 Date: Sun, 24 Jan 2010 22:15:02 +0000 Subject: [PATCH] add input validator for gpg key gen git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2118 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/GenCertDialog.cpp | 8 ++++++++ retroshare-gui/src/gui/GenCertDialog.ui | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index 8c82b2164..408b93831 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -162,6 +162,14 @@ void GenCertDialog::genPerson() QVariant data = ui.genPGPuser->itemData(pgpidx); PGPId = (data.toString()).toStdString(); } else { + if (ui.password_input->text().length() < 3 || ui.name_input->text().length() < 3) { + /* Message Dialog */ + QMessageBox::StandardButton sb = QMessageBox::warning ( NULL, + tr("Generate GPG key Failure"), + tr("Your Name or password is too short (3+ characters)"), + QMessageBox::Ok); + return; + } //generate a new gpg key std::string err_string; ui.no_gpg_key_label->setText(tr("Generating new GPG key, please be patient. Fill in your GPG password when asked.")); diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui index d21487351..87b1a760d 100644 --- a/retroshare-gui/src/gui/GenCertDialog.ui +++ b/retroshare-gui/src/gui/GenCertDialog.ui @@ -1092,7 +1092,14 @@ p, li { white-space: pre-wrap; } - + + + + + + QLineEdit::Password + +