Qt: Add patrons for October
Jeffrey Pfau jeffrey@endrift.com
Sun, 02 Oct 2016 17:11:43 -0700
4 files changed,
99 insertions(+),
32 deletions(-)
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.cpp
→
src/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.ui
→
src/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><a href="http://mgba.io/">Website</a> • <a href="https://forums.mgba.io/">Forums / Support</a> • <a href="https://patreon.com/mgba">Donate</a> • <a href="https://github.com/mgba-emu/mgba/tree/{gitBranch}">Source</a></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: <tt>{gitBranch}</tt><br/>Revision: <tt>{gitCommit}</tt></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><a href="http://mgba.io/">Website</a> • <a href="https://forums.mgba.io/">Forums / Support</a> • <a href="https://patreon.com/mgba">Donate</a> • <a href="https://github.com/mgba-emu/mgba/tree/{gitBranch}">Source</a></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: <tt>{gitBranch}</tt><br/>Revision: <tt>{gitCommit}</tt></string> - </property> - <property name="textInteractionFlags"> - <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> </property> </widget> </item>
M
src/platform/qt/resources.qrc
→
src/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>