Esempio n. 1
0
void DistName::setX509name(const x509name &n)
{
	QLabel *l1, *l2;
	QStringList sl;
	for (int i=0; i<n.entryCount(); i++) {
		l1 = new QLabel( this );
		l2 = new CopyLabel( this );
		l1->setTextFormat(Qt::PlainText);
		sl = n.entryList(i);
		l1->setText(sl[1]);
		if (l1->text().isEmpty())
			l1->setText(sl[0]);
		l2->setText(sl[2]);

		l1->setToolTip(sl[0]);
		l2->setToolTip(sl[3]);

		DistNameLayout->addWidget( l1, i, 0 );
		DistNameLayout->addWidget( l2, i, 1 );
	}
	rfc2253->setText(n.oneLine(XN_FLAG_RFC2253));
	rfc2253->setCursorPosition(0);
	namehash->setText(n.hash());
	updateGeometry();
}
Esempio n. 2
0
void NewX509::setX509name(const x509name &n)
{
	int i,j;

	extDNlist->deleteAllRows();
	for (j=0; j<EXPLICIT_NAME_CNT; j++) {
		name_ptr[j]->setText("");
	}
	for (i=0, j=0; i< n.entryCount(); i++) {
		int nid = n.nid(i);
		QStringList sl = n.entryList(i);
		for ( ; j<EXPLICIT_NAME_CNT; j++) {
			if (nid == name_nid[j] && name_ptr[j]->text().isEmpty()) {
				name_ptr[j]->setText(sl[2]);
				break;
			}
		}
		if (j == EXPLICIT_NAME_CNT) {
			extDNlist->addRow(sl.mid(1, 2));
		}
	}
}