diff options
Diffstat (limited to 'src/aboutdialog.cpp')
| -rw-r--r-- | src/aboutdialog.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index a8b8d81d..d61aa4fa 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -17,45 +17,43 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. */ - #include "aboutdialog.h" -#include "ui_aboutdialog.h" #include "shared/util.h" +#include "ui_aboutdialog.h" #include <utility.h> #include <QApplication> +#include <QFontDatabase> #include <QLabel> #include <QListWidget> #include <QListWidgetItem> #include <QTextBrowser> #include <QVariant> #include <Qt> -#include <QFontDatabase> -AboutDialog::AboutDialog(const QString &version, QWidget *parent) - : QDialog(parent) - , ui(new Ui::AboutDialog) +AboutDialog::AboutDialog(const QString& version, QWidget* parent) + : QDialog(parent), ui(new Ui::AboutDialog) { ui->setupUi(this); - m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt"; - m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt"; - m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt"; - m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt"; - m_LicenseFiles[LICENSE_BOOST] = "boost.txt"; - m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt"; - m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt"; - m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt"; - m_LicenseFiles[LICENSE_PYTHON] = "python.txt"; - m_LicenseFiles[LICENSE_SSL] = "openssl.txt"; + m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt"; + m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt"; + m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt"; + m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt"; + m_LicenseFiles[LICENSE_BOOST] = "boost.txt"; + m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt"; + m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt"; + m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt"; + m_LicenseFiles[LICENSE_PYTHON] = "python.txt"; + m_LicenseFiles[LICENSE_SSL] = "openssl.txt"; m_LicenseFiles[LICENSE_CPPTOML] = "cpptoml.txt"; - m_LicenseFiles[LICENSE_UDIS] = "udis86.txt"; - m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt"; - m_LicenseFiles[LICENSE_FMT] = "fmt.txt"; - m_LicenseFiles[LICENSE_SIP] = "sip.txt"; - m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt"; - m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt"; - m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt"; + m_LicenseFiles[LICENSE_UDIS] = "udis86.txt"; + m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt"; + m_LicenseFiles[LICENSE_FMT] = "fmt.txt"; + m_LicenseFiles[LICENSE_SIP] = "sip.txt"; + m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt"; + m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt"; + m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt"; addLicense("Qt", LICENSE_LGPL3); addLicense("Qt Json", LICENSE_GPL3); @@ -64,7 +62,8 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) addLicense("ZLib", LICENSE_NONE); addLicense("Tango Icon Theme", LICENSE_NONE); addLicense("RRZE Icon Set", LICENSE_CCBY3); - addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3); + addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", + LICENSE_CCBY3); addLicense("Castle Core", LICENSE_CASTLE); addLicense("ANTLR", LICENSE_ANTLR); addLicense("LOOT", LICENSE_GPL3); @@ -77,7 +76,10 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) addLicense("SIP", LICENSE_SIP); addLicense("DXTex Headers", LICENSE_DXTEX); - ui->nameLabel->setText(QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>").arg(ui->nameLabel->text()).arg(version)); + ui->nameLabel->setText( + QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>") + .arg(ui->nameLabel->text()) + .arg(version)); #if defined(HGID) ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID); #elif defined(GITID) @@ -86,39 +88,37 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown"); #endif - - ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " + MOShared::getUsvfsVersionString()); + ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " + + MOShared::getUsvfsVersionString()); ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); } - AboutDialog::~AboutDialog() { delete ui; } - -void AboutDialog::addLicense(const QString &name, Licenses license) +void AboutDialog::addLicense(const QString& name, Licenses license) { - QListWidgetItem *item = new QListWidgetItem(name); + QListWidgetItem* item = new QListWidgetItem(name); item->setData(Qt::UserRole, license); ui->creditsList->addItem(item); } - -void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem*) +void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem* current, + QListWidgetItem*) { auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt()); if (iter != m_LicenseFiles.end()) { QString filePath = qApp->applicationDirPath() + "/licenses/" + iter->second; - QString text = MOBase::readFileText(filePath); + QString text = MOBase::readFileText(filePath); ui->licenseText->setText(text); } else { ui->licenseText->setText(tr("No license")); } } -void AboutDialog::on_sourceText_linkActivated(const QString &link) +void AboutDialog::on_sourceText_linkActivated(const QString& link) { MOBase::shell::Open(QUrl(link)); } |
