From e91c18f556cd9fb88ad91c858619c0cdc16e0e35 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 10 Aug 2018 19:10:23 -0400 Subject: [PATCH 1/3] Qt: Add list of contributors to about box --- AUTHORS.h | 270 +++++++++++++++++++++++++++++++++ intl/msg_hash_ja.h | 2 + intl/msg_hash_us.h | 2 + msg_hash.h | 1 + ui/drivers/qt/ui_qt_window.cpp | 42 ++++- ui/drivers/ui_qt.h | 1 + 6 files changed, 312 insertions(+), 6 deletions(-) create mode 100644 AUTHORS.h diff --git a/AUTHORS.h b/AUTHORS.h new file mode 100644 index 0000000000..8a11644efc --- /dev/null +++ b/AUTHORS.h @@ -0,0 +1,270 @@ +const char *retroarch_contributors_list = R"( +RetroArch and the libretro team would like to +acknowledge the following contributors: + +1ch (L0sted) +Aaahh Ahh (Aaahh) +Aaron Oneal (aarononeal) +Adam Mechtley (amechtley) +Adolfo Ketzer (reztek) +AdrianoML +ajefr +Alberto Simon (asimonf) +Alcaro +Alessandro Mangone (Vektor) (zevektor) +Alex Eckhart (alex34567) +Alex Folland (AlexFolland) +Alexander Spady (alkaseltzerspadt) +Alexandre Garcia (Alexandre-Garcia) +Alfredo Monclus (alfrix) +aliaspider +alphanu1 +altiereslima +Alwin Garside (Yogarine) +Amiga1200Gamer (amigagamer) +Andre Leiradella (leiradel) +Andrés (fr500) +Anthony J. Bentley (bentley) +AridRayne +Arto Vainiolehto (arakerlu) +asako (asakous) +Ash (QuarkTheAwesome) +Ashura (CoalaJoe) +Autechre64 +Avton1 +barbudreadmon +bearoso +blackgur +Boris Timofeev (btimofeev) +bparker06 +Brandon Johnson (Denu8thell) +Brian Koropoff (bkoropoff) +Brian S. Stephan (bsstephan) +Brunnis +bubuleur +Casey Borders (CaseyB) +ceb33 +celerizer +Chris Merrett (chrisfu) +chu (9chu) +CidVonHighwind +clienthax +Conn O'Griofa (psyke83) +cpsw +Cray Elliott (MP2E) +Cristian Sandu (crazyquark) +ctult +cubtekki +cucholix +cudencuden +cxd4 +dalter +Dan Weiss (Dwedit) +danieljg +Daniil Zhilin (GeneralFailer) +dankcushions +Danny Glover (DannyGlover) +Dave (freakdave) +Dave Leaver (danzel) +David Demelier (markand) +David Erickson (daviderickson) +David Shah (daveshah1) +David Walters (hiddenasbestos) +DEX357 +diablodiab +dibas +Diego A. (SuperrSonic) +Diego Viola (diegoviola) +Diogo Barros (BlueKore) +DogParty +dor3k +Dudu Akiva (duduke) +duganchen +duskgao +ekipan +ensra +erbridge +esoptron +Ethan Lee (flibitijibibo) +Ezio-PS +Fabio (Oibaf66) +Fabio Ritrovato (Sephiroth87) +Fayne Aldan (FayneAldan) +FIX94 +Flame Sage (chris062689) +Francisco José García García (frangarcj) +GameDragon2k +Garrett Brown (garbear) +gblues +Geoffrey Plitt (GeoffreyPlitt) +Glenn Hevey (hevey) +Googer +gouchi +Gregor Richards (GregorR) +Gui Andrade (archshift) +Gustavo Maciel Dias Vieira (gmdvieira) +gvbr +H. İbrahim Güngör (igungor) +hadess +Hans-Kristian Arntzen (Themaister) +Henri Gomez (hgomez) +Henri Gomez (hgomez-sonarsource) +Higor Eurípedes (heuripedes) +hizzlekizzle +Hugo B. (777sha) +hunterk +Hyllian +i30817 +iAmGhost +Jack (jakcron) +James Le Cuirot (chewi) +James Sexton (Bezier89) +Jan Holthuis (Holzhaus) +Jay McCarthy (jeapostrophe) +Jean-André Santoni (kivutar) +Jean-Paul Mari (djipi) +Jean-Sébastien Guay (Skylark13) +Joel (joel16) +Joerg Sonnenberger (jsonn) +Johannes Schickel (lordhoto) +John Regan (jprjr) +Jon Maddox (maddox) +Jonathan Relf (jonathanrelf) +Joohan Lee (losernator) +Jools Wills (joolswills) +Joseph Carter (iKarith) +Joseph Conan Montgomery (Grotke) +Josh Palmer (ShiftyAxel) +JuanVCS +Justin Jacobs (dorkster) +Justin Weiss (justinweiss) +Ken Rossato (rossato) +kurumushi +kwyxz +l3iggs +lasers +Lawrence Kesteloot (lkesteloot) +liffy (lifning) +Lionel Flandrin (simias) +littleguy77 +Logan (loganmc10) +lordashram +Lothar Serra Mari (lotharsm) +Lubosz Sarnecki (lubosz) +lucianposton +lxerandrew +Mahyar Koshkouei (deltabeard) +Marcelo Munhoz Pélos (mpelos) +markwkidd +Maschell +Mat M. (lioncash) +Matt Sephton (gingerbeardman) +Maxime Gauduin (alucryd) +mcrisostomo +meancoot +meepingsnesroms +meleu +Michael K. (kuxii2016) +Michał Durak (micechal) +Mico Chopitea (micochops) +miguelpinheiro +Mike Swanson (chungy) +miqlas (extrowerk) +misson20000 +Monroe88 +mprobinson +MrHuu +muzuiget +mwtremblay +Nathan S. (natinusala) +nattycleopatra +netux79 +nfnty +Nicolas Adenis-Lamarre (nadenislamarre) +Nicolas Guillaumin (nguillaumin) +Nicolas Lopez Fernandez (pyroesp) +Nikita Vakhrushev (JesterIOS) +Nikola Kocic (nikola-kocic) +Niouby +nosh01 +not6 (r-type) +notaz +nstCactus +nurupo +Oggom +Oleg Shevchenko (olsh) +opendata26 +orbea +OV2 +pamapa +Paolo Bonzini (bonzini) +Paul McCarty (a-shark) +Pedro Ribeiro (pedrib) +pinumbernumber +pponso1 +Ramiro Morales (ramiro) +retro-wertz +Richard Howell (rmaz) +Rob Loach (RobLoach) +Romain Gay (vikbez) +Romain Graillot (notnotme) +Romain TISSERAND (rtissera) +Roman Kalashnikov (lunixoid) +Royerson +rrooij +rsn8887 +Ryunam +rz5 +Saggi Mizrahi (ficoos) +SAKUJ0 +Sam Pagenkopf (44100hertz) +Sam Stenvall (Jalle19) +Scheiker +Sebastien Ronsse (sronsse) +Sergi Granell (xerpi) +Sergio Padrino (sergiou87) +sergio-br2 (sergiobenrocha2) +Seth Kingsley (sethk) +Shane Mouton (ismouton) +Shizeeg Unadequatov (shizeeg) +Skarsnik +slotek +sparklewind +spec-chum +Stefan (gizmo98) +stefan-gr +Steven M. Vascellaro (stevoisiak) +Stuart Carnie (stuartcarnie) +Sunguk Lee (d3m3vilurr) +Supernature2k +Sven (RetroSven) +Swizzy +Tatsuya79 +Terry Lewis (terry-au) +The Last Cabra (vanfanel) +thedax +theheroGAC +TheOfficialFloW +thiolliere +Toad King (ToadKing) +Tobias Jakobi (tobiasjakobi) +Tomáš Kelemen (ToKe79) +Torsten Paul (t-paul) +TotalCaesar659 +TroggleMonkey +Twinaphex +URBANsUNITED +vgmoose +Vicky C Lau (vickychenglau) +Vladimir Panteleev (CyberShadow) +Víctor "IlDucci" (IlDucci) +Wang Vincent (susemm) +webgeek1234 +xhp-creations +Yarsan Hoessain (hyarsan) +Yongwoon Cho (ssangkong) +yoshisuga +zeromus +zlice +Zoran Vuckovic (casdevel) +)"; diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 264689ad8c..e41a496669 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3710,3 +3710,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED, "更新に成功しました。変更を適用にするには、RetroArchを再起動する必要があります。") MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED, "更新に失敗しました。") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS, + "作成者") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 411f9f1dd8..78b0a76895 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -4248,3 +4248,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED, "RetroArch updated successfully. Please restart the application for the changes to take effect.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED, "Update failed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS, + "Contributors") diff --git a/msg_hash.h b/msg_hash.h index 633b9f53c8..ccbc6666ea 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1971,6 +1971,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY, MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS, MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT, + MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS, MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_DOCUMENTATION, MENU_ENUM_LABEL_VALUE_QT_NETWORK_ERROR, MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_NIGHTLY, diff --git a/ui/drivers/qt/ui_qt_window.cpp b/ui/drivers/qt/ui_qt_window.cpp index 7912935922..1fe1822f2f 100644 --- a/ui/drivers/qt/ui_qt_window.cpp +++ b/ui/drivers/qt/ui_qt_window.cpp @@ -66,6 +66,8 @@ extern "C" { #include } +#include "../../../AUTHORS.h" + #define TIMER_MSEC 1000 /* periodic timer for gathering statistics */ #define STATUS_MSG_THROTTLE_MSEC 250 @@ -89,6 +91,7 @@ extern "C" { #define PARTIAL_EXTENSION ".partial" #define TEMP_EXTENSION ".update_tmp" #define RETROARCH_NIGHTLY_UPDATE_PATH "../RetroArch_update.zip" +#define TEXT(src) "" #src static ui_window_qt_t ui_window = {0}; @@ -4644,16 +4647,46 @@ void MainWindow::setAllPlaylistsGridMaxCount(int count) m_allPlaylistsGridMaxCount = count; } +void MainWindow::onContributorsClicked() +{ + QScopedPointer dialog(new QDialog()); + QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); + QTextEdit *textEdit = new QTextEdit(dialog.data()); + + connect(buttonBox, SIGNAL(accepted()), dialog.data(), SLOT(accept())); + connect(buttonBox, SIGNAL(rejected()), dialog.data(), SLOT(reject())); + + dialog->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS)); + dialog->setLayout(new QVBoxLayout()); + + dialog->layout()->addWidget(textEdit); + + dialog->layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum)); + dialog->layout()->addWidget(buttonBox); + + textEdit->setReadOnly(true); + textEdit->setHtml(QString("
") + retroarch_contributors_list + "
"); + + dialog->resize(480, 640); + dialog->exec(); +} + void MainWindow::showAbout() { QScopedPointer dialog(new QDialog()); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); QString text = QString("RetroArch ") + PACKAGE_VERSION + "

" + "www.libretro.com" - "

" + "www.retroarch.com"; + "

" + "www.retroarch.com" + "
"; QLabel *label = new QLabel(text, dialog.data()); QPixmap pix = getInvader(); - QLabel *pixLabel = new QLabel(); + QLabel *pixLabel = new QLabel(dialog.data()); + QPushButton *contributorsPushButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS), dialog.data()); + + connect(contributorsPushButton, SIGNAL(clicked()), this, SLOT(onContributorsClicked())); + connect(buttonBox, SIGNAL(accepted()), dialog.data(), SLOT(accept())); + connect(buttonBox, SIGNAL(rejected()), dialog.data(), SLOT(reject())); label->setTextFormat(Qt::RichText); label->setAlignment(Qt::AlignCenter); @@ -4661,17 +4694,14 @@ void MainWindow::showAbout() label->setOpenExternalLinks(true); pixLabel->setAlignment(Qt::AlignCenter); - pixLabel->setPixmap(pix); - connect(buttonBox, SIGNAL(accepted()), dialog.data(), SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), dialog.data(), SLOT(reject())); - dialog->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT)); dialog->setLayout(new QVBoxLayout()); dialog->layout()->addWidget(pixLabel); dialog->layout()->addWidget(label); + dialog->layout()->addWidget(contributorsPushButton); dialog->layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding)); dialog->layout()->addWidget(buttonBox); diff --git a/ui/drivers/ui_qt.h b/ui/drivers/ui_qt.h index 0b7d554f3f..628ae62d31 100644 --- a/ui/drivers/ui_qt.h +++ b/ui/drivers/ui_qt.h @@ -440,6 +440,7 @@ private slots: void onUpdateDownloadReadyRead(); void onUpdateDownloadCanceled(); void onShowErrorMessage(QString msg); + void onContributorsClicked(); int onExtractArchive(QString path); private: From 177642ac2fd19934b4e880561c9bd0f6bc775ead Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 10 Aug 2018 19:20:13 -0400 Subject: [PATCH 2/3] add script to fetch list of github contributors --- github-contributors.py | 120 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 github-contributors.py diff --git a/github-contributors.py b/github-contributors.py new file mode 100644 index 0000000000..59a0889883 --- /dev/null +++ b/github-contributors.py @@ -0,0 +1,120 @@ +#!/usr/bin/python3 +# +# Get list of repo contributors from GitHub using v4 GraphQL API +# +# Copyright (C) 2018 - Brad Parker +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from urllib.request import urlopen, Request +import json + +### SETTINGS ### +# https://help.github.com/articles/creating-an-access-token-for-command-line-use/ +TOKEN = 'Your access token here' +orgName = 'libretro' +repoName = 'RetroArch' +### END SETTINGS ### + +###### + +lines = [] + +def get_contributors(after=None): + global lines + headers = {'Authorization': 'bearer ' + TOKEN} + url = 'https://api.github.com/graphql' + + dataStr = """{ + repository(owner: \"""" + orgName + """\", name: \"""" + repoName + """\") { +""" + + if after: + dataStr += """ + mentionableUsers(first: 100 after:\"""" + after + """\") { +""" + else: + dataStr += """ + mentionableUsers(first: 100) { +""" + + dataStr += """ + edges { + node { + name + login + } + cursor + } + } + } + } +""" + + d = {'query': dataStr} + + data = json.dumps(d).encode('utf-8') + + req = Request(url, data, headers) + + with urlopen(req) as resp: + d = resp.read() + + j = json.loads(d) + + if len(j['data']['repository']['mentionableUsers']['edges']) == 0: + return None + + cursor = None + + for key in j['data']['repository']['mentionableUsers']['edges']: + line = '' + name = None + login = None + node = key['node'] + + if 'name' in node and node['name'] and len(node['name']) > 0: + name = node['name'] + + if 'login' in node and node['login'] and len(node['login']) > 0: + login = node['login'] + + if 'cursor' in key and key['cursor'] and len(key['cursor']) > 0: + cursor = key['cursor'] + + if name: + line = name + + if login and login.lower() != name.lower(): + line += ' (' + login + ')' + elif login: + line = login + else: + continue + + if len(line) > 0: + lines.append(line) + + if cursor and len(cursor) > 0: + return cursor + +def doit(cont): + after = get_contributors(cont) + + if after: + doit(after) + +doit(None) + +print('\n'.join(sorted(lines, key=str.lower))) From 376608aea0ddbdbcec8c5e67e6bf1d1fa4da8905 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 10 Aug 2018 19:23:52 -0400 Subject: [PATCH 3/3] Qt: cleanup --- ui/drivers/qt/ui_qt_window.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/drivers/qt/ui_qt_window.cpp b/ui/drivers/qt/ui_qt_window.cpp index 1fe1822f2f..6423c2f8f4 100644 --- a/ui/drivers/qt/ui_qt_window.cpp +++ b/ui/drivers/qt/ui_qt_window.cpp @@ -91,7 +91,6 @@ extern "C" { #define PARTIAL_EXTENSION ".partial" #define TEMP_EXTENSION ".update_tmp" #define RETROARCH_NIGHTLY_UPDATE_PATH "../RetroArch_update.zip" -#define TEXT(src) "" #src static ui_window_qt_t ui_window = {0};