Qt: Add patrons for October

This commit is contained in:
Jeffrey Pfau 2016-10-02 17:11:43 -07:00
parent a067bca332
commit f4798f9f04
4 changed files with 99 additions and 32 deletions

7
res/patrons.txt Normal file
View File

@ -0,0 +1,7 @@
Trey Boyer
Christopher Cole
Philip Horton
Lucy
Joshua Minor
Rohit Nirmal
Yuri Kunde Schlesner

View File

@ -9,6 +9,7 @@ extern "C" {
#include "core/version.h"
}
#include <QFile>
#include <QPixmap>
using namespace QGBA;
@ -28,16 +29,48 @@ AboutScreen::AboutScreen(QWidget* parent)
tree = QLatin1String(projectVersion);
}
QFile patronFile(":/res/patrons.txt");
QStringList patronList;
patronFile.open(QIODevice::ReadOnly | QIODevice::Text);
while (true) {
QByteArray line = patronFile.readLine();
if (line.isEmpty()) {
break;
}
patronList.append(QString::fromUtf8(line).trimmed());
}
m_ui.projectName->setText(QLatin1String(projectName));
m_ui.projectVersion->setText(QLatin1String(projectVersion));
QString gitInfo = m_ui.gitInfo->text();
gitInfo.replace("{gitBranch}", QLatin1String(gitBranch));
gitInfo.replace("{gitCommit}", QLatin1String(gitCommit));
m_ui.gitInfo->setText(gitInfo);
QString description = m_ui.description->text();
description.replace("{projectName}", QLatin1String(projectName));
m_ui.description->setText(description);
QString extraLinks = m_ui.extraLinks->text();
extraLinks.replace("{gitBranch}", tree);
m_ui.extraLinks->setText(extraLinks);
{
QString gitInfo = m_ui.gitInfo->text();
gitInfo.replace("{gitBranch}", QLatin1String(gitBranch));
gitInfo.replace("{gitCommit}", QLatin1String(gitCommit));
m_ui.gitInfo->setText(gitInfo);
}
{
QString description = m_ui.description->text();
description.replace("{projectName}", QLatin1String(projectName));
m_ui.description->setText(description);
}
{
QString extraLinks = m_ui.extraLinks->text();
extraLinks.replace("{gitBranch}", tree);
m_ui.extraLinks->setText(extraLinks);
}
{
QString patronsHeader = m_ui.patronsHeader->text();
patronsHeader.replace("{projectName}", QLatin1String(projectName));
m_ui.patronsHeader->setText(patronsHeader);
}
{
QString patrons = m_ui.patrons->text();
patrons.replace("{patrons}", patronList.join(""));
m_ui.patrons->setText(patrons);
}
}

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>609</width>
<height>272</height>
<width>617</width>
<height>341</height>
</rect>
</property>
<property name="windowTitle">
@ -17,6 +17,34 @@
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item row="4" column="1">
<widget class="QLabel" name="extraLinks">
<property name="text">
<string>&lt;a href=&quot;http://mgba.io/&quot;&gt;Website&lt;/a&gt; • &lt;a href=&quot;https://forums.mgba.io/&quot;&gt;Forums / Support&lt;/a&gt; • &lt;a href=&quot;https://patreon.com/mgba&quot;&gt;Donate&lt;/a&gt; • &lt;a href=&quot;https://github.com/mgba-emu/mgba/tree/{gitBranch}&quot;&gt;Source&lt;/a&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="gitInfo">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Branch: &lt;tt&gt;{gitBranch}&lt;/tt&gt;&lt;br/&gt;Revision: &lt;tt&gt;{gitCommit}&lt;/tt&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="projectName">
<property name="font">
@ -34,7 +62,20 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="4">
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="patronsHeader">
<property name="text">
<string>{projectName} would like to thank the following patrons from Patreon:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0" colspan="4">
<widget class="QLabel" name="copyright">
<property name="font">
<font>
@ -143,34 +184,19 @@ Game Boy Advance is a registered trademark of Nintendo Co., Ltd.</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="extraLinks">
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="patrons">
<property name="text">
<string>&lt;a href=&quot;http://mgba.io/&quot;&gt;Website&lt;/a&gt; • &lt;a href=&quot;https://forums.mgba.io/&quot;&gt;Forums / Support&lt;/a&gt; • &lt;a href=&quot;https://patreon.com/mgba&quot;&gt;Donate&lt;/a&gt; • &lt;a href=&quot;https://github.com/mgba-emu/mgba/tree/{gitBranch}&quot;&gt;Source&lt;/a&gt;</string>
<string>{patrons}</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="gitInfo">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Branch: &lt;tt&gt;{gitBranch}&lt;/tt&gt;&lt;br/&gt;Revision: &lt;tt&gt;{gitCommit}&lt;/tt&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -2,5 +2,6 @@
<qresource>
<file>../../../res/mgba-1024.png</file>
<file>../../../res/keymap.qpic</file>
<file>../../../res/patrons.txt</file>
</qresource>
</RCC>