2011-03-03 18:29:20 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2012-01-01 15:29:55 +01:00
|
|
|
* Copyright (C) 2010-2012 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"
|
|
|
|
#include "qupzilla.h"
|
|
|
|
#include "webview.h"
|
|
|
|
#include "webpage.h"
|
2011-04-07 18:00:26 +02:00
|
|
|
#include "qtwin.h"
|
2011-03-02 16:57:41 +01:00
|
|
|
|
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);
|
2011-04-07 18:00:26 +02:00
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
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()) {
|
|
|
|
m_aboutHtml.append("<div style='margin:10px;'>");
|
2011-12-16 14:46:31 +01:00
|
|
|
m_aboutHtml.append(tr("<p><b>Application version %1</b><br/>").arg(QupZilla::VERSION
|
|
|
|
#ifdef GIT_REVISION
|
2011-12-16 19:07:36 +01:00
|
|
|
+ " (" + GIT_REVISION + ")"
|
2011-12-16 14:46:31 +01:00
|
|
|
#endif
|
2011-12-16 19:07:36 +01:00
|
|
|
));
|
2011-03-02 16:57:41 +01:00
|
|
|
m_aboutHtml.append(tr("<b>WebKit version %1</b></p>").arg(QupZilla::WEBKITVERSION));
|
|
|
|
m_aboutHtml.append(tr("<p>© %1 %2<br/>All rights reserved.<br/>").arg(QupZilla::COPYRIGHT, QupZilla::AUTHOR));
|
2011-04-04 19:29:03 +02:00
|
|
|
m_aboutHtml.append(tr("<small>Build time: %1 </small></p>").arg(QupZilla::BUILDTIME));
|
2011-03-02 16:57:41 +01:00
|
|
|
m_aboutHtml.append(QString("<p><a href=%1>%1</a></p>").arg(QupZilla::WWWADDRESS));
|
2012-01-06 17:31:44 +01:00
|
|
|
m_aboutHtml.append("<p>" + mApp->getWindow()->weView()->webPage()->userAgentForUrl(QUrl()) + "</p>");
|
2011-03-02 16:57:41 +01:00
|
|
|
m_aboutHtml.append("</div>");
|
|
|
|
}
|
|
|
|
ui->textBrowser->setHtml(m_aboutHtml);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AboutDialog::showAuthors()
|
|
|
|
{
|
|
|
|
ui->authorsButton->setText(tr("< About QupZilla"));
|
|
|
|
if (m_authorsHtml.isEmpty()) {
|
|
|
|
m_authorsHtml.append("<div style='margin:10px;'>");
|
2012-01-09 16:23:03 +01:00
|
|
|
m_authorsHtml.append(tr("<p><b>Main developer:</b><br/>%1 <%2></p>").arg(QupZilla::AUTHOR, "<a href=mailto:nowrep@gmail.com>nowrep@gmail.com</a>"));
|
2012-01-09 22:14:02 +01:00
|
|
|
m_authorsHtml.append(tr("<p><b>Contributors:</b><br/>%1</p>").arg(
|
|
|
|
"Mladen Pejaković<br/>"
|
|
|
|
"Bryan M Dunsmore<br/>"
|
2012-01-17 12:39:30 +01:00
|
|
|
"Mariusz Fik<br/>"
|
2012-01-09 22:14:02 +01:00
|
|
|
"Jan Rajnoha<br/>"
|
|
|
|
"Daniele Cocca"
|
|
|
|
));
|
|
|
|
m_authorsHtml.append(tr("<p><b>Translators:</b><br/>%1</p>").arg(
|
|
|
|
"Heimen Stoffels (Dutch)<br/>"
|
|
|
|
"Peter Vacula (Slovakia)<br/>"
|
|
|
|
"Ján Ďanovský (Slovakia)<br/>"
|
|
|
|
"Jonathan Hooverman (German)<br/>"
|
|
|
|
"Unink-Lio (Chinese)<br/>"
|
|
|
|
"Federico Fabiani (Italy)<br/>"
|
|
|
|
"Francesco Marinucci (Italy)<br/>"
|
|
|
|
"Jorge Sevilla (Spanish)<br/>"
|
|
|
|
"Michał Szymanowski (Polish)<br/>"
|
2012-01-15 19:39:25 +01:00
|
|
|
"Mariusz Fik (Polish)<br/>"
|
2012-01-09 22:14:02 +01:00
|
|
|
"Jérôme Giry (French)<br/>"
|
|
|
|
"Nicolas Ourceau (French)<br/>"
|
|
|
|
"Vasilis Tsivikis (Greek)<br/>"
|
|
|
|
"Alexander Maslov (Russian)<br/>"
|
|
|
|
"Oleg Brezhnev (Russian)<br/>"
|
|
|
|
"Sérgio Marques (Portuguese)<br/>"
|
|
|
|
"Mladen Pejaković (Serbian)"
|
|
|
|
));
|
2011-03-02 16:57:41 +01:00
|
|
|
m_authorsHtml.append("</div>");
|
|
|
|
}
|
|
|
|
ui->textBrowser->setHtml(m_authorsHtml);
|
|
|
|
}
|
|
|
|
|
|
|
|
AboutDialog::~AboutDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|