all repos — mgba @ f4798f9f04a0239c7ce6040b870ccdd0f12ad6ad

mGBA Game Boy Advance Emulator

Qt: Add patrons for October
Jeffrey Pfau jeffrey@endrift.com
Sun, 02 Oct 2016 17:11:43 -0700
commit

f4798f9f04a0239c7ce6040b870ccdd0f12ad6ad

parent

a067bca33240718ad65cb3f3cd30dc35d195181d

A res/patrons.txt

@@ -0,0 +1,7 @@

+Trey Boyer +Christopher Cole +Philip Horton +Lucy +Joshua Minor +Rohit Nirmal +Yuri Kunde Schlesner
M src/platform/qt/AboutScreen.cppsrc/platform/qt/AboutScreen.cpp

@@ -9,6 +9,7 @@ extern "C" {

#include "core/version.h" } +#include <QFile> #include <QPixmap> using namespace QGBA;

@@ -28,16 +29,48 @@ if (tree == QLatin1String("(unknown)")) {

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); + } }
M src/platform/qt/AboutScreen.uisrc/platform/qt/AboutScreen.ui

@@ -6,8 +6,8 @@ <property name="geometry">

<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 @@ <layout class="QGridLayout" name="gridLayout_2">

<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 @@ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>

</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,31 +184,16 @@ <bool>true</bool>

</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>
M src/platform/qt/resources.qrcsrc/platform/qt/resources.qrc

@@ -2,5 +2,6 @@ <!DOCTYPE RCC><RCC version="1.0">

<qresource> <file>../../../res/mgba-1024.png</file> <file>../../../res/keymap.qpic</file> + <file>../../../res/patrons.txt</file> </qresource> </RCC>