2011-03-03 18:29:20 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2014-01-05 10:42:33 +01:00
|
|
|
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
2011-03-03 18:29:20 +01:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2011-03-02 16:57:41 +01:00
|
|
|
#include "aboutdialog.h"
|
|
|
|
#include "ui_aboutdialog.h"
|
2014-02-19 22:07:21 +01:00
|
|
|
#include "browserwindow.h"
|
2012-01-21 23:19:38 +01:00
|
|
|
#include "mainapplication.h"
|
2012-01-21 20:27:45 +01:00
|
|
|
#include "tabbedwebview.h"
|
2011-03-02 16:57:41 +01:00
|
|
|
#include "webpage.h"
|
2011-04-07 18:00:26 +02:00
|
|
|
#include "qtwin.h"
|
2012-05-04 14:44:54 +02:00
|
|
|
|
2014-02-19 22:07:21 +01:00
|
|
|
#if QT_VERSION < 0x050000
|
|
|
|
#include "qwebkitversion.h"
|
|
|
|
#else
|
|
|
|
#include <QWebPage>
|
|
|
|
#endif
|
|
|
|
|
2011-12-12 21:14:43 +01:00
|
|
|
AboutDialog::AboutDialog(QWidget* parent)
|
|
|
|
: QDialog(parent),
|
|
|
|
ui(new Ui::AboutDialog)
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2012-09-03 22:48:52 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2011-04-07 18:00:26 +02:00
|
|
|
if (QtWin::isCompositionEnabled()) {
|
|
|
|
QtWin::extendFrameIntoClientArea(this);
|
|
|
|
ui->verticalLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
#endif
|
2011-03-02 16:57:41 +01:00
|
|
|
|
|
|
|
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
|
|
|
|
connect(ui->authorsButton, SIGNAL(clicked()), this, SLOT(buttonClicked()));
|
|
|
|
|
|
|
|
showAbout();
|
2013-02-18 19:19:26 +01:00
|
|
|
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
resize(300, height());
|
|
|
|
#endif
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void AboutDialog::buttonClicked()
|
|
|
|
{
|
2011-11-06 17:01:23 +01:00
|
|
|
if (ui->authorsButton->text() == tr("Authors and Contributors")) {
|
2011-03-02 16:57:41 +01:00
|
|
|
showAuthors();
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
|
|
|
else if (ui->authorsButton->text() == tr("< About QupZilla")) {
|
2011-03-02 16:57:41 +01:00
|
|
|
showAbout();
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void AboutDialog::showAbout()
|
|
|
|
{
|
|
|
|
ui->authorsButton->setText(tr("Authors and Contributors"));
|
|
|
|
if (m_aboutHtml.isEmpty()) {
|
2012-03-30 12:01:12 +02:00
|
|
|
m_aboutHtml += "<center><div style='margin:10px;'>";
|
2014-04-17 15:20:54 +02:00
|
|
|
m_aboutHtml += tr("<p><b>Application version %1</b><br/>").arg(
|
2011-12-16 14:46:31 +01:00
|
|
|
#ifdef GIT_REVISION
|
2014-04-19 11:23:25 +02:00
|
|
|
QString("%1 (%2)").arg(Qz::VERSION, GIT_REVISION)
|
2014-04-17 15:20:54 +02:00
|
|
|
#else
|
2014-04-19 11:23:25 +02:00
|
|
|
Qz::VERSION
|
2011-12-16 14:46:31 +01:00
|
|
|
#endif
|
2014-04-19 11:23:25 +02:00
|
|
|
);
|
2014-02-19 22:07:21 +01:00
|
|
|
m_aboutHtml += tr("<b>WebKit version %1</b></p>").arg(qWebKitVersion());
|
|
|
|
m_aboutHtml += QString("<p>© %1 %2<br/>").arg(Qz::COPYRIGHT, Qz::AUTHOR);
|
|
|
|
m_aboutHtml += tr("<small>Build time: %1 </small></p>").arg(Qz::BUILDTIME);
|
|
|
|
m_aboutHtml += QString("<p><a href=%1>%1</a></p>").arg(Qz::WWWADDRESS);
|
2012-09-17 12:24:05 +02:00
|
|
|
m_aboutHtml += "<p>" + (mApp->windowCount() > 0 ? mApp->getWindow()->weView()->page()->userAgentForUrl(QUrl()) : QString()) + "</p>";
|
2012-03-30 12:01:12 +02:00
|
|
|
m_aboutHtml += "</div></center>";
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
ui->textBrowser->setHtml(m_aboutHtml);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AboutDialog::showAuthors()
|
|
|
|
{
|
|
|
|
ui->authorsButton->setText(tr("< About QupZilla"));
|
|
|
|
if (m_authorsHtml.isEmpty()) {
|
2012-03-30 12:01:12 +02:00
|
|
|
m_authorsHtml += "<center><div style='margin:10px;'>";
|
2014-02-19 22:07:21 +01:00
|
|
|
m_authorsHtml += tr("<p><b>Main developer:</b><br/>%1 <%2></p>").arg(Qz::AUTHOR, "<a href=mailto:nowrep@gmail.com>nowrep@gmail.com</a>");
|
2012-03-30 12:01:12 +02:00
|
|
|
m_authorsHtml += tr("<p><b>Contributors:</b><br/>%1</p>").arg(
|
2012-03-30 12:02:49 +02:00
|
|
|
QString::fromUtf8("Mladen Pejaković<br/>"
|
2012-04-09 19:45:00 +02:00
|
|
|
"Alexander Samilov<br/>"
|
2012-08-27 13:00:36 +02:00
|
|
|
"Seyyed Razi Alavizadeh<br/>"
|
|
|
|
"Franz Fellner<br/>"
|
2012-03-30 12:02:49 +02:00
|
|
|
"Bryan M Dunsmore<br/>"
|
|
|
|
"Mariusz Fik<br/>"
|
|
|
|
"Jan Rajnoha<br/>"
|
|
|
|
"Daniele Cocca")
|
|
|
|
);
|
2012-02-22 15:14:23 +01:00
|
|
|
|
2012-03-30 12:01:12 +02:00
|
|
|
m_authorsHtml += tr("<p><b>Translators:</b><br/>%1</p>").arg(
|
2012-03-30 12:02:49 +02:00
|
|
|
QString::fromUtf8("Heimen Stoffels<br/>"
|
|
|
|
"Peter Vacula<br/>"
|
|
|
|
"Jonathan Hooverman<br/>"
|
|
|
|
"Federico Fabiani<br/>"
|
|
|
|
"Francesco Marinucci<br/>"
|
|
|
|
"Jorge Sevilla<br/>"
|
|
|
|
"Ștefan Comănescu<br/>"
|
|
|
|
"Michał Szymanowski<br/>"
|
|
|
|
"Mariusz Fik<br/>"
|
|
|
|
"Jérôme Giry<br/>"
|
|
|
|
"Nicolas Ourceau<br/>"
|
|
|
|
"Vasilis Tsivikis<br/>"
|
|
|
|
"Rustam Salakhutdinov<br/>"
|
|
|
|
"Oleg Brezhnev<br/>"
|
|
|
|
"Sérgio Marques<br/>"
|
|
|
|
"Alexandre Carvalho<br/>"
|
|
|
|
"Mladen Pejaković<br/>"
|
|
|
|
"Unink-Lio<br/>"
|
|
|
|
"Wu Cheng-Hong<br/>"
|
|
|
|
"Widya Walesa<br/>"
|
|
|
|
"Beqa Arabuli<br/>"
|
|
|
|
"Daiki Noda<br/>"
|
|
|
|
"Gábor Oberle<br/>"
|
2012-05-04 14:44:54 +02:00
|
|
|
"Piccoro McKay Lenz<br/>"
|
2012-08-27 13:00:36 +02:00
|
|
|
"Stanislav Kuznietsov<br/>"
|
2013-02-23 16:19:25 +01:00
|
|
|
"Seyyed Razi Alavizadeh<br/>"
|
|
|
|
"Guillem Prats<br/>"
|
2013-03-11 17:19:11 +01:00
|
|
|
"Clara Villalba<br/>"
|
2013-07-28 20:55:28 +02:00
|
|
|
"Yu Hai<br/>"
|
2014-01-04 11:17:47 +01:00
|
|
|
"Muhammad Fawwaz Orabi<br/>"
|
2014-01-05 10:42:33 +01:00
|
|
|
"Lasso Kante<br/>"
|
2014-01-06 19:46:40 +01:00
|
|
|
"Kizito Birabwa<br/>"
|
2014-02-18 17:50:55 +01:00
|
|
|
"Juan Carlos Sánchez<br/>"
|
2014-10-01 20:41:19 +02:00
|
|
|
"Xabier Aramendi<br/>"
|
|
|
|
"Ferhat AYDIN")
|
2012-03-30 12:02:49 +02:00
|
|
|
);
|
2012-03-30 12:01:12 +02:00
|
|
|
m_authorsHtml += "</div></center>";
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
2012-03-30 12:01:12 +02:00
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
ui->textBrowser->setHtml(m_authorsHtml);
|
|
|
|
}
|
|
|
|
|
|
|
|
AboutDialog::~AboutDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|