forked from ic005k/OCAuxiliaryTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aboutdialog.cpp
75 lines (62 loc) · 2.06 KB
/
aboutdialog.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
70
71
72
73
74
75
#include "aboutdialog.h"
#include "Method.h"
#include "mainwindow.h"
#include "ui_aboutdialog.h"
#include "ui_mainwindow.h"
extern MainWindow* mw_one;
extern QString strAppName, strIniFile;
QString CurVersion = "20220204";
QString ocVer = "0.7.8";
QString ocVerDev = "0.8.0";
QString ocFrom, ocFromDev, strOCFrom, strOCFromDev;
bool blDEV = false;
aboutDialog::aboutDialog(QWidget* parent)
: QDialog(parent), ui(new Ui::aboutDialog) {
ui->setupUi(this);
strOCFromDev =
"https://github.com/acidanthera/OpenCorePkg/actions/runs/1808597752/";
strOCFrom = "https://github.com/acidanthera/OpenCorePkg/releases/latest";
ocFrom = "<a href=\"" + strOCFrom + "\"" + "> " + tr(" Source ");
strIniFile =
QDir::homePath() + "/.config/" + strAppName + "/" + strAppName + ".ini";
QSettings Reg(strIniFile, QSettings::IniFormat);
QString ver = Reg.value("ocVer").toString();
if (ver != "") {
ocVer = ver;
}
ver = Reg.value("ocVerDev").toString();
if (ver > ocVerDev) {
ocVerDev = ver;
}
QString DevSource = Reg.value("DevSource").toString();
if (DevSource.trimmed() == "") {
ocFromDev =
""; // "<a href=\"" + strOCFromDev + "\"" + "> " + tr(" Source ");
} else {
ocFromDev =
"<a href=\"" + DevSource.trimmed() + "\"" + "> " + tr(" Source ");
}
setMaximumWidth(this->width());
setMaximumHeight(this->height());
setMinimumWidth(this->width());
setMinimumHeight(this->height());
ui->label->setFixedHeight(85);
ui->label->setFixedWidth(85);
ui->label->setText("");
ui->label->setStyleSheet(
"QLabel{"
"border-image:url(:/icon.png) 4 4 4 4 stretch stretch;"
"}");
if (!blDEV)
ui->lblVersion->setText(tr("Version") + " " + CurVersion +
" for OpenCore " + ocVer);
else
ui->lblVersion->setText(tr("Version") + " " + CurVersion +
" for OpenCore " + ocVerDev);
QFont font;
font.setBold(true);
font.setPixelSize(25);
ui->lblOCAT->setFont(font);
}
aboutDialog::~aboutDialog() { delete ui; }
void aboutDialog::initInfoStr() {}