From 32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 Mon Sep 17 00:00:00 2001 From: Thomas Groman Date: Thu, 19 Sep 2019 00:41:48 -0700 Subject: merged from 0.6.7 codebase --- application/dialogs/AboutDialog.cpp | 158 ++++++++++++++++++------------------ 1 file changed, 79 insertions(+), 79 deletions(-) (limited to 'application/dialogs/AboutDialog.cpp') diff --git a/application/dialogs/AboutDialog.cpp b/application/dialogs/AboutDialog.cpp index 8f2e72c2..ca1dfd94 100644 --- a/application/dialogs/AboutDialog.cpp +++ b/application/dialogs/AboutDialog.cpp @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2019 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,113 +27,113 @@ // This is a hack, but I can't think of a better way to do this easily without screwing with QTextDocument... static QString getCreditsHtml(QStringList patrons) { - QString creditsHtml = QObject::tr( - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "

MultiMC Developers

" - "

Andrew Okin <forkk@forkk.net>

" - "

Petr Mrázek <peterix@gmail.com>

" - "

Sky Welch <multimc@bunnies.io>

" - "

Jan (02JanDal) <02jandal@gmail.com>

" - "

RoboSky <@RoboSky_>

" - "" - "

With thanks to

" - "

Orochimarufan <orochimarufan.x3@gmail.com>

" - "

TakSuyu <taksuyu@gmail.com>

" - "

Kilobyte <stiepen22@gmx.de>

" - "

Rootbear75 <@rootbear75>

" - "" - "

Patrons

" - "%1" - "" - "" - ""); - if (patrons.isEmpty()) - return creditsHtml.arg(QObject::tr("

Loading...

")); - else - { - QString patronsStr; - for (QString patron : patrons) - { - patronsStr.append(QString("

%1

").arg(patron)); - } - - return creditsHtml.arg(patronsStr); - } + QString creditsHtml = QObject::tr( + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "

MultiMC Developers

" + "

Andrew Okin <forkk@forkk.net>

" + "

Petr Mrázek <peterix@gmail.com>

" + "

Sky Welch <multimc@bunnies.io>

" + "

Jan (02JanDal) <02jandal@gmail.com>

" + "

RoboSky <@RoboSky_>

" + "" + "

With thanks to

" + "

Orochimarufan <orochimarufan.x3@gmail.com>

" + "

TakSuyu <taksuyu@gmail.com>

" + "

Kilobyte <stiepen22@gmx.de>

" + "

Rootbear75 <@rootbear75>

" + "" + "

Patrons

" + "%1" + "" + "" + ""); + if (patrons.isEmpty()) + return creditsHtml.arg(QObject::tr("

Loading...

")); + else + { + QString patronsStr; + for (QString patron : patrons) + { + patronsStr.append(QString("

%1

").arg(patron)); + } + + return creditsHtml.arg(patronsStr); + } } static QString getLicenseHtml() { - HoeDown hoedown; - QFile dataFile(":/documents/COPYING.md"); - dataFile.open(QIODevice::ReadOnly); - QString output = hoedown.process(dataFile.readAll()); - return output; + HoeDown hoedown; + QFile dataFile(":/documents/COPYING.md"); + dataFile.open(QIODevice::ReadOnly); + QString output = hoedown.process(dataFile.readAll()); + return output; } AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog) { - ui->setupUi(this); + ui->setupUi(this); - QString chtml = getCreditsHtml(QStringList()); - ui->creditsText->setHtml(chtml); + QString chtml = getCreditsHtml(QStringList()); + ui->creditsText->setHtml(chtml); - QString lhtml = getLicenseHtml(); - ui->licenseText->setHtml(lhtml); + QString lhtml = getLicenseHtml(); + ui->licenseText->setHtml(lhtml); - ui->urlLabel->setOpenExternalLinks(true); + ui->urlLabel->setOpenExternalLinks(true); - ui->icon->setPixmap(MMC->getThemedIcon("logo").pixmap(64)); - ui->title->setText("MultiMC 5"); + ui->icon->setPixmap(MMC->getThemedIcon("logo").pixmap(64)); + ui->title->setText("MultiMC 5"); - ui->versionLabel->setText(tr("Version") +": " + BuildConfig.printableVersionString()); - ui->platformLabel->setText(tr("Platform") +": " + BuildConfig.BUILD_PLATFORM); + ui->versionLabel->setText(tr("Version") +": " + BuildConfig.printableVersionString()); + ui->platformLabel->setText(tr("Platform") +": " + BuildConfig.BUILD_PLATFORM); - if (BuildConfig.VERSION_BUILD >= 0) - ui->buildNumLabel->setText(tr("Build Number") +": " + QString::number(BuildConfig.VERSION_BUILD)); - else - ui->buildNumLabel->setVisible(false); + if (BuildConfig.VERSION_BUILD >= 0) + ui->buildNumLabel->setText(tr("Build Number") +": " + QString::number(BuildConfig.VERSION_BUILD)); + else + ui->buildNumLabel->setVisible(false); - if (!BuildConfig.VERSION_CHANNEL.isEmpty()) - ui->channelLabel->setText(tr("Channel") +": " + BuildConfig.VERSION_CHANNEL); - else - ui->channelLabel->setVisible(false); + if (!BuildConfig.VERSION_CHANNEL.isEmpty()) + ui->channelLabel->setText(tr("Channel") +": " + BuildConfig.VERSION_CHANNEL); + else + ui->channelLabel->setVisible(false); - connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); + connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); - connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt); + connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt); - loadPatronList(); + loadPatronList(); } AboutDialog::~AboutDialog() { - delete ui; + delete ui; } void AboutDialog::loadPatronList() { - netJob.reset(new NetJob("Patreon Patron List")); - netJob->addNetAction(Net::Download::makeByteArray(QUrl("http://files.multimc.org/patrons.txt"), &dataSink)); - connect(netJob.get(), &NetJob::succeeded, this, &AboutDialog::patronListLoaded); - netJob->start(); + netJob.reset(new NetJob("Patreon Patron List")); + netJob->addNetAction(Net::Download::makeByteArray(QUrl("https://files.multimc.org/patrons.txt"), &dataSink)); + connect(netJob.get(), &NetJob::succeeded, this, &AboutDialog::patronListLoaded); + netJob->start(); } void AboutDialog::patronListLoaded() { - QString patronListStr(dataSink); - dataSink.clear(); - QString html = getCreditsHtml(patronListStr.split("\n", QString::SkipEmptyParts)); - ui->creditsText->setHtml(html); + QString patronListStr(dataSink); + dataSink.clear(); + QString html = getCreditsHtml(patronListStr.split("\n", QString::SkipEmptyParts)); + ui->creditsText->setHtml(html); } -- cgit v1.2.3