Disable Import button when creating a new template

It does not belong there and caused a crash when pressing import and
then OK.
This commit is contained in:
Christian Hohnstaedt 2024-09-29 12:47:15 +02:00
parent 5f4308245c
commit 2bb89cb8c0
3 changed files with 5 additions and 4 deletions

View File

@ -370,7 +370,7 @@ void NewX509::setReqAttributes(pki_x509req *req)
}
/* Initialize dialog for Template creation */
void NewX509::setTemp(pki_temp *temp)
void NewX509::setTemp(pki_temp *temp, bool create)
{
description->setText(temp->getIntName());
capt->setText(tr("Edit XCA template"));
@ -381,7 +381,8 @@ void NewX509::setTemp(pki_temp *temp)
pt = tmpl;
fromTemplate(temp);
comment->setPlainText(temp->getComment());
connect_pki(temp);
if (!create)
connect_pki(temp);
}
/* Initialize dialog for Certificate creation */

View File

@ -77,7 +77,7 @@ class NewX509: public XcaDetail, public Ui::NewX509
virtual ~NewX509();
void initCtx();
void setRequest(); // reduce to request form
void setTemp(pki_temp *temp); // reduce to template form
void setTemp(pki_temp *temp, bool create = false); // reduce to template form
void setCert(); // reduce to certificate form
void toTemplate(pki_temp *temp);
void fromTemplate(pki_temp *temp);

View File

@ -62,7 +62,7 @@ bool TempTreeView::runTempDlg(pki_temp *temp)
{
NewX509 *dlg = new NewX509(this);
dlg->setTemp(temp);
dlg->setTemp(temp, true);
if (!dlg->exec()) {
delete dlg;
return false;