| 4624 | |
| 4625 | |
| 4626 | bool WizDatabase::QueryCertPassword() |
| 4627 | { |
| 4628 | QString password = getCertPassword(); |
| 4629 | if (!password.isEmpty()) |
| 4630 | return true; |
| 4631 | // |
| 4632 | QString hint = getCertPasswordHint(); |
| 4633 | // |
| 4634 | QString description; |
| 4635 | if (isGroup()) |
| 4636 | { |
| 4637 | QString bizName = m_info.bizName; |
| 4638 | description = QObject::tr("Please enter the password of team cert: %1\nPassword hint: %2").arg(bizName).arg(hint); |
| 4639 | } |
| 4640 | else |
| 4641 | { |
| 4642 | description = QObject::tr("Please enter the password of cert:\nPassword hint: %1").arg(hint); |
| 4643 | } |
| 4644 | // |
| 4645 | WizLineInputDialog dlg(QObject::tr("Cert Password"), description, "", NULL, QLineEdit::Password); |
| 4646 | dlg.setOKHandler([&](QString password) { |
| 4647 | // |
| 4648 | if (verifyCertPassword(password)) |
| 4649 | return true; |
| 4650 | // |
| 4651 | WizMessageBox::critical(&dlg, tr("Invalid password.")); |
| 4652 | // |
| 4653 | return false; |
| 4654 | }); |
| 4655 | // |
| 4656 | if (dlg.exec() == QDialog::Accepted) |
| 4657 | return true; |
| 4658 | // |
| 4659 | return false; |
| 4660 | } |
| 4661 | |
| 4662 | /*! |
| 4663 | Unzip \a document to a temporary folder, and write path of "index.html" to |
no test coverage detected