windows changes

This commit is contained in:
chris 2002-09-22 21:38:29 +00:00
parent 6aff69061c
commit fab9d33e8a
4 changed files with 36 additions and 14 deletions

View File

@ -64,8 +64,15 @@ MainWindow::MainWindow(QWidget *parent, const char *name )
connect( (QObject *)quitApp, SIGNAL(clicked()), (QObject *)qApp, SLOT(quit()) );
QString cpr = "(c) 2002 by Christian@Hohnstaedt.de - Version: ";
copyright->setText(cpr + VER);
baseDir = QDir::homeDirPath() + BASE_DIR;
#ifndef HAVE_CONGIG_H
baseDir = "C:";
#else
baseDir = QDir::homeDirPath();
#endif
baseDir += QDir::separator();
baseDir += BASE_DIR;
dbenv = new DbEnv(DB_CXX_NO_EXCEPTIONS | DB_INIT_TXN );
CERR << baseDir.latin1() <<endl;
QDir d(baseDir);
if ( ! d.exists() ){
if (!d.mkdir(baseDir))
@ -77,7 +84,7 @@ MainWindow::MainWindow(QWidget *parent, const char *name )
else {
dbfile=qApp->argv()[1];
}
dbfile = baseDir + "/" + dbfile;
dbfile = baseDir + QDir::separator() + dbfile;
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
settings = new db_base(dbenv, dbfile.latin1(), "settings");

View File

@ -95,14 +95,14 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#define BASE_DIR "/xca"
#define DBFILE "xca.db"
#ifndef CERR
#define CERR cerr
#endif
#ifndef HAVE_CONFIG_H
#define VER "0.2.4-win"
#endif
#ifndef HAVE_CONFIG_H
#define VER "0.2.4-win"
#endif
class MainWindow: public MainWindow_UI
{

View File

@ -414,9 +414,19 @@ pki_base *db_base::findPKI(pki_base *refpki)
QPixmap *db_base::loadImg(const char *name )
{
QString path = PREFIX;
path += "/";
return new QPixmap(path + name);
QString path ="";
#ifndef HAVE_CONFIG_H
path = "C:";
path += QDir::separator();
path += BASE_DIR ;
#else
path = QDir::homeDirPath() + QDir::separator();
path += PREFIX ;
#endif
path += QDir::separator();
path += name;
QMessageBox::information(NULL, "xca", path);
return new QPixmap(path);
}
void db_base::updateViewPKI(pki_base *pki)

View File

@ -49,7 +49,8 @@
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#include "../config.h"
#ifdef HAVE_DB4_DB_CXX_H
#include <db4/db_cxx.h>
#elif HAVE_DB3_DB_CXX_H
@ -62,16 +63,20 @@
#ifdef HAVE_QACCESSIBLE_H
#define qt3 1
#endif
#else
#include <db_cxx.h>
#define PREFIX "c:\xca"
#endif
#else // HAVE_CONFIG_H
#include <db_cxx.h>
#endif // HAVE_CONFIG_H
#include <qlistview.h>
#include <qlist.h>
#include <qdir.h>
#include <qmessagebox.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include "pki_base.h"
#define BASE_DIR "xca"
#ifndef DB_BASE_H
#define DB_BASE_H