From c083432cbb157c2b267ece59cbc63b9c97ea4982 Mon Sep 17 00:00:00 2001 From: Jan Klass Date: Wed, 1 Feb 2017 01:49:19 +0100 Subject: [PATCH] CertWizard: Password requirement notice on import When a (p12) certificate file is specified, it is being imported. If this is not successful it is either because of a missing or wrong password, or because the file is in fact otherwise not valid. Instead of simply disabling and enabling the wizard Next button we now display a text notice to the user to make this clear (especially for the common use-case of having to provide a correct password). Fixes #1025 --- src/mumble/Cert.cpp | 9 +++++++++ src/mumble/Cert.ui | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/mumble/Cert.cpp b/src/mumble/Cert.cpp index 2d41fab38..30e1abdc1 100644 --- a/src/mumble/Cert.cpp +++ b/src/mumble/Cert.cpp @@ -120,6 +120,7 @@ CertWizard::CertWizard(QWidget *p) : QWizard(p) { qwpExport->setCommitPage(true); qwpExport->setComplete(false); + qlPasswordNotice->setVisible(false); } int CertWizard::nextId() const { @@ -305,6 +306,8 @@ void CertWizard::on_qleImportFile_textChanged(const QString &text) { qlePassword->clear(); qlePassword->setEnabled(false); qlPassword->setEnabled(false); + qlPasswordNotice->clear(); + qlPasswordNotice->setVisible(false); qwpImport->setComplete(false); return; } @@ -318,17 +321,23 @@ void CertWizard::on_qleImportFile_textChanged(const QString &text) { if (validateCert(imp)) { qlePassword->setEnabled(false); qlPassword->setEnabled(false); + qlPasswordNotice->clear(); + qlPasswordNotice->setVisible(false); cvImport->setCert(imp.first); qwpImport->setComplete(true); return; } else { qlePassword->setEnabled(true); qlPassword->setEnabled(true); + qlPasswordNotice->setText(tr("Unable to import. Missing password or incompatible file type.")); + qlPasswordNotice->setVisible(true); } } else { qlePassword->clear(); qlePassword->setEnabled(false); qlPassword->setEnabled(false); + qlPasswordNotice->clear(); + qlPasswordNotice->setVisible(false); } cvImport->setCert(QList()); qwpImport->setComplete(false); diff --git a/src/mumble/Cert.ui b/src/mumble/Cert.ui index 42a9b05af..5c3f4356e 100644 --- a/src/mumble/Cert.ui +++ b/src/mumble/Cert.ui @@ -227,6 +227,24 @@ It is <b>strongly</b> recommended that you <a href="http://m + + + + true + + + + true + + + color:#ff0000; + + + + + + + Certificate to import