Skip to content
Permalink
Browse files
dev splash with avatars of most active committers (#43702)
  • Loading branch information
3nids committed Jun 15, 2021
1 parent 4514e5e commit e8efe8164200d03ec2ce7cd857512c7987977493
@@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/images">
<file alias="last-hackfest.png">splash/dev-splash.png</file>
<file>flags/af.svg</file>
<file>flags/ar.svg</file>
<file>flags/bg.svg</file>
Binary file not shown.
@@ -0,0 +1,3 @@
avatars*
mosaic*

@@ -0,0 +1,89 @@
#!/usr/bin/env bash

if [[ "$1" == "--keep-avatars" ]]; then
keep_avatars=true
else
keep_avatars=false
fi

# = 12x9-2*9(QGIS blocks)
tile_side=3
avatars_per_tile=$((tile_side*tile_side))
mosaic_width_tiles=6
mosaic_height_tiles=3
number_of_tiles=$((mosaic_width_tiles*mosaic_height_tiles-2))
number_of_avatars=$((number_of_tiles*avatars_per_tile))

font=Source-Sans-Pro-Bold
grey="#303030"
green="#5d9933"

! convert -list font | grep -Fq Source-Sans-Pro-Bold && echo "Font ${font} not found" && exit 1

# get avatars
if [[ "${keep_avatars}" == "true" ]]; then
echo "skipping avatars"
else
rm -f avatars.dat || true
# touch avatars.dat
for p in 1 2; do
echo "downloading avatars page $p"
curl -u username:"$token" -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/qgis/QGIS/contributors?page=${p}&per_page=$((number_of_avatars/2))" \
| jq -r "sort_by(.contributions) | reverse | .[] | \"\(.login) \(.avatar_url)\"" >> avatars.dat
done

for (( t=0; t<number_of_tiles; t++ )); do
odir=avatars_${t}
mkdir -p ${odir}
rm -f ${odir}/*.png
done

i=0
while read -r line; do
login=$(echo "${line}" | cut -d ' ' -f1)
url=$(echo "${line}" | cut -d ' ' -f2)

t=$(((i - i%avatars_per_tile)/avatars_per_tile))
odir=avatars_${t}
output=${odir}/${i}.png

if [[ -f alternate-avatars/${login}.png ]]; then
echo "alternate avatar for ${login}"
cp alternate-avatars/${login}.png ${output}
else
echo "downloading avatar for ${login}"
wget -q ${url} -O ${odir}/${i}.png
fi
((i=i+1))
done < avatars.dat
fi

echo "create tiles"
mkdir -p mosaic
rm -f mosaic/*.png
for (( t=0; t<number_of_tiles; t++ )); do
echo "tile $t"
montage -background '#2e2e2eff' -geometry 200x200+2+2 -tile 3x3 avatars_${t}/*.png mosaic/mosaic$(printf "%02d" ${t})0.png
done

# create QGIS block
echo "create QGIS block"
convert -background "${grey}" -density 1200 -resize 400x400 ../../icons/qgis_icon.svg mosaic/mosaic071.png

# create dev block
echo "create dev block"
convert -size 400x400 xc:${green} \
-gravity Center \
-font "${font}" \
-fill "${grey}" \
-pointsize 200 \
-annotate 0 "dev" \
mosaic/mosaic072.png

echo "compute mosaic"
tile_size=400
montage -background "${grey}" -geometry ${tile_size}x${tile_size} -tile ${mosaic_width_tiles}x${mosaic_height_tiles} mosaic/*.png mosaic.png
mosaic_width=$((tile_size*mosaic_width_tiles))
mosaic_height=$((tile_size*mosaic_height_tiles+tile_size/tile_side))
convert mosaic.png -resize ${mosaic_width}x${mosaic_height} -background "${grey}" -gravity North -extent ${mosaic_width}x${mosaic_height} ../splash.png
BIN +7.58 MB (530%) images/splash/splash.png
Binary file not shown.
@@ -835,6 +835,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
sInstance = this;
QgsRuntimeProfiler *profiler = QgsApplication::profiler();

QColor splashTextColor = Qgis::releaseName() == QStringLiteral( "Master" ) ? QColor( 93, 153, 51 ) : Qt::black;

startProfile( tr( "Create user profile manager" ) );
mUserProfileManager = new QgsUserProfileManager( QString(), this );
mUserProfileManager->setRootLocation( rootProfileLocation );
@@ -863,7 +865,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
//////////

startProfile( tr( "Checking user database" ) );
mSplash->showMessage( tr( "Checking database" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Checking database" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
qApp->processEvents();
// Do this early on before anyone else opens it and prevents us copying it
QString dbError;
@@ -878,10 +880,10 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
QgsApplication::createThemeFolder();
endProfile();

mSplash->showMessage( tr( "Reading settings" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Reading settings" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
qApp->processEvents();

mSplash->showMessage( tr( "Setting up the GUI" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Setting up the GUI" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
qApp->processEvents();

QgsApplication::initQgis();
@@ -1349,7 +1351,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
qApp->processEvents();

// load providers
mSplash->showMessage( tr( "Checking provider plugins" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Checking provider plugins" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
qApp->processEvents();

// Setup QgsNetworkAccessManager (this needs to happen after authentication, for proxy settings)
@@ -1376,7 +1378,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
mAppBadLayersHandler = new QgsHandleBadLayersHandler();
QgsProject::instance()->setBadLayerHandler( mAppBadLayersHandler );

mSplash->showMessage( tr( "Starting Python" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Starting Python" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
qApp->processEvents();
loadPythonSupport();

@@ -1393,7 +1395,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh

// Create the plugin registry and load plugins
// load any plugins that were running in the last session
mSplash->showMessage( tr( "Restoring loaded plugins" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Restoring loaded plugins" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
qApp->processEvents();
QgsPluginRegistry::instance()->setQgisInterface( mQgisInterface );

@@ -1463,7 +1465,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
QgsApplication::validityCheckRegistry()->addCheck( new QgsLayoutOverviewValidityCheck() );
QgsApplication::validityCheckRegistry()->addCheck( new QgsLayoutPictureSourceValidityCheck() );

mSplash->showMessage( tr( "Initializing file filters" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Initializing file filters" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
qApp->processEvents();

// now build vector and raster file filters
@@ -1488,7 +1490,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
// Please make sure this is the last thing the ctor does so that we can ensure the
// widgets are all initialized before trying to restore their state.
//
mSplash->showMessage( tr( "Restoring window state" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Restoring window state" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
qApp->processEvents();
startProfile( tr( "Restore window state" ) );
restoreWindowState();
@@ -1499,12 +1501,12 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
QgsCustomization::instance()->updateMainWindow( mToolbarMenu );
endProfile();

mSplash->showMessage( tr( "Populate saved styles" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "Populate saved styles" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );
startProfile( tr( "Populate saved styles" ) );
QgsStyle::defaultStyle();
endProfile();

mSplash->showMessage( tr( "QGIS Ready!" ), Qt::AlignHCenter | Qt::AlignBottom );
mSplash->showMessage( tr( "QGIS Ready!" ), Qt::AlignHCenter | Qt::AlignBottom, splashTextColor );

QgsMessageLog::logMessage( QgsApplication::showSettings(), QString(), Qgis::MessageLevel::Info );

0 comments on commit e8efe81

Please sign in to comment.