details are readonly

This commit is contained in:
chris2511 2003-07-22 15:19:33 +00:00
parent 30f70a9e1d
commit 9dd333af59
5 changed files with 38 additions and 114 deletions

View File

@ -303,41 +303,20 @@ void CertView::showItem(pki_base *item, bool import)
{
if (!item) return;
try {
CertDetail *dlg = new CertDetail(this,0,true);
bool ret;
dlg->setCert((pki_x509 *)item);
connect( dlg->privKey, SIGNAL( doubleClicked(QString) ),
this, SLOT( dlg_showKey(QString) ));
connect( dlg->signCert, SIGNAL( doubleClicked(QString) ),
this, SLOT( showItem(QString) ));
if (import) {
dlg->setImport();
}
CertDetail *dlg = new CertDetail(this,0,true);
dlg->setCert((pki_x509 *)item);
connect( dlg->privKey, SIGNAL( doubleClicked(QString) ),
this, SLOT( dlg_showKey(QString) ));
connect( dlg->signCert, SIGNAL( doubleClicked(QString) ),
this, SLOT( showItem(QString) ));
// show it to the user...
QString odesc = item->getIntName();
ret = dlg->exec();
QString ndesc = dlg->descr->text();
delete dlg;
if (!ret && import) {
delete item;
}
if (!ret) return;
emit init_database();
if (import) {
item = insert(item);
}
if (ndesc != odesc) {
db->renamePKI(item, ndesc);
return;
}
dlg->exec();
}
catch (errorEx &err) {
Error(err);
}
return ;
if (dlg)
delete dlg;
}
void CertView::deleteItem()
@ -464,13 +443,13 @@ void CertView::loadPKCS7()
acert = pk7->getCert(i);
showItem(acert, true);
}
// keys->updateView();
}
catch (errorEx &err) {
Error(err);
}
if (pk7) delete pk7;
}
updateView();
}

View File

@ -81,37 +81,23 @@ void CrlView::dlg_showCert(QString name)
void CrlView::showItem(pki_base *item, bool import)
{
if (!item) return;
try {
CrlDetail *dlg = new CrlDetail(this,0,true);
dlg->setCrl((pki_crl *)item);
connect( dlg->certList, SIGNAL( doubleClicked(QListViewItem*) ),
this, SLOT( dlg_showCert(QListViewItem *) ));
connect( dlg->issuerIntName, SIGNAL( doubleClicked(QString) ),
this, SLOT( dlg_showCert(QString) ));
QString odesc = item->getIntName();
bool ret = dlg->exec();
QString ndesc = dlg->descr->text();
delete dlg;
if (!ret && import) {
delete item;
}
if (!ret) return;
if (MainWindow::crls == NULL) {
emit init_database();
}
if (import) {
item = insert(item);
}
if (ndesc != odesc) {
MainWindow::crls->renamePKI(item, ndesc);
}
CrlDetail *dlg;
try {
dlg = new CrlDetail(this,0,true);
dlg->setCrl((pki_crl *)item);
connect( dlg->certList, SIGNAL( doubleClicked(QListViewItem*) ),
this, SLOT( dlg_showCert(QListViewItem *) ));
connect( dlg->issuerIntName, SIGNAL( doubleClicked(QString) ),
this, SLOT( dlg_showCert(QString) ));
dlg->exec();
}
catch (errorEx &err) {
Error(err);
}
if (dlg)
delete dlg;
return;
}

View File

@ -118,45 +118,17 @@ void KeyView::deleteItem()
void KeyView::showItem(pki_base *item, bool import)
{
pki_key *key = (pki_key *)item;
KeyDetail *detDlg;
if (!key) return;
KeyDetail *detDlg = new KeyDetail(this, 0, true, 0 );
try {
detDlg = new KeyDetail(this, 0, true, 0 );
detDlg->setKey(key);
if (import) {
detDlg->setImport();
}
}
catch (errorEx &err) {
Error(err);
}
if (detDlg)
delete detDlg;
return;
}
QString odesc = key->getIntName();
bool ret = detDlg->exec();
QString ndesc = detDlg->keyDesc->text();
delete detDlg;
if (!ret && import) {
delete key;
}
if (!ret) return;
emit init_database();
if (import) {
key = (pki_key *)insert(key);
}
CERR(ndesc << " " << key->getIntName());
if ( ndesc != odesc) {
MARK
try {
db->renamePKI(key, ndesc);
MARK
}
catch (errorEx &err) {
Error(err);
}
return;
}
}
void KeyView::load()

View File

@ -109,35 +109,19 @@ void ReqView::newItem(pki_temp *temp)
void ReqView::showItem(pki_base *item, bool import)
{
if (!item) return;
ReqDetail *dlg;
try {
ReqDetail *dlg = new ReqDetail(this,0,true);
dlg = new ReqDetail(this,0,true);
dlg->setReq((pki_x509req *)item);
if (import)
dlg->setImport();
connect(dlg->privKey, SIGNAL(doubleClicked(QString)),
this, SLOT(dlg_showKey(QString)));
QString odesc = item->getIntName();
bool ret = dlg->exec();
QString ndesc = dlg->descr->text();
delete dlg;
if (!ret && import) {
delete (pki_x509req *)item;
}
if (!ret) return;
emit init_database();
if (import) {
item = insert(item);
}
if (ndesc != odesc) {
db->renamePKI(item, ndesc);
}
dlg->exec();
}
catch (errorEx &err) {
Error(err);
}
if (dlg)
delete dlg;
}
void ReqView::deleteItem()

View File

@ -176,10 +176,12 @@ void XcaListView::deleteItem_default(QString t1, QString t2)
void XcaListView::load_default(QStringList &filter, QString caption)
{
filter.append( tr("All Files ( *.* )") );
QString s = "";
QStringList slist;
QFileDialog *dlg = new QFileDialog(this,0,true);
dlg->setCaption(caption);
QString s = "";
QStringList slist;
QFileDialog *dlg = new QFileDialog(this,0,true);
dlg->setCaption(caption);
dlg->setFilters(filter);
dlg->setMode( QFileDialog::ExistingFiles );
dlg->setDir(MainWindow::getPath());
@ -188,6 +190,7 @@ void XcaListView::load_default(QStringList &filter, QString caption)
MainWindow::setPath(dlg->dirPath());
}
delete dlg;
for ( QStringList::Iterator it = slist.begin(); it != slist.end(); ++it ) {
s = *it;
s = QDir::convertSeparators(s);