-
Notifications
You must be signed in to change notification settings - Fork 4
/
aboutdialog.cpp
83 lines (74 loc) · 2.97 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
76
77
78
79
80
81
82
83
/*
* Copyright (c) 2020 xmuli
*
* Author: xmuli(偕臧) xmulitech@gmail.com
* GitHub: https://github.com/xmuli
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* */
#include "aboutdialog.h"
#include <QWidget>
#include <QLayout>
#include <QDebug>
#include <DLabel>
DWIDGET_USE_NAMESPACE
AboutDialog::AboutDialog(QWidget *parent)
: DDialog(parent)
{
init();
}
void AboutDialog::init()
{
setTitle(tr("lfxSpeed"));
setMessage(tr("A light and fast network speed plugin(DDE)."));
QVBoxLayout* mainLayout = static_cast<QVBoxLayout *>(layout());
DLabel *labLogo = new DLabel();
labLogo->setPixmap(QPixmap(":/images/lfxSpeed.svg"));
labLogo->resize(200, 200);
mainLayout->insertWidget(1, labLogo, 0, Qt::AlignCenter);
QWidget *content = new QWidget();
QVBoxLayout *vLayout = new QVBoxLayout(content);
vLayout->setContentsMargins(0, 0, 0, 0);
vLayout->addSpacing(15);
DLabel *labVersion = new DLabel(tr("Version: 0.7 2022/02/06"));
DLabel *labCopyright = new DLabel(tr("Copyright (c) 2021 By XMuli"));
vLayout->addWidget(labVersion, 0, Qt::AlignCenter);
vLayout->addWidget(labCopyright, 0, Qt::AlignCenter);
vLayout->addSpacing(15);
QHBoxLayout *hLayout = new QHBoxLayout();
hLayout->setContentsMargins(0, 0, 0, 0);
DLabel *labAuthor = new DLabel();
labAuthor->setOpenExternalLinks(true);
labAuthor->setText(tr("<a href=\"https://ifmet.cn\">Author"));
DLabel *labAcknowledgements = new DLabel();
labAcknowledgements->setOpenExternalLinks(true);
labAcknowledgements->setText(tr("<a href=\"https://github.com/justforlxz\">Thanks"));
DLabel *labGithub = new DLabel();
labGithub->setOpenExternalLinks(true);
labGithub->setText(tr("<a href=\"https://github.com/xmuli/lfxSpeed\">GitHub"));
DLabel *labLicense = new DLabel();
labLicense->setOpenExternalLinks(true);
labLicense->setText(tr("<a href=\"https://github.com/xmuli/lfxSpeed/blob/master/LICENSE\">License"));
DLabel *labDonation = new DLabel();
labDonation->setOpenExternalLinks(true);
labDonation->setText(tr("<a href=\"\">Donation"));
hLayout->addStretch(1);
hLayout->addWidget(labAuthor);
hLayout->addWidget(labAcknowledgements);
hLayout->addWidget(labGithub);
hLayout->addWidget(labLicense);
hLayout->addStretch(1);
hLayout->setStretch(1, 1);
hLayout->setStretch(2, 1);
hLayout->setStretch(3, 1);
vLayout->addLayout(hLayout);
addContent(content);
}