src/platform/qt/AboutScreen.cpp (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#include "AboutScreen.h"
7
8#include "util/version.h"
9
10#include <QPixmap>
11
12using namespace QGBA;
13
14AboutScreen::AboutScreen(QWidget* parent)
15 : QDialog(parent)
16{
17 m_ui.setupUi(this);
18
19 QPixmap logo(":/res/mgba-1024.png");
20 logo = logo.scaled(m_ui.logo->minimumSize() * devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
21 logo.setDevicePixelRatio(devicePixelRatio());
22 m_ui.logo->setPixmap(logo);
23
24 m_ui.projectName->setText(QLatin1String(projectName));
25 m_ui.projectVersion->setText(QLatin1String(projectVersion));
26 QString gitInfo = m_ui.gitInfo->text();
27 gitInfo.replace("{gitBranch}", QLatin1String(gitBranch));
28 gitInfo.replace("{gitCommit}", QLatin1String(gitCommit));
29 m_ui.gitInfo->setText(gitInfo);
30 QString description = m_ui.description->text();
31 description.replace("{projectName}", QLatin1String(projectName));
32 m_ui.description->setText(description);
33 QString extraLinks = m_ui.extraLinks->text();
34 extraLinks.replace("{gitBranch}", QLatin1String(gitBranch));
35 m_ui.extraLinks->setText(extraLinks);
36}