/********* * * This file is part of BibleTime's source code, http://www.bibletime.info/. * * Copyright 1999-2016 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License version 2.0. * **********/ #include "frontend/btaboutdialog.h" #include "frontend/messagedialog.h" #include #include #include #include #include #include #include #include #include "frontend/btwebengineview.h" #include "util/btconnect.h" #include "util/bticons.h" #include "util/directory.h" // Sword includes: #include #define MAKE_STYLE(t) "" #define MAKE_HTML(t,x) "" MAKE_STYLE(t) "" + (x) + "" #define MAKE_LINK(c,u,t) ""; (c) += (t); (c) += "" #define MAKE_LINK_STATIC(u,t) "" t "" #define MAKE_CONTR(c,n,r) "
  • " n " (";\ (c) += (r);\ (c) += ")
  • " #define MAKE_CONTR2(c,n,r,r2) "
  • " n " (";\ (c) += (r);\ (c) += ", ";\ (c) += (r2);\ (c) += ")
  • " BtAboutDialog::BtAboutDialog(QWidget *parent, Qt::WindowFlags wflags) : QDialog(parent, wflags) { setAttribute(Qt::WA_DeleteOnClose); resize(640, 380); QVBoxLayout *mainLayout = new QVBoxLayout; QWidget *top = new QWidget(this); QHBoxLayout *topLayout = new QHBoxLayout; m_iconLabel = new QLabel(this); m_iconLabel->setPixmap(BtIcons::instance().icon_bibletime.pixmap(48)); topLayout->addWidget(m_iconLabel); m_versionLabel = new QLabel(this); QFont font = m_versionLabel->font(); font.setPointSize(font.pointSize()+6); font.setBold(true); m_versionLabel->setFont(font); topLayout->addWidget(m_versionLabel); top->setLayout(topLayout); mainLayout->addWidget(top, 0, Qt::AlignCenter); m_tabWidget = new QTabWidget(this); mainLayout->addWidget(m_tabWidget); initTab(m_bibletimeTab); initTab(m_contributorsTab); initTab(m_swordTab); initTab(m_qtTab); initTab(m_licenceTab); m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this); mainLayout->addWidget(m_buttonBox); setLayout(mainLayout); BT_CONNECT(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); retranslateUi(); } void BtAboutDialog::resizeEvent(QResizeEvent* event) { Q_UNUSED(event); QString version = "BibleTime " BT_VERSION; QFontMetrics fm(m_versionLabel->font()); int w = width() - m_iconLabel->width() - 80; QString shortVersion = fm.elidedText(version, Qt::ElideMiddle, w); m_versionLabel->setText(shortVersion); } void BtAboutDialog::initTab(BtWebEngineView *&tab) { tab = new BtWebEngineView(this); BtWebEnginePage * page = new BtWebEnginePage(this); tab->setPage(page); m_tabWidget->addTab(tab, ""); BT_CONNECT(tab->btPage(), SIGNAL(linkClicked(QUrl)), this, SLOT(linkClicked(QUrl))); } void BtAboutDialog::retranslateUi() { setWindowTitle(tr("About BibleTime")); retranslateBtTab(); retranslateContributorsTab(); retranslateSwordTab(); retranslateQtTab(); retranslateLicenceTab(); message::prepareDialogBox(m_buttonBox); } void BtAboutDialog::retranslateBtTab() { m_tabWidget->setTabText(0, tr("&BibleTime")); QString content("

    "); content += tr("BibleTime is an easy to use but powerful Bible study tool."); content += "

    "; content += tr("(c)1999-2016, The BibleTime Team"); content += "

    " MAKE_LINK_STATIC("http://www.bibletime.info", "www.bibletime.info") "

    "; m_bibletimeTab->setHtml(MAKE_HTML(m_bibletimeTab, content)); } void BtAboutDialog::retranslateContributorsTab() { m_tabWidget->setTabText(1, tr("&Contributors")); const QString developer(tr("developer")); const QString designer(tr("designer")); const QString artist(tr("artist")); /**************************************************************************************** *** NB!!! Credits are sorted alphabetically by last name! *** ****************************************************************************************/ QString content("

    "); content += tr("The following people contributed to BibleTime:"); content += "

      " MAKE_CONTR(content, "Thomas Abthorpe", tr("documentation and translation manager")) MAKE_CONTR2(content, "Joachim Ansorg", tr("project founder"), developer) MAKE_CONTR(content, "David Blue", designer) MAKE_CONTR(content, "Tim Brodie", developer) MAKE_CONTR(content, "Timothy R. Butler", designer) MAKE_CONTR(content, "Jim Campbell", developer) MAKE_CONTR(content, "Lee Carpenter", developer) MAKE_CONTR(content, "Jeremy Erickson", tr("packager")) MAKE_CONTR(content, "Troy A. Griffitts", tr("creator of The Sword Project")) MAKE_CONTR(content, "Martin Gruner", developer) MAKE_CONTR(content, "Thomas Hagedorn", tr("domain sponsor")) MAKE_CONTR(content, "Bob Harman", tr("howto")) MAKE_CONTR(content, "Gary Holmlund", developer) MAKE_CONTR(content, "Nikolay Igotti", developer) MAKE_CONTR(content, "Laurent Valentin Jospin", artist) MAKE_CONTR(content, "Eeli Kaikkonnen", developer) MAKE_CONTR(content, "Chris Kujawa", developer) MAKE_CONTR(content, "Mark Lybarger", developer) MAKE_CONTR(content, "Konstantin Maslyuk", developer) MAKE_CONTR(content, "Luke Mauldin", developer) MAKE_CONTR(content, "James Ots", designer) MAKE_CONTR(content, "Andrus Raag", artist) MAKE_CONTR2(content, "Jaak Ristioja", tr("project manager"), developer) MAKE_CONTR(content, "Fred Saalbach", tr("documentation")) MAKE_CONTR(content, "Erik Schanze", tr("documentation")) MAKE_CONTR(content, "Gary Sims", developer) MAKE_CONTR2(content, "Wolfgang Stradner", tr("tester"), tr("usability expert")) MAKE_CONTR(content, "Kang Sun", developer) MAKE_CONTR(content, "Thorsten Uhlmann", developer) MAKE_CONTR(content, "John Turpish", developer) MAKE_CONTR(content, "David White", developer) MAKE_CONTR(content, "Mark Zealey", developer) MAKE_CONTR(content, "Patrick Sebastian Zimmermann", developer) "

    "; /**************************************************************************************** *** NB!!! Credits are sorted alphabetically by last name! *** ****************************************************************************************/ content += tr("The following people translated BibleTime into their language:"); content += "

      " "
    • Horatiu Alexe
    • " "
    • Roy Alvear Aguirre
    • " "
    • Andrew Alfy
    • " "
    • Luis Barron
    • " "
    • Jan Bělohoubek
    • " "
    • Mário Castanheira
    • " "
    • Chun-shek Chan
    • " "
    • Nouhoun Y. Diarra
    • " "
    • Rafael Fagundes
    • " "
    • Eeli Kaikkonen
    • " "
    • Ilpo Kantonen
    • " "
    • Pavel Laukko
    • " "
    • Piotr Markiewicz
    • " "
    • Géza Novák
    • " "
    • Gabriel Pérez
    • " "
    • Igor Plisco
    • " "
    • Zdenko Podobný
    • " "
    • Jaak Ristioja
    • " "
    • Igor Rykhlin
    • " "
    • Vlad Savitsky
    • " "
    • Henrik Sonesson
    • " "
    • Johan van der Lingen
    • " "
    • Damian Wrzalski
    • " "
    • Konstantin Maslyuk
    • " "
    • Jean Van Schaftingen
    • " "
    • Roland Teschner
    • " "
    • Giovanni Tedaldi
    • " "
    • Dmitry Yurevich
    • " "
    • Esteban Zeller
    • " "

    "; content += tr("Some names may be missing, please file an issue at %1 if " "you notice errors or omissions.").arg(MAKE_LINK_STATIC( "https://github.com/bibletime/bibletime/issues", "https://github.com/bibletime/bibletime/issues")); content += "

    "; m_contributorsTab->setHtml(MAKE_HTML(m_contributorsTab, content)); } void BtAboutDialog::retranslateSwordTab() { m_tabWidget->setTabText(2, tr("&SWORD")); QString version(sword::SWVersion::currentVersion.getText()); QString content("

    "); content += tr("SWORD library version %1").arg(version); content += "

    "; content += tr("BibleTime makes use of the SWORD Project. The SWORD Project is the " "CrossWire Bible Society's free Bible software project. Its purpose is to " "create cross-platform open-source tools — covered by the GNU " "General Public License — that allow programmers and Bible " "societies to write new Bible software more quickly and easily."); content += "

    "; content += tr("The SWORD Project: "); content += MAKE_LINK_STATIC("http://www.crosswire.org/sword/", "www.crosswire.org/sword") "

    "; m_swordTab->setHtml(MAKE_HTML(m_swordTab, content)); } void BtAboutDialog::retranslateQtTab() { m_tabWidget->setTabText(3, tr("&Qt")); QString content("

    "); content += tr("Qt toolkit version %1").arg(qVersion()); content += "

    "; content += tr("This program uses Qt version %1.").arg(qVersion()); content += "

    "; content += tr("Qt is a cross-platform application and UI framework, created with C++ " "language. It has been released under the LGPL license."); content += " " MAKE_LINK(content, "http://qt", tr("More info...")) "

    "; m_qtTab->setHtml(MAKE_HTML(m_qtTab, content)); } void BtAboutDialog::retranslateLicenceTab() { m_tabWidget->setTabText(4, tr("&License")); QFile licFile(util::directory::getLicenseDir().path() + "/license.html"); if (licFile.open(QFile::ReadOnly)) { QString text("

    "); text += tr("BibleTime is released under the GPL license. You can download and use " "the program for personal, private, public or " "commercial purposes without restrictions, but can give away or " "distribute the program only if you also distribute the corresponding source " "code."); text += "

    "; text += tr("The complete legally binding license is below."); text += "


    "; QString content(QTextStream(&licFile).readAll().replace("", text)); content.replace("", MAKE_STYLE(m_licenceTab), Qt::CaseInsensitive); m_licenceTab->setHtml(content); licFile.close(); } } void BtAboutDialog::linkClicked(const QUrl &url) { if (url.host() == "qt") { qApp->aboutQt(); } else { QDesktopServices::openUrl(url); } }