-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
main.cpp
40 lines (34 loc) · 1.01 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
#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include <QMessageBox>
#include <QResource>
#include <QTranslator>
#include <qefientrystaticlist.h>
#include <qefi.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setDesktopFileName("qefientrymanager");
a.setWindowIcon(QIcon("../cc.inoki.qefientrymanager.png"));
QTranslator translator;
if (translator.load(QLocale(), QStringLiteral("app"), QStringLiteral("_"), QStringLiteral(":/translations"), QStringLiteral(".qm")))
{
a.installTranslator(&translator);
}
else
{
qDebug() << "Failed to load translation";
}
if (!qefi_is_available() || !qefi_has_privilege())
{
QMessageBox::critical(nullptr, QObject::tr("Error"),
QObject::tr("Permission insufficient or no EFI environment"));
return 1;
}
QEFIEntryStaticList *list = QEFIEntryStaticList::instance();
list->load();
MainWindow w;
w.show();
return a.exec();
}