/* ============================================================ * QupZilla - WebKit based browser * Copyright (C) 2010-2014 David Rosca * * 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 . * ============================================================ */ #include "aboutdialog.h" #include "ui_aboutdialog.h" #include "browserwindow.h" #include "mainapplication.h" #include "tabbedwebview.h" #include "webpage.h" #include "qtwin.h" #if QT_VERSION < 0x050000 #include "qwebkitversion.h" #else #include #endif AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(this); #ifdef Q_OS_WIN if (QtWin::isCompositionEnabled()) { QtWin::extendFrameIntoClientArea(this); ui->verticalLayout->setContentsMargins(0, 0, 0, 0); } #endif connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->authorsButton, SIGNAL(clicked()), this, SLOT(buttonClicked())); showAbout(); #ifdef Q_OS_WIN resize(300, height()); #endif } void AboutDialog::buttonClicked() { if (ui->authorsButton->text() == tr("Authors and Contributors")) { showAuthors(); } else if (ui->authorsButton->text() == tr("< About QupZilla")) { showAbout(); } } void AboutDialog::showAbout() { ui->authorsButton->setText(tr("Authors and Contributors")); if (m_aboutHtml.isEmpty()) { m_aboutHtml += "
"; m_aboutHtml += tr("

Application version %1
").arg( #ifdef GIT_REVISION QString("%1 (%2)").arg(Qz::VERSION, GIT_REVISION) #else Qz::VERSION #endif ); #if QTWEBENGINE_DISABLED m_aboutHtml += tr("WebKit version %1

").arg(qWebKitVersion()); #endif m_aboutHtml += QString("

© %1 %2
").arg(Qz::COPYRIGHT, Qz::AUTHOR); m_aboutHtml += tr("Build time: %1

").arg(Qz::BUILDTIME); m_aboutHtml += QString("

%1

").arg(Qz::WWWADDRESS); #if QTWEBENGINE_DISABLED m_aboutHtml += "

" + (mApp->windowCount() > 0 ? mApp->getWindow()->weView()->page()->userAgentForUrl(QUrl()) : QString()) + "

"; #endif m_aboutHtml += "
"; } ui->textBrowser->setHtml(m_aboutHtml); } void AboutDialog::showAuthors() { ui->authorsButton->setText(tr("< About QupZilla")); if (m_authorsHtml.isEmpty()) { m_authorsHtml += "
"; m_authorsHtml += tr("

Main developer:
%1 <%2>

").arg(Qz::AUTHOR, "nowrep@gmail.com"); m_authorsHtml += tr("

Contributors:
%1

").arg( QString::fromUtf8("Mladen Pejaković
" "Alexander Samilov
" "Seyyed Razi Alavizadeh
" "Franz Fellner
" "Bryan M Dunsmore
" "Mariusz Fik
" "Jan Rajnoha
" "Daniele Cocca") ); m_authorsHtml += tr("

Translators:
%1

").arg( QString::fromUtf8("Heimen Stoffels
" "Peter Vacula
" "Jonathan Hooverman
" "Federico Fabiani
" "Francesco Marinucci
" "Jorge Sevilla
" "Ștefan Comănescu
" "Michał Szymanowski
" "Mariusz Fik
" "Jérôme Giry
" "Nicolas Ourceau
" "Vasilis Tsivikis
" "Rustam Salakhutdinov
" "Oleg Brezhnev
" "Sérgio Marques
" "Alexandre Carvalho
" "Mladen Pejaković
" "Unink-Lio
" "Wu Cheng-Hong
" "Widya Walesa
" "Beqa Arabuli
" "Daiki Noda
" "Gábor Oberle
" "Piccoro McKay Lenz
" "Stanislav Kuznietsov
" "Seyyed Razi Alavizadeh
" "Guillem Prats
" "Clara Villalba
" "Yu Hai
" "Muhammad Fawwaz Orabi
" "Lasso Kante
" "Kizito Birabwa
" "Juan Carlos Sánchez
" "Xabier Aramendi
" "Ferhat AYDIN") ); m_authorsHtml += "
"; } ui->textBrowser->setHtml(m_authorsHtml); } AboutDialog::~AboutDialog() { delete ui; }