summaryrefslogtreecommitdiffstats
path: root/src/pvsmgr.cpp
blob: f543c6da5953eb35be5d806c78aa93eec513e03d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 # Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg
 #
 # This program is free software distributed under the GPL version 2.
 # See http://openslx.org/COPYING
 #
 # If you have any feedback please consult http://openslx.org/feedback and
 # send your suggestions, praise, or complaints to feedback@openslx.org
 #
 # General information about OpenSLX can be found at http://openslx.org/
 # -----------------------------------------------------------------------------
 # pvs.cpp
 #    - main loop for pvsmgr GUI.
 # -----------------------------------------------------------------------------
 */

#include <QtGui>
#include <QtGui/QDesktopServices>
#include "gui/mainWindow.h"
#include "util/consoleLogger.h"
#include "util/CertManager.h"
#include "src/input/i18n.h"

QApplication *qtApp;

int main(int argc, char** argv)
{
    //system("openssl genrsa 1024 >~/.pvs/");
    qtApp = new QApplication(argc, argv);
    qtApp->setOrganizationName("openslx");
    qtApp->setOrganizationDomain("openslx.org");
    qtApp->setApplicationName("pvsmgr");

    // use system locale as language to translate gui
    QTranslator translator;
    translator.load(":pvsmgr");
    qtApp->installTranslator(&translator);

    USE_PVSINPUT_TRANSLATIONS;

    ConsoleLog setLogName(QString("log.server"));
    ConsoleLog writeLine(QString("PVS-Server started."));

    QSslKey k = CertManager::getPrivateKey("manager"); // preload key so the gui won't hang later
    /*
    if (k.isNull())
    {
        printf("FATAL: Private key could not be generated or loaded!\n");
        exit(123);
    }
    */
    MainWindow w;
    w.show();
    return qtApp->exec();
}