mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-12 00:00:44 -04:00
add some validators for gpg key gen
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2313 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
48a25578c0
commit
bb3696597a
2 changed files with 24 additions and 8 deletions
|
@ -140,10 +140,18 @@ void GenCertDialog::genPerson()
|
|||
{
|
||||
|
||||
/* Check the data from the GUI. */
|
||||
std::string genLoc = ui.genLoc->text().toStdString();
|
||||
std::string genLoc = ui.location_input->text().toStdString();
|
||||
std::string PGPId;
|
||||
|
||||
if (!genNewGPGKey) {
|
||||
if (ui.location_input->text().length() < 3) {
|
||||
/* Message Dialog */
|
||||
QMessageBox::StandardButton sb = QMessageBox::warning ( NULL,
|
||||
tr("Generate GPG key Failure"),
|
||||
tr("Location field is required with a minimum of 3 characters"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
int pgpidx = ui.genPGPuser->currentIndex();
|
||||
if (pgpidx < 0)
|
||||
{
|
||||
|
@ -157,11 +165,12 @@ 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) {
|
||||
if (ui.password_input->text().length() < 3 || ui.name_input->text().length() < 3
|
||||
|| ui.email_input->text().length() < 3 || ui.location_label->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)"),
|
||||
tr("All fields are required with a minimum of 3 characters"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
@ -183,7 +192,7 @@ void GenCertDialog::genPerson()
|
|||
ui.genPGPuserlabel->hide();
|
||||
ui.genPGPuser->hide();
|
||||
ui.location_label->hide();
|
||||
ui.genLoc->hide();
|
||||
ui.location_input->hide();
|
||||
ui.infopushButton->hide();
|
||||
ui.genButton->hide();
|
||||
QMessageBox::StandardButton info = QMessageBox::information( NULL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue