-
Notifications
You must be signed in to change notification settings - Fork 171
/
main.cpp
69 lines (55 loc) · 1.74 KB
/
main.cpp
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
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <QtCore/QCoreApplication>
#include <QApplication>
#include <QLayout>
#include <QDir>
#include <QDebug>
#include <iostream>
#include <QTextCodec>
#include "gitlevent.h"
#include "model/modellocator.h"
#include "views/mainwindow.h"
#include "commands/appfrontcontroller.h"
#include "exceptions/nosequencefoundexception.h"
#include "model/common/comrom.h"
using namespace std;
static void xMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &strMsg)
{
QByteArray localMsg = strMsg.toLocal8Bit();
switch (type) {
case QtDebugMsg:
fprintf(stdout, "[Debug]: %s\n", localMsg.constData());
break;
case QtWarningMsg:
fprintf(stderr, "[Warn]: %s\n", localMsg.constData());
break;
case QtCriticalMsg:
fprintf(stderr, "[Crit]: %s\n", localMsg.constData());
break;
case QtFatalMsg:
fprintf(stderr, "[Fata]: %s\n", localMsg.constData());
}
fflush(stdout);
fflush(stderr);
GitlUpdateUIEvt cEvt;
cEvt.setParameter("msg_detail", strMsg);
cEvt.setParameter("msg_level",(int)type);
cEvt.dispatch();
if(type == QtFatalMsg)
abort();
}
int main(int argc, char *argv[])
{
/// intall message handler
qInstallMessageHandler(xMessageOutput);
/// Register Commands
AppFrontController::getInstance();
QApplication cApp(argc, argv);
/// Show main win
MainWindow cMainWin;
cMainWin.centralWidget()->layout()
->setContentsMargins(0,0,0,0); /// layout hack (maxmize central widget)
cMainWin.show();
ModelLocator::getInstance(); /// init model
cApp.exec();
return EXIT_SUCCESS;
}