Skip to content

Commit

Permalink
Merge pull request #2800 from Kissaki/cert-pw
Browse files Browse the repository at this point in the history
CertWizard: Password requirement notice on import
  • Loading branch information
Kissaki committed Feb 1, 2017
2 parents 039096a + c083432 commit 8f94c76
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mumble/Cert.cpp
Expand Up @@ -120,6 +120,7 @@ CertWizard::CertWizard(QWidget *p) : QWizard(p) {

qwpExport->setCommitPage(true);
qwpExport->setComplete(false);
qlPasswordNotice->setVisible(false);
}

int CertWizard::nextId() const {
Expand Down Expand Up @@ -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;
}
Expand All @@ -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<QSslCertificate>());
qwpImport->setComplete(false);
Expand Down
18 changes: 18 additions & 0 deletions src/mumble/Cert.ui
Expand Up @@ -227,6 +227,24 @@ It is &lt;b&gt;strongly&lt;/b&gt; recommended that you &lt;a href=&quot;http://m
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QLabel" name="qlPasswordNotice">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color:#ff0000;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="CertView" name="cvImport">
<property name="toolTip">
<string>Certificate to import</string>
Expand Down

0 comments on commit 8f94c76

Please sign in to comment.