-
Notifications
You must be signed in to change notification settings - Fork 0
/
caboutdialog.cpp
84 lines (65 loc) · 3.16 KB
/
caboutdialog.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
#include "caboutdialog.h"
#include "ui_caboutdialog.h"
#include <QFile>
#include <QDesktopServices>
CAboutDialog::CAboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CAboutDialog)
{
ui->setupUi(this);
// 加载Qss风格
QFile qssFile("./qss/dlg.qss");
if (!qssFile.open(QFile::ReadOnly | QFile::Text))
qWarning("failed to load dlg.qss file.");
setStyleSheet(qssFile.readAll());
qssFile.close();
ui->widget->setFixedSize(QSize(528/2, 497/2));
ui->widget->setStyleSheet("border-image: url(:/bgpic/panda.png)");
ui->textEdit->setFrameStyle(QFrame::NoFrame | QFrame::Sunken);
ui->textEdit->insertPlainText("EPON Packet Analyzer\n\n");
ui->textEdit->insertPlainText("说明:\n");
ui->textEdit->insertPlainText("1) 支持传统的.pcap文件格式;\n");
ui->textEdit->insertPlainText("2) 支持通过Titan捕获的EPON报文;\n");
ui->textEdit->insertPlainText("3) 不支持.pcapng文件格式,需先使用Wireshark另存为.pcap格式;\n\n");
ui->textEdit->insertPlainText("Version: 0.3\n");
ui->textEdit->insertPlainText("1) 增加过滤器功能,过滤条件之间的关系为\"And\"。\n");
ui->textEdit->insertPlainText("2) 增加MPCP Gate报文Overlap检查;\n");
ui->textEdit->insertPlainText("3) 右下角报文内容窗口支持行号与缩略图显示;\n");
ui->textEdit->insertPlainText("4) 修正bug;\n\n");
ui->textEdit->insertPlainText("Version: 0.2\n");
ui->textEdit->insertPlainText("1) 增加按列排序功能;\n\n");
ui->textEdit->insertPlainText("Version: 0.1\nEPON 报文解析器基本功能就绪。\n");
ui->textEdit->setReadOnly(true);
QTextCursor cursor = ui->textEdit->textCursor();
cursor.movePosition(QTextCursor::Start);
QTextCharFormat fmt = cursor.blockCharFormat();
fmt.setForeground(QColor(234, 204, 82));
fmt.setFont(QFont("Microsoft YaHei UI", 14, QFont::Bold));
//fmt.setFontItalic(true);
cursor.select(QTextCursor::LineUnderCursor);
cursor.setCharFormat(fmt);
cursor.movePosition(QTextCursor::Start);
ui->textEdit->setTextCursor(cursor);
QString emailHtml = "<a href=\"mailto: gzlldx@163.com\"><font color=#eacc52>gzlldx@163.com</font></a>";
ui->labelEMail->setText(emailHtml);
connect(ui->labelEMail, SIGNAL(linkActivated(QString)), this, SLOT(sendEMail(QString)));
ui->labelWeb->setOpenExternalLinks(true);
//ui->labelWeb->setText("<a style='color: #eacc52; text-decoration: none;' href=\"https://github.com/gzlldx/EPON-Packet-Parser\">https://github.com/gzlldx/EPON-Packet-Parser</a>");
ui->labelWeb->setText("<a style='color: #eacc52; text-decoration: none;' href=\"https://github.com/gzlldx/EPON-Packet-Parser\">https://github.com/gzlldx/EPON-Packet-Parser</a>");
QObject::connect(ui->btnOK, &QPushButton::clicked, this, [=](bool checked) { accept(); });
}
CAboutDialog::~CAboutDialog()
{
delete ui;
}
void CAboutDialog::on_buttonBox_accepted()
{
close();
}
void CAboutDialog::sendEMail(const QString &text)
{
// 打开对应url的网址
// mailto:user@foo.com?subject=Test&body=Just a test
qDebug() << text;
QDesktopServices::openUrl(QUrl(text));
}