From 5703ad855ae236d27796bbd6be2fa192d1ea81bf Mon Sep 17 00:00:00 2001 From: Christian Hohnstaedt Date: Thu, 21 Jun 2018 22:32:14 +0200 Subject: [PATCH] Separate the internal name from distinguished name --- ui/NewX509.ui | 30 ++++++++++++++++++++---------- widgets/NewX509.cpp | 16 +++------------- widgets/NewX509.h | 1 - 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/ui/NewX509.ui b/ui/NewX509.ui index 86dd16f7..91a34263 100644 --- a/ui/NewX509.ui +++ b/ui/NewX509.ui @@ -341,6 +341,24 @@ Subject + + + + + + Internal Name + + + + + + + This name is only used internally and does not appear in the resulting certificate + + + + + @@ -353,13 +371,6 @@ - - - - Qt::Horizontal - - - @@ -423,7 +434,7 @@ Private key - + @@ -813,8 +824,7 @@ - - + diff --git a/widgets/NewX509.cpp b/widgets/NewX509.cpp index 18e7c742..671a9204 100644 --- a/widgets/NewX509.cpp +++ b/widgets/NewX509.cpp @@ -47,7 +47,6 @@ void NewX509::setupExplicitDN(NIDlist my_dn_nid) QGridLayout *dnLayout = dynamic_cast(dnWidget->layout()); if (dnLayout) { QLayoutItem *child; - dnLayout->removeWidget(description); while ((child = dnLayout->takeAt(0))) { delete child->widget(); delete child; @@ -57,17 +56,9 @@ void NewX509::setupExplicitDN(NIDlist my_dn_nid) dnLayout->setAlignment(Qt::AlignTop); dnLayout->setSpacing(6); dnLayout->setMargin(0); - description = new QLineEdit(dnWidget); - description->setToolTip(tr("This name is only used internally and does not appear in the resulting certificate")); } - int n = 1, col = 0; - QLabel *label = new QLabel(dnWidget); - label->setText(tr("Internal name")); + int n = 0, col = 0; - dnLayout->addWidget(label, 0, 0); - dnLayout->addWidget(description, 0, 1); - - QWidget::setTabOrder(description, extDNlist); QWidget *old = description; expl_dn_nid = my_dn_nid + expl_dn_nid; @@ -99,8 +90,8 @@ void NewX509::setupExplicitDN(NIDlist my_dn_nid) qDebug() << "addWidget" << OBJ_nid2sn(nid) << n << col; n++; if (n > expl_dn_nid.size()/2 && col == 0) { - col = 2; - n = expl_dn_nid.size() & 1 ? 0 : 1; + col += 2; + n = 0; } QWidget::setTabOrder(old, edit); old = edit; @@ -190,7 +181,6 @@ NewX509::NewX509(QWidget *parent) X509V3_set_ctx_nodb(&ext_ctx); // Setup dnWidget - description = NULL; setupExplicitDN(NIDlist()); // Setup Request Attributes diff --git a/widgets/NewX509.h b/widgets/NewX509.h index f922066f..448a8a77 100644 --- a/widgets/NewX509.h +++ b/widgets/NewX509.h @@ -69,7 +69,6 @@ class NewX509: public QDialog, public Ui::NewX509 void setupExplicitDN(NIDlist my_dn_nid); public: - QLineEdit *description; NewX509(QWidget *parent); virtual ~NewX509(); void initCtx();