Repository navigation
Expand file tree
/
Copy pathaboutdialog.cpp
More file actions
89 lines (78 loc) · 3.95 KB
/
Copy pathaboutdialog.cpp
File metadata and controls
89 lines (78 loc) · 3.95 KB
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
84
85
86
87
88
89
// Copyright (C) 2025-2026 Pedro López-Cabanillas
// SPDX-License-Identifier: GPL-3.0-or-later
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QObject>
#include <QPixmap>
#include <QTabWidget>
#include <QTextBrowser>
#include <QVBoxLayout>
#include "aboutdialog.h"
AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle(tr("About RiffTreeGUI"));
resize(440, 314);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QTabWidget *tabs = new QTabWidget(this);
QWidget *aboutTab = new QWidget(this);
QVBoxLayout *aboutLayout = new QVBoxLayout(aboutTab);
QHBoxLayout *logoLayout = new QHBoxLayout();
QLabel *logoLabel = new QLabel();
QPixmap logo(":/images/RiffTree.png");
if (!logo.isNull()) {
logoLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
logoLabel->setPixmap(
logo.scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
QLabel *aboutText =
new QLabel(tr("<h2>RiffTreeGUI v%1</h2>"
"<p>RiffTreeGUI is a RIFF file structure viewer with hex content view</p>"
"<p>Copyright © 2025-2026 Pedro López-Cabanillas <plcl@users.sf.net></p>"
"<a href='https://github.com/pedrolcl/RiffTreeGUI/'>https://github.com/pedrolcl/RiffTreeGUI</a>"
"<p>Built with Qt %2</p>").arg(QT_STRINGIFY(VERSION), QT_VERSION_STR));
aboutText->setWordWrap(true);
aboutText->setOpenExternalLinks(true);
logoLayout->addWidget(logoLabel);
logoLayout->addWidget(aboutText);
aboutLayout->addLayout(logoLayout);
aboutLayout->addStretch();
tabs->addTab(aboutTab, tr("About"));
QWidget *creditsTab = new QWidget(this);
QVBoxLayout *creditsLayout = new QVBoxLayout(creditsTab);
QLabel *creditsLabel =
new QLabel(tr("This has been possible thanks to the following projects:<br><br>"
"<b>rifftree (Apache 2.0 license)</b><br>"
"<a href='https://github.com/jesustorresdev/rifftree'>https://github.com/jesustorresdev/rifftree</a><br>"
"Copyright © 2013 Jesús Torres<br><br>"
"<b>QHexView (MIT license)</b><br>"
"<a href='https://github.com/Dax89/QHexView'>https://github.com/Dax89/QHexView</a><br>"
"Copyright © 2014 Dax89<br>"));
creditsLabel->setWordWrap(true);
creditsLabel->setOpenExternalLinks(true);
creditsLayout->addWidget(creditsLabel);
creditsLayout->addStretch();
tabs->addTab(creditsTab, tr("Credits"));
QWidget *licenseTab = new QWidget(this);
QVBoxLayout *licenseLayout = new QVBoxLayout(licenseTab);
QTextBrowser *licenseText = new QTextBrowser(this);
licenseText->setHtml(tr("<p>Copyright © 2025-2026 Pedro López-Cabanillas</p>"
"<p>This program is free software: you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
"the Free Software Foundation, either version 3 of the License, or "
"(at your option) any later version.</p>"
"<p>This program is distributed in the hope that it will be useful, "
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
"GNU General Public License for more details.</p>"
"<p>You should have received a copy of the GNU General Public License "
"along with this program. If not, see "
"<a href='https://www.gnu.org/licenses'>https://www.gnu.org/licenses</a></p>"));
licenseText->setOpenExternalLinks(true);
licenseText->setWordWrapMode(QTextOption::WordWrap);
licenseLayout->addWidget(licenseText);
tabs->addTab(licenseTab, tr("License"));
mainLayout->addWidget(tabs);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
mainLayout->addWidget(buttonBox);
}