-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
65 lines (55 loc) · 2.05 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
#include <QtWidgets/QApplication>
#include <QtWidgets/QSystemTrayIcon>
#include <QDir>
#include "mainwindow.h"
#include <QTranslator>
#include <QSharedMemory>
#include <QProcess>
#include <QMessageBox>
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(Icons);
Q_INIT_RESOURCE(languages);
Q_INIT_RESOURCE(config);
QApplication a(argc, argv);
QDate mDateExpire;
mDateExpire.setDate(2100, 10, 07);
if (QDate::currentDate().daysTo(mDateExpire) >= 0)
{
QMessageBox msg;
msg.setWindowIcon(QIcon(":Icons/icon-evergreen-alt.ico"));
msg.setWindowTitle(QObject::tr("Product Not Activated"));
msg.setText("this product is in trailer mode, days left " + QString::number(QDate::currentDate().daysTo(mDateExpire)));
msg.setIcon(QMessageBox::Information);
msg.exec();
QTranslator translator;
translator.load(":biblioYass_ar");
a.installTranslator(&translator);
a.setWindowIcon(QIcon(QPixmap(":Icons/icon-evergreen-alt.ico")));
QDir mDir(QDir::homePath() + "/AppData/Roaming/bits");
if (!mDir.exists())
mDir.mkdir(QDir::homePath() + "/AppData/Roaming/bits");
MainWindow w;
if (!QSystemTrayIcon::isSystemTrayAvailable())
{
QMessageBox::critical(0, QObject::tr("Systray"),
QObject::tr("I couldn't detect any system tray "
"on this system."));
return 1;
}
QApplication::setQuitOnLastWindowClosed(true);
w.show();
return a.exec();
}
else
{
QMessageBox msg;
msg.setWindowIcon(QIcon(":Icons/icon-evergreen-alt.png"));
msg.setWindowTitle(QObject::tr("Activate Product"));
msg.setText(QObject::tr("this product is not free to use, buy it."
"Contact Us: [email protected]"));
msg.setIcon(QMessageBox::Information);
msg.exec();
exit(0);
}
}