diff --git a/widgets/NewX509.cpp b/widgets/NewX509.cpp index 5642841e..d88af780 100644 --- a/widgets/NewX509.cpp +++ b/widgets/NewX509.cpp @@ -383,16 +383,6 @@ void NewX509::setTemp(pki_temp *temp) connect_pki(temp); } -void NewX509::disableAllButNameComment() -{ - tab_0->setEnabled(false); - tab_2->setEnabled(false); - tab_3->setEnabled(false); - tab_4->setEnabled(false); - distNameBox->setEnabled(false); - privKeyBox->setEnabled(false); -} - /* Initialize dialog for Certificate creation */ void NewX509::setCert() { @@ -565,8 +555,17 @@ void NewX509::fromTemplate(pki_temp *temp) extensionsFromTemplate(temp); } +void NewX509::updateNameComment() +{ + // If we display a template, import all changes to the template + pki_temp *temp = dynamic_cast(pki); + toTemplate(temp); +} + void NewX509::toTemplate(pki_temp *temp) { + if (!temp) + return; temp->setIntName(description->text()); temp->setSubject(getX509name()); @@ -1486,7 +1485,6 @@ void NewX509::showTemp(QWidget *parent, pki_temp *x) return; NewX509 *dlg = new NewX509(parent); dlg->setTemp(x); - dlg->disableAllButNameComment(); dlg->exec(); delete dlg; } diff --git a/widgets/NewX509.h b/widgets/NewX509.h index 217b59a4..f1b36b61 100644 --- a/widgets/NewX509.h +++ b/widgets/NewX509.h @@ -69,6 +69,8 @@ class NewX509: public XcaDetail, public Ui::NewX509 void setupExplicitDN(NIDlist my_dn_nid); QList setupExplicitInputs(NIDlist nid_list, QWidget *parent, QWidget *old, int columns); + protected: + void updateNameComment(); public: NewX509(QWidget *w = nullptr); @@ -77,7 +79,6 @@ class NewX509: public XcaDetail, public Ui::NewX509 void setRequest(); // reduce to request form void setTemp(pki_temp *temp); // reduce to template form void setCert(); // reduce to certificate form - void disableAllButNameComment(); void toTemplate(pki_temp *temp); void fromTemplate(pki_temp *temp); void defineTemplate(pki_temp *temp); diff --git a/widgets/XcaDetail.h b/widgets/XcaDetail.h index 079830ee..e5de5d06 100644 --- a/widgets/XcaDetail.h +++ b/widgets/XcaDetail.h @@ -21,7 +21,7 @@ class XcaDetail: public QDialog pki_base *pki{}; ImportMulti *importmulti{}; QPushButton *importbut{}; - void updateNameComment(); + virtual void updateNameComment(); public: XcaDetail(QWidget *w);