/* vi: set sw=4 ts=4: * * Copyright (C) 2001 - 2017 Christian Hohnstaedt. * * All rights reserved. */ #include "MainWindow.h" #include #include #include #include #ifndef OPENSSL_NO_EC #include #endif #include "ui_About.h" #include "ui_Help.h" #include "lib/func.h" #include "lib/entropy.h" void MainWindow::cmd_version() { fprintf(stderr, XCA_TITLE " Version %s\n", version_str(false)); exitApp = 1; } void MainWindow::cmd_help(const char* msg) { fprintf(stderr, XCA_TITLE " Version %s\n" "\n" " -v show version information and exit\n" " -h shows this help screen and exit\n" " -e : extract entry.\n" " -d expect the following argument to be the database name to use\n" " -i expect the following argument to be the index file to generate\n" " -I expect the following argument to be the base name the index file hierarchy to generate\n" " -x Exit after processing all commandline options\n\n", version_str(false)); if (msg) { fprintf(stderr, "Cmdline Error: %s\n", msg); } exitApp = 1; } void MainWindow::about() { Ui::About ui; QDialog *about = new QDialog(this, 0); QString openssl, qt, cont, version, brainpool; #ifndef OPENSSL_NO_EC #ifdef NID_brainpoolP160r1 EC_GROUP *group = EC_GROUP_new_by_curve_name(NID_brainpoolP160r1); ign_openssl_error(); if (group) { EC_GROUP_free(group); brainpool = "

ECC With RFC 5639 Brainpool curves" #if OPENSSL_VERSION_NUMBER < 0x10002001L "
(Backported to " OPENSSL_VERSION_TEXT ")" #endif ; } #endif #else brainpool = "(Elliptic Curve Cryptography support disabled)"; #endif openssl = SSLeay_version(SSLEAY_VERSION); qt = qVersion(); if (openssl != OPENSSL_VERSION_TEXT || qt != QT_VERSION_STR) { version = QString("" "" "" "" "" "" "" "" "
Compile time:" OPENSSL_VERSION_TEXT "QT version: " QT_VERSION_STR "
Run time:%1QT version: %2
").arg(openssl).arg(qt); } else { version = QString("%1
QT version: %2").arg(openssl).arg(qt); } ui.setupUi(about); Entropy::seed_rng(); cont = QString( "

XCA

" "

Copyright 2001 - 2018 by Christian Hohnstädt\n" "

Version: %4

%1

%2" /* commithash, Brainpool, OpenSSL & Qt Version */ "

http://hohnstaedt.de/xca" "

Entropy strength: %3" "

Installation path: %5
User settings path: %6" "


" "" "" "" "" "
Christian Hohnstädt<christian@hohnstaedt.de>
Programming, Translation and Testing
Kerstin Steinhauff<tine@kerstine.de>
Arts and Graphics

Maintained Translations
" "

" "" "" "" "" "
GermanChristian Hohnstädt <christian@hohnstaedt.de>
FrenchPatrick Monnerat <Patrick.Monnerat@datasphere.ch>
CroatianNevenko Bartolincic <nevenko.bartolincic@gmail.com>
SlovakSlavko <linux@slavino.sk>
").arg(brainpool).arg(version).arg(Entropy::strength()) .arg(version_str(true)).arg(getPrefix()) .arg(getUserSettingsDir()); about->setWindowTitle(XCA_TITLE); ui.image->setPixmap( *keyImg ); ui.image1->setPixmap( *certImg ); ui.textbox->setHtml(cont); about->exec(); delete about; } void MainWindow::help() { QDialog *h = new QDialog(this, 0); QString path, uri; Ui::Help ui; ui.setupUi(h); path = QString("file://"); #if defined(Q_OS_WIN32) path += "/"; #endif path += getDocDir() + "/"; #if defined(Q_OS_WIN32) path = path.replace("\\","/"); #endif uri = path + "xca.html"; ui.textbox->setSource(QUrl(uri)); ui.textbox->setSearchPaths(QStringList(path)); h->setWindowTitle(tr(XCA_TITLE)); h->show(); }