-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpclient.cpp
41 lines (33 loc) · 932 Bytes
/
gpclient.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
#include <QApplication>
#include <QMessageBox>
#include "MainWindow.h"
#include "palette.h"
#include <QSettings>
int main(int argc, char** argv)
{
QApplication app(argc, argv);
MainWindow* wnd;
QCoreApplication::setOrganizationName("LubosD");
QCoreApplication::setOrganizationDomain("dolezel.info");
QCoreApplication::setApplicationName("gpclient");
initPalettes();
atexit(freePalettes);
try
{
QSettings settings;
if(argc != 2)
{
throw QString::fromUtf8("GamePark klient musí být spuštěn s GP1 souborem jako parametr (stejně jako oficiální klient).\n"
"Zkuste asociovat GP1 soubory k tomuto programu ve svém prohlížeči.");
}
setApplyPalette(settings.value("general/gpColors", true).toBool());
wnd = new MainWindow(argv[1]);
}
catch(const QString& error)
{
QMessageBox::critical(NULL, "GamePark klient", error);
return 1;
}
wnd->showMaximized();
return app.exec();
}