-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.cpp
More file actions
82 lines (55 loc) · 2.08 KB
/
main.cpp
File metadata and controls
82 lines (55 loc) · 2.08 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <QApplication>
#include <QPushButton>
#include <QSettings>
#include <QSplashScreen>
#include <FairWindSdk/FairWind.hpp>
#include "ui/MainWindow.hpp"
/*
* main
* FairWind++ starting point
*/
int main(int argc, char *argv[]) {
// Enable OpenGL shared contexts
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts );
// Enable DPI scaling
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
// Enable high DPI support
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
// Create the application
QApplication app(argc, argv);
// Get the splash screen logo
QPixmap pixmap(":/resources/images/other/splash_logo.png");
// Create a splash screen containing the logo
QSplashScreen splash(pixmap);
// Show the logo
splash.show();
// Get the FairWind singleton
auto fairWind = fairwind::FairWind::getInstance();
splash.showMessage("Loading Applications...", 500, Qt::white);
// Set apps path
fairWind->setApplicationDirPath(QApplication::applicationDirPath().left(1));
// Load the apps inside the FairWind singleton itself
fairWind->loadApps();
// Update splash message
splash.showMessage("Starting Connections...", 500, Qt::white);
// Start the connections
fairWind->startConnections();
// Install new applications
fairWind->installNewApps();
// Update splash message
splash.showMessage("Loading Settings...", 500, Qt::white);
// Load the configuration inside the FairWind singleton itself
fairWind->loadConfig();
splash.showMessage("Loading Organization Name", 500, Qt::white);
// Set organisation name
QCoreApplication::setOrganizationName("uniparthenope");
// Set the window icon
app.setWindowIcon(QIcon(QPixmap::fromImage(QImage(":/resources/images/icons/fairwind_icon.png"))));
// Create a new MainWindow object
fairwind::ui::MainWindow w;
// Register the main window
fairWind->setMainWindow(&w);
// Close the splash screen presenting the MainWindow UI
splash.finish(&w);
return QApplication::exec();
}