Falkon Develop
Cross-platform Qt-based web browser
aboutdialog.cpp
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#include "aboutdialog.h"
19#include "ui_aboutdialog.h"
20#include "browserwindow.h"
21#include "mainapplication.h"
22#include "webpage.h"
23#include "useragentmanager.h"
24#include "../config.h"
25
26#include <QWebEnginePage>
27#include <QWebEngineProfile>
28#include <QtWebEngineCoreVersion>
29
31 : QDialog(parent)
32 , ui(new Ui::AboutDialog)
33{
34 setAttribute(Qt::WA_DeleteOnClose);
35
36 ui->setupUi(this);
37 ui->label->setPixmap(QIcon(QSL(":icons/other/about.svg")).pixmap(QSize(256, 100) * 1.1));
38
39 showAbout();
40}
41
43{
44 delete ui;
45}
46
47void AboutDialog::showAbout()
48{
49 QString aboutHtml;
50 aboutHtml += QSL("<div style='margin:0px 20px;'>");
51 aboutHtml += tr("<p><b>Application version %1</b><br/>").arg(
52#ifdef FALKON_GIT_REVISION
53 QString(QSL("%1 (%2)")).arg(QString::fromLatin1(Qz::VERSION), QL1S(FALKON_GIT_REVISION))
54#else
55 QString::fromLatin1(Qz::VERSION)
56#endif
57 );
58 aboutHtml += tr("<b>QtWebEngine version %1</b></p>").arg(QStringLiteral(QTWEBENGINECORE_VERSION_STR));
59 aboutHtml += QStringLiteral("<p>&copy; %1 %2<br/>").arg(QString::fromLatin1(Qz::COPYRIGHT), QString::fromLatin1(Qz::AUTHOR));
60 aboutHtml += QStringLiteral("<a href=%1>%1</a></p>").arg(QString::fromLatin1(Qz::WWWADDRESS));
61 aboutHtml += QStringLiteral("<p>") + mApp->userAgentManager()->defaultUserAgent() + QStringLiteral("</p>");
62 aboutHtml += QStringLiteral("</div>");
63 ui->textLabel->setText(aboutHtml);
64 setFixedHeight(sizeHint().height());
65}
AboutDialog(QWidget *parent=nullptr)
Definition: aboutdialog.cpp:30
#define mApp
FALKON_EXPORT const char * AUTHOR
Definition: qzcommon.cpp:27
FALKON_EXPORT const char * VERSION
Definition: qzcommon.cpp:26
FALKON_EXPORT const char * WWWADDRESS
Definition: qzcommon.cpp:29
FALKON_EXPORT const char * COPYRIGHT
Definition: qzcommon.cpp:28
#define QL1S(x)
Definition: qzcommon.h:44
#define QSL(x)
Definition: qzcommon.h:40