Skip to content

Commit

Permalink
Updated the about dialog to take care of DONORS file.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11009 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rugginoso committed Jul 2, 2009
1 parent ed439f5 commit cfd6c68
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 115 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ Peter Ersts <ersts at amnh.org>
Borys Jurgiel <borysiasty at aster.pl>
Paolo Cavallini <cavallini at faunalia.it>
Carson J. Q. Farmer <carson dot farmer at gmail dot com>
Lorenzo Masini <lorenxo86@gmail.com>
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ ENDIF (ENABLE_TESTS)
#############################################################
# install stuff

INSTALL (FILES AUTHORS SPONSORS TRANSLATORS INSTALL CODING
INSTALL (FILES AUTHORS SPONSORS DONORS TRANSLATORS INSTALL CODING
DESTINATION ${QGIS_DATA_DIR}/doc)

# manual page - makes sense only on unix systems
Expand Down
39 changes: 20 additions & 19 deletions DONORS
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,51 @@
#
# ALWAYS USE UTF-8 WHEN WRITING THIS FILE!
#
Aaron Racicot, Ecotrust|www.ecotrust.org
Aaron Racicot, Ecotrust|http://www.ecotrust.org/
Adam Lane
Albin Blaschka|www.albinblaschka.info
Alessandro Pasotti|www.itopen.it
Albin Blaschka|http://www.albinblaschka.info/
Alessandro Pasotti|http://www.itopen.it/
Alessandro Sarretta
Alexandre Leroux
Carl Nelson
D R Arbib|Unknown
David Enns|www.mapitout.com
Ecotrust|www.ecotrust.org
D R Arbib
David Enns|http://www.mapitout.com/
Ecotrust|http://www.ecotrust.org/
Ferdinando Urbano
Flavio Rigolon
Fred Watchorn
Glasic S.r.l.|www.glasic.it
Ivan Marchesini|www.gfosservices.it
Glasic S.r.l.|http://www.glasic.it/
Ivan Marchesini|http://www.gfosservices.it/
James Crone
Jaroslaw Kowalczyk
Jason Jorgenson
John C. Tull
Kanton Solothurn|SOGIS
Kanton Solothurn SOGIS
Kevin Shook
Laura Burnette
Lorenzo Becchi|ominiverdi.org
Lorenzo Becchi|http://ominiverdi.org/
Luca Casagrande
Maciej Sieczka
Maria Antonia Brovelli
Marc Monnerat
Massimo Cuomo|www.acsys.it
Mateusz Loskot|mateusz.loskot.net
Massimo Cuomo|http://www.acsys.it/
Mateusz Loskot|http://mateusz.loskot.net/
Matt Wilkie
Niccolo Rigacci|www.rigacci.org
Niccolo Rigacci|http://www.rigacci.org/
Nikolaos Alexandris
Otto Dassau
Paolo Cavallini|www.faunalia.it
Paolo Cavallini|www.gfoss.it
Paolo Cavallini|http://www.faunalia.it/
Paolo Cavallini|http://www.gfoss.it/
Patti Giuseppe
Planetek Italia s.r.l|www.planetek.it
Ragnvald Larsen|www.mindland.com
Planetek Italia s.r.l|http://www.planetek.it/
Ragnvald Larsen|http://www.mindland.com/
Raymond Warriner
Silvio Grosso
Stefano Menegon|www.mpasol.it
Stefano Menegon|http://www.mpasol.it/
Stephan Holl
Sti Sas Di Meo
Thierry Gonon
Tim Baggett
Tishampati Dhar
Tyler Mitchell|spatialguru.com
Tyler Mitchell|http://spatialguru.com/
Yves Jacolin
50 changes: 49 additions & 1 deletion src/app/qgsabout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void QgsAbout::init()
QStringList myTokens = sline.split( "|", QString::SkipEmptyParts );
if ( myTokens.size() > 1 )
{
website = myTokens[1];
website = "<a href=\"" + myTokens[1].remove(' ') + "\">" + myTokens[1] + "</a>";
}
else
{
Expand All @@ -153,7 +153,55 @@ void QgsAbout::init()
QgsDebugMsg( QString( "sponsorHTML:%1" ).arg( sponsorHTML.toAscii().constData() ) );
QgsDebugMsg( QString( "txtSponsors:%1" ).arg( txtSponsors->toHtml().toAscii().constData() ) );
}

// read the DONORS file and populate the text widget
QFile donorsFile( QgsApplication::donorsFilePath() );
#ifdef QGISDEBUG
printf( "Reading donors file %s.............................................\n",
donorsFile.fileName().toLocal8Bit().constData() );
#endif
if ( donorsFile.open( QIODevice::ReadOnly ) )
{
QString donorsHTML = ""
+ tr( "<p>The following have sponsored QGIS by contributing "
"money to fund development and other project costs</p>" )
+ "<hr>"
"<table width='100%'>"
"<tr><th>" + tr( "Name" ) + "</th>"
"<th>" + tr( "Website" ) + "</th></tr>";
QString website;
QTextStream donorsStream( &donorsFile );
// Always use UTF-8
donorsStream.setCodec( "UTF-8" );
QString sline;
while ( !donorsStream.atEnd() )
{
sline = donorsStream.readLine(); // line of text excluding '\n'
//ignore the line if it starts with a hash....
if ( sline.left( 1 ) == "#" ) continue;
QStringList myTokens = sline.split( "|", QString::SkipEmptyParts );
if ( myTokens.size() > 1 )
{
website = "<a href=\"" + myTokens[1].remove(' ') + "\">" + myTokens[1] + "</a>";
}
else
{
website = "&nbsp;";
}
donorsHTML += "<tr>";
donorsHTML += "<td>" + myTokens[0] + "</td><td>" + website + "</td>";
// close the row
donorsHTML += "</tr>";
}
donorsHTML += "</table>";

QString myStyle = QgsApplication::reportStyleSheet();
txtDonors->clear();
txtDonors->document()->setDefaultStyleSheet( myStyle );
txtDonors->setHtml( donorsHTML );
QgsDebugMsg( QString( "donorsHTML:%1" ).arg( donorsHTML.toAscii().constData() ) );
QgsDebugMsg( QString( "txtDonors:%1" ).arg( txtDonors->toHtml().toAscii().constData() ) );
}

// read the TRANSLATORS file and populate the text widget
QFile translatorFile( QgsApplication::translatorsFilePath() );
Expand Down
9 changes: 9 additions & 0 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ const QString QgsApplication::sponsorsFilePath()
{
return mPkgDataPath + QString( "/doc/SPONSORS" );
}

/*!
Returns the path to the donors file.
*/
const QString QgsApplication::donorsFilePath()
{
return mPkgDataPath + QString( "/doc/DONORS" );
}

/*!
Returns the path to the sponsors file.
@note Added in QGIS 1.1
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class CORE_EXPORT QgsApplication: public QApplication
//! Returns the path to the sponsors file.
static const QString sponsorsFilePath();

//! Returns the path to the donors file.
static const QString donorsFilePath();

/**
* Returns the path to the sponsors file.
* @note This was added in QGIS 1.1
Expand Down
Loading

0 comments on commit cfd6c68

Please sign in to comment.