From d41a70fa7738c7917a556b17aabf41a9158ff8ea Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 12 Sep 2002 22:59:32 +0000 Subject: [PATCH] This is not a good status :-( --- MainWindow.cpp | 8 ++-- MainWindow.h | 3 +- MainWindowX509.cpp | 22 ++++++--- Makefile.in | 8 ++-- NewX509.cpp | 6 +-- NewX509.h | 2 +- NewX509_0.cpp | 3 +- NewX509_0.h | 4 +- NewX509_0.ui | 19 ++------ NewX509_1.ui | 20 +++++++-- NewX509_2.ui | 22 ++++++--- PassRead.ui | 93 +++++++++++++++++++++++++++++++------- PassWrite.ui | 109 +++++++++++++++++++++++++++++++++++---------- 13 files changed, 235 insertions(+), 84 deletions(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index 07a0cb89..e9c01e1b 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -52,6 +52,7 @@ #include "MainWindow.h" +QPixmap *MainWindow::keyImg = NULL, *MainWindow::csrImg = NULL, *MainWindow::certImg = NULL; MainWindow::MainWindow(QWidget *parent, const char *name ) @@ -77,13 +78,13 @@ MainWindow::MainWindow(QWidget *parent, const char *name ) ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); settings = new db_base(dbenv, dbfile.latin1(), "settings"); + keyImg = loadImg("bigkey.png"); + csrImg = loadImg("bigcsr.png"); + certImg = loadImg("bigcert.png"); initPass(); keys = new db_key(dbenv, dbfile.latin1(), keyList); reqs = new db_x509req(dbenv, dbfile.latin1(), reqList, keys); certs = new db_x509(dbenv, dbfile.latin1(), certList, keys); - keyImg = loadImg("bigkey.png"); - csrImg = loadImg("bigcsr.png"); - certImg = loadImg("bigcert.png"); bigKey->setPixmap(*keyImg); bigCsr->setPixmap(*csrImg); bigCert->setPixmap(*certImg); @@ -164,6 +165,7 @@ int MainWindow::passRead(char *buf, int size, int rwflag, void *userdata) PASS_INFO *p = (PASS_INFO *)userdata; PassRead_UI *dlg = new PassRead_UI(NULL, 0, true); if (p != NULL) { + dlg->image->setPixmap( *keyImg ); dlg->title->setText(tr(p->title->c_str())); dlg->description->setText(tr(p->description->c_str())); } diff --git a/MainWindow.h b/MainWindow.h index aa3192e3..6a32c140 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -58,6 +58,7 @@ #include "NewKey_UI.h" #include "NewX509Req_UI.h" #include "NewX509.h" +#include "NewX509_0.h" #include "NewX509_1_UI.h" #include "NewX509_2_UI.h" #include "NewX509_3_UI.h" @@ -111,7 +112,7 @@ class MainWindow: public MainWindow_UI db_key *keys; DbEnv *dbenv; db_base *settings; - QPixmap *keyImg, *csrImg, *certImg; + static QPixmap *keyImg, *csrImg, *certImg; public: QString baseDir, dbfile; static const int sizeList[]; diff --git a/MainWindowX509.cpp b/MainWindowX509.cpp index 5a59d48d..5a71cd2b 100644 --- a/MainWindowX509.cpp +++ b/MainWindowX509.cpp @@ -61,11 +61,12 @@ void MainWindow::newCert() int serial = 42; // :-) int i, retval; NewX509_0 *dlg1 = new NewX509_0(this, NULL, keys, reqs); - NewX509_1_UI *dlg2 = new NewX509_1_UI(this, NULL, true ,0); - NewX509_2_UI *dlg3 = new NewX509_2_UI(this, NULL, true ,0); - NewX509_3_UI *dlg4 = new NewX509_3_UI(this, NULL, true ,0); + NewX509_1_UI *dlg2 = new NewX509_1_UI(this, NULL); + NewX509_2_UI *dlg3 = new NewX509_2_UI(this, NULL); + NewX509_3_UI *dlg4 = new NewX509_3_UI(this, NULL); NewX509 *dlg[4] = {dlg1, dlg2, dlg3, dlg4}; + CERR <<" Everything created" << endl; // preset dlg 2 selection of signer QStringList strlist = certs->getSignerDesc(); if (strlist.isEmpty()) { @@ -75,12 +76,19 @@ void MainWindow::newCert() else { dlg2->certList->insertStringList(strlist); } + CERR <<" Everything created A" << endl; // preset dialogs with images - for (i=4;i>0;i--) { - dlg[i]->image->setPixmap(*certImg); + for (i=0;i<4;i++) { + CERR <<" Everything created :" << i << endl; + //dlg[i]->image->setPixmap(*certImg); } + CERR <<" Everything created V" << endl; + i=0; + if (!dlg1->exec()) return; if (!dlg2->exec()) return; + if (!dlg3->exec()) return; + if (!dlg4->exec()) return; @@ -176,7 +184,7 @@ void MainWindow::newCert() // STEP 4 // Subject Alternative name - string subAlt = dlg4->subAlt->text().latin1(); + string subAlt = dlg4->subAltURL->text().latin1(); //if (subAlt != "") { // key usage @@ -184,7 +192,7 @@ void MainWindow::newCert() "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"}; QListBoxItem *item; - int i=0; + i=0; string keyuse, keyuse1; while ((item = dlg3->keyUsage->item(i))) { if (item->selected()){ diff --git a/Makefile.in b/Makefile.in index 9c0f3459..aeefc5fd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,6 +31,7 @@ OBJS=NewKey_UI.o NewKey_UI_MOC.o \ NewX509_2_UI.o NewX509_2_UI_MOC.o \ NewX509_3_UI.o NewX509_3_UI_MOC.o \ NewX509.o NewX509_MOC.o \ + NewX509_0.o NewX509_0_MOC.o \ CertDetail_UI.o CertDetail_UI_MOC.o \ Rename_UI.o Rename_UI_MOC.o \ ExportKey.o ExportKey_MOC.o \ @@ -47,7 +48,7 @@ re: clean all MainWindow.h: MainWindow_UI.h KeyDetail_UI.h \ PassRead_UI.h PassWrite_UI.h ExportKey_UI.h \ NewX509Req_UI.h NewKey_UI.h ReqDetail_UI.h \ - NewX509_UI.h CertDetail_UI.h NewX509_1_UI.h \ + NewX509_0_UI.h CertDetail_UI.h NewX509_1_UI.h NewX509.h \ NewX509_2_UI.h NewX509_3_UI.h Rename_UI.h TrustState_UI.h %.o: %.cpp @@ -62,8 +63,9 @@ NewX509_%.mui: NewX509_%.ui %.mui: %.ui cp $< $@ -#NewX509_%_UI.h: NewX509.h NewX509_%.mui -# $(UIC) -o $@ $< +NewX509_%_UI.h: NewX509_%.mui NewX509.h + echo '#include "NewX509.h"' > $@ + $(UIC) $< >> $@ # #NewX509_%_UI.cpp: NewX509_%_UI.h NewX509_%.mui # $(UIC) -o $@ -subimpl NewX509 $^ diff --git a/NewX509.cpp b/NewX509.cpp index ad7eb963..884cf0f7 100644 --- a/NewX509.cpp +++ b/NewX509.cpp @@ -49,10 +49,10 @@ */ -#include +#include "NewX509.h" -NewX509::NewX509( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ) - :QDialog(parent, name, modal, fl) +NewX509::NewX509( QWidget* parent = 0, const char* name = 0 ) + :QDialog(parent, name, true, 0) { image = NULL; } diff --git a/NewX509.h b/NewX509.h index dfdd6c92..057011a2 100644 --- a/NewX509.h +++ b/NewX509.h @@ -60,7 +60,7 @@ class NewX509: public QDialog Q_OBJECT public: QLabel * image; - NewX509( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + NewX509( QWidget* parent = 0, const char* name = 0 ); public slots: virtual void goBack(); diff --git a/NewX509_0.cpp b/NewX509_0.cpp index 6ca35ed7..4559f203 100644 --- a/NewX509_0.cpp +++ b/NewX509_0.cpp @@ -52,7 +52,8 @@ #include "NewX509_0.h" NewX509_0::NewX509_0(QWidget *parent , const char *name, db_key *key, db_x509req *req) - :NewX509_0_UI(parent, name, true, 0) + :NewX509_0_UI(parent, name) +// :NewX509_0_UI(parent, name, true, 0) { connect( this, SIGNAL(genKey()), parent, SLOT(newKey()) ); keys = key; diff --git a/NewX509_0.h b/NewX509_0.h index efb5d90d..e7fa7fbf 100644 --- a/NewX509_0.h +++ b/NewX509_0.h @@ -49,7 +49,7 @@ */ -#include "NewX509_UI.h" +#include "NewX509_0_UI.h" #include #include #include "lib/db_key.h" @@ -70,7 +70,7 @@ class NewX509_0: public NewX509_0_UI db_key *keys; MainWindow *par; public: - NewX509(QWidget *parent, const char *name, db_key *key, db_x509req *req); + NewX509_0(QWidget *parent, const char *name, db_key *key, db_x509req *req); public slots: void setDisabled(int state); diff --git a/NewX509_0.ui b/NewX509_0.ui index 5778fe2a..aafebf5b 100644 --- a/NewX509_0.ui +++ b/NewX509_0.ui @@ -1,6 +1,5 @@ NewX509_0_UI -loadImage QDialog @@ -12,7 +11,7 @@ 0 0 - 742 + 738 458 @@ -104,10 +103,6 @@ 40 - - pixmap - - scaledContents true @@ -547,30 +542,24 @@ For a SSL servercertificate choose the DNS name of the server as "Common name"NewX509_0_UI validateFields() - - genKey - clicked() - NewX509_0_UI - newKey() - - newKey() setDisabled(int) validateFields() - fromDataRB description countryName stateOrProvinceName localityName keyList + genKey organisationName organisationalUnitName commonName emailAddress - fromReqRB reqList PushButton14 PushButton15 + fromDataRB + fromReqRB diff --git a/NewX509_1.ui b/NewX509_1.ui index 3b0ce6bb..bb7ab2fd 100644 --- a/NewX509_1.ui +++ b/NewX509_1.ui @@ -11,7 +11,7 @@ 0 0 - 604 + 600 214 @@ -268,6 +268,12 @@ + + PushButton15 + clicked() + NewX509_1_UI + reject() + PushButton14 clicked() @@ -275,11 +281,19 @@ accept() - PushButton15 + PushButton14 clicked() NewX509_1_UI - reject() + goNext() + + PushButton14_2 + clicked() + NewX509_1_UI + goBack() + + goNext() + goBack() PushButton14 diff --git a/NewX509_2.ui b/NewX509_2.ui index 0847a4c0..38d17e83 100644 --- a/NewX509_2.ui +++ b/NewX509_2.ui @@ -11,7 +11,7 @@ 0 0 - 563 + 559 507 @@ -643,18 +643,26 @@ - - PushButton14 - clicked() - NewX509_2_UI - accept() - PushButton15 clicked() NewX509_2_UI reject() + + PushButton14 + clicked() + NewX509_2_UI + goBack() + + + PushButton8 + clicked() + NewX509_2_UI + goNext() + + goNext() + goBack() PushButton14 diff --git a/PassRead.ui b/PassRead.ui index 31ff947b..0bf33389 100644 --- a/PassRead.ui +++ b/PassRead.ui @@ -11,7 +11,7 @@ 0 0 - 451 + 491 184 @@ -29,23 +29,86 @@ 6 - QLabel + QLayoutWidget name - title - - - font - - 14 - 1 - 1 - - - - text - Password + Layout6 + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + title + + + font + + 14 + 1 + 1 + + + + text + Password + + + + + name + Spacer6 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QLabel + + name + image + + + minimumSize + + 95 + 40 + + + + maximumSize + + 95 + 40 + + + + scaledContents + true + + + QLabel diff --git a/PassWrite.ui b/PassWrite.ui index 3b14d31c..2146e65d 100644 --- a/PassWrite.ui +++ b/PassWrite.ui @@ -11,7 +11,7 @@ 0 0 - 494 + 490 236 @@ -29,31 +29,94 @@ 6 - QLabel + QLayoutWidget name - title - - - font - - 14 - 1 - 1 - - - - frameShape - MShape - - - frameShadow - MShadow - - - text - Password + Layout4 + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + title + + + font + + 14 + 1 + 1 + + + + frameShape + MShape + + + frameShadow + MShadow + + + text + Password + + + + + name + Spacer4 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QLabel + + name + image + + + minimumSize + + 95 + 40 + + + + maximumSize + + 95 + 40 + + + + scaledContents + true + + + QLabel