Skip to content
Snippets Groups Projects
aboutdialog.cpp 6.33 KiB
Newer Older
  • Learn to ignore specific revisions
  • hluk's avatar
    hluk committed
        Copyright (c) 2020, Lukas Holecek <hluk@email.cz>
    
    
        This file is part of CopyQ.
    
        CopyQ 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.
    
        CopyQ 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 CopyQ.  If not, see <http://www.gnu.org/licenses/>.
    */
    
    
    hluk's avatar
    hluk committed
    #include "aboutdialog.h"
    #include "ui_aboutdialog.h"
    
    hluk's avatar
    hluk committed
    
    
    #include "common/shortcuts.h"
    
    #include "common/textdata.h"
    
    #include "common/version.h"
    
    #include "gui/icons.h"
    
    hluk's avatar
    hluk committed
    #include "gui/iconfont.h"
    
    namespace {
    
    QString helpUrl(const char *url)
    {
    
        return QString::fromLatin1("<a href='%1'>%1</a>").arg(url);
    
    }
    
    QString helpMail(const char *url)
    {
    
        return QString::fromLatin1("<a href='mailto:%1'>%1</a>").arg(url);
    
    QString helpLink(const QString &name, const QString &link, ushort icon)
    
        return "<tr>"
               "<td class='info'>" + name + "</td>"
               "<td valign='middle' align='center' class='help-icon icon'>" + QString(QChar(icon)) + "</td>"
               "<td>" + link + "</td>"
               "</tr>";
    
    }
    
    QString helpDeveloper(const char *name, const char *mail)
    {
    
        return QString::fromLatin1("<div>%1 &nbsp;&nbsp;&nbsp;<span class='info'>%2</span></div>")
    
    hluk's avatar
    hluk committed
                .arg(QString::fromUtf8(name), mail);
    
    QString helpLib(const char *name, const QString &copyright, const char *url)
    
        return QString("<p><span class='library'>%1</span>"
    
                       "&nbsp;&nbsp;&nbsp;<br />"
                       "<span class='copyright'>%2</span><br />"
                       "%3</p>")
    
    hluk's avatar
    hluk committed
                .arg( name, copyright, helpUrl(url) );
    
    }
    
    } // namespace
    
    AboutDialog::AboutDialog(QWidget *parent)
        : QDialog(parent)
        , ui(new Ui::AboutDialog)
    {
        ui->setupUi(this);
        ui->textBrowser->setText( aboutPage() );
    }
    
    AboutDialog::~AboutDialog()
    {
        delete ui;
    }
    
    QString AboutDialog::aboutPage()
    
    hluk's avatar
    hluk committed
    {
        return
            "<html>"
    
    
            "<head><style type='text/css'>"
            "body{font-size:10pt;background:white;color:#333;margin:1.0em}"
            "p,li{margin-left:4ex;white-space:pre-wrap;margin-left:1ex}"
    
            "a{text-decoration:none;color:#4f9a6b}"
    
    hluk's avatar
    hluk committed
            "table{border:0}"
            "td{padding:0.1em}"
    
            "#title{font-size:26pt;color:#666;white-space:pre;margin-bottom:0.2em}"
    
            "#subtitle{font-size:16pt;color:#4f9a6b;white-space:pre;margin-bottom:0.2em}"
    
            "#version{font-size:12pt}"
    
            ".copyright{font-size:9pt;color:#666}"
    
    hluk's avatar
    hluk committed
            ".icon{font-family:" + iconFontFamily() + "}"
    
            ".help-icon{color:#5faa7b;padding-left:1em;padding-right:1em}"
    
            ".library{font-size:12pt}"
            ".info{color:#666}"
    
    hluk's avatar
    hluk committed
            "</style></head>"
    
            "<body>"
    
    
            "<table><tr valign='middle'>"
    
            "<td><img src=':/images/logo.png' width='128' /></td>"
    
            "<td>"
            "<div id='title'>CopyQ</div>"
            "<div id='subtitle'>" + escapeHtml(tr("Clipboard Manager")) + "</div>"
    
            "<div id='version'>" + COPYQ_VERSION "</div>"
    
            "</td>"
            "</tr></table>"
    
    hluk's avatar
    hluk committed
            "<p>"
            "<table class='links'>"
    
                + helpLink( tr("Author"), QString::fromUtf8("Lukáš Holeček"), IconUser )
    
                + helpLink( tr("E-mail"), helpMail("copyq@googlegroups.com"), IconEnvelope )
    
                + helpLink( tr("Web"), helpUrl("https://hluk.github.io/CopyQ/"), IconHome )
    
                + helpLink( tr("Donate"), helpUrl("https://liberapay.com/CopyQ/"), IconGift )
    
    hluk's avatar
    hluk committed
            "</table>"
            "</p>"
    
    hluk's avatar
    hluk committed
    
    
    hluk's avatar
    hluk committed
            "<p class='copyright'>Copyright (c) 2009 - 2020</p>"
    
    hluk's avatar
    hluk committed
            "<p></p>"
    
            + "<p>"
    
                + helpDeveloper("Adam Batkin", "adam@batkin.net")
    
    hluk's avatar
    hluk committed
                + helpDeveloper("Giacomo Margarito", "giacomomargarito@gmail.com")
                + helpDeveloper("Greg Carp", "grcarpbe@gmail.com")
    
                + helpDeveloper("Ilya Plenne", "libbkmz.dev@gmail.com")
    
    hluk's avatar
    hluk committed
                + helpDeveloper("Jörg Thalheim", "joerg@higgsboson.tk")
                + helpDeveloper("Kim Jzhone", "jzhone@gmail.com")
                + helpDeveloper("Kos Ivantsov", "kos.ivantsov@gmail.com")
    
                + helpDeveloper("lightonflux", "lightonflux@znn.info")
    
    hluk's avatar
    hluk committed
                + helpDeveloper("Lukas Holecek", "hluk@email.cz")
    
    hluk's avatar
    hluk committed
                + helpDeveloper("Marjolein Hoekstra", "http://twitter.com/cleverclogs")
    
                + helpDeveloper("Martin Lepadusch", "mlepadusch@googlemail.com")
    
                + helpDeveloper("Matt d'Entremont", "mattdentremont@gmail.com")
    
    hluk's avatar
    hluk committed
                + helpDeveloper("Michal Čihař", "michal@cihar.com")
    
                + helpDeveloper("Patricio M. Ros", "patricioros.dev@gmail.com")
    
                + helpDeveloper("Robert Orzanna", "robert@orzanna.de")
    
                + helpDeveloper("Ryan Wooden", "rygwdn@gmail.com")
    
                + helpDeveloper("Scott Kostyshak", "skostysh@princeton.edu")
                + helpDeveloper("Sebastian Schuberth", "sschuberth@gmail.com")
    
    hluk's avatar
    hluk committed
                + helpDeveloper("Tomas Nilzon", "tomas.nilzon@telia.com")
    
    hluk's avatar
    hluk committed
                + helpDeveloper("Wilfried Caruel", "wilfried.caruel@gmail.com")
    
    hluk's avatar
    hluk committed
                + helpDeveloper("x2357", "x2357handle@gmail.com")
    
    hluk's avatar
    hluk committed
                + helpLib("Qt Toolkit",
    
                          "Copyright (c) 2020 The Qt Company Ltd. and other contributors",
                          "https://www.qt.io/")
                + helpLib("KDE Frameworks",
                          "Copyright (c) 2020 KDE Community",
                          "https://develop.kde.org/products/frameworks/")
                + helpLib("Snoretoast",
                          "Copyright (c) 2013 - 2020 Hannah von Reth",
                          "https://invent.kde.org/libraries/snoretoast")
    
                          "Copyright (c) 2012 - 2020 Michal &#268;iha&#345;", "https://weblate.org")
    
                + helpLib("Font Awesome",
    
                          "Copyright (c) 2020 Fonticons, Inc.", "https://fontawesome.com")
    
                          "Copyright (c) 2006 - 2011, the LibQxt project", "http://libqxt.org")
    
                + helpLib("Solarized",
    
                          "Copyright (c) 2011 Ethan Schoonover", "https://ethanschoonover.com/solarized")
    
    hluk's avatar
    hluk committed
    
    
            + "<p></p>"
    
    hluk's avatar
    hluk committed
    
            "</body></html>";
    }