Skip to content

Commit 5f4c0ce

Browse files
author
rugginoso
committedJul 2, 2009
Updated the about dialog to take care of DONORS file.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11009 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 8832994 commit 5f4c0ce

File tree

7 files changed

+213
-115
lines changed

7 files changed

+213
-115
lines changed
 

‎AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Peter Ersts <ersts at amnh.org>
3737
Borys Jurgiel <borysiasty at aster.pl>
3838
Paolo Cavallini <cavallini at faunalia.it>
3939
Carson J. Q. Farmer <carson dot farmer at gmail dot com>
40+
Lorenzo Masini <lorenxo86@gmail.com>

‎CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ ENDIF (ENABLE_TESTS)
384384
#############################################################
385385
# install stuff
386386

387-
INSTALL (FILES AUTHORS SPONSORS TRANSLATORS INSTALL CODING
387+
INSTALL (FILES AUTHORS SPONSORS DONORS TRANSLATORS INSTALL CODING
388388
DESTINATION ${QGIS_DATA_DIR}/doc)
389389

390390
# manual page - makes sense only on unix systems

‎DONORS

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,51 @@
1212
#
1313
# ALWAYS USE UTF-8 WHEN WRITING THIS FILE!
1414
#
15-
Aaron Racicot, Ecotrust|www.ecotrust.org
15+
Aaron Racicot, Ecotrust|http://www.ecotrust.org/
1616
Adam Lane
17-
Albin Blaschka|www.albinblaschka.info
18-
Alessandro Pasotti|www.itopen.it
17+
Albin Blaschka|http://www.albinblaschka.info/
18+
Alessandro Pasotti|http://www.itopen.it/
1919
Alessandro Sarretta
2020
Alexandre Leroux
2121
Carl Nelson
22-
D R Arbib|Unknown
23-
David Enns|www.mapitout.com
24-
Ecotrust|www.ecotrust.org
22+
D R Arbib
23+
David Enns|http://www.mapitout.com/
24+
Ecotrust|http://www.ecotrust.org/
2525
Ferdinando Urbano
2626
Flavio Rigolon
2727
Fred Watchorn
28-
Glasic S.r.l.|www.glasic.it
29-
Ivan Marchesini|www.gfosservices.it
28+
Glasic S.r.l.|http://www.glasic.it/
29+
Ivan Marchesini|http://www.gfosservices.it/
3030
James Crone
3131
Jaroslaw Kowalczyk
3232
Jason Jorgenson
3333
John C. Tull
34-
Kanton Solothurn|SOGIS
34+
Kanton Solothurn SOGIS
3535
Kevin Shook
3636
Laura Burnette
37-
Lorenzo Becchi|ominiverdi.org
37+
Lorenzo Becchi|http://ominiverdi.org/
3838
Luca Casagrande
3939
Maciej Sieczka
4040
Maria Antonia Brovelli
4141
Marc Monnerat
42-
Massimo Cuomo|www.acsys.it
43-
Mateusz Loskot|mateusz.loskot.net
42+
Massimo Cuomo|http://www.acsys.it/
43+
Mateusz Loskot|http://mateusz.loskot.net/
4444
Matt Wilkie
45-
Niccolo Rigacci|www.rigacci.org
45+
Niccolo Rigacci|http://www.rigacci.org/
46+
Nikolaos Alexandris
4647
Otto Dassau
47-
Paolo Cavallini|www.faunalia.it
48-
Paolo Cavallini|www.gfoss.it
48+
Paolo Cavallini|http://www.faunalia.it/
49+
Paolo Cavallini|http://www.gfoss.it/
4950
Patti Giuseppe
50-
Planetek Italia s.r.l|www.planetek.it
51-
Ragnvald Larsen|www.mindland.com
51+
Planetek Italia s.r.l|http://www.planetek.it/
52+
Ragnvald Larsen|http://www.mindland.com/
5253
Raymond Warriner
5354
Silvio Grosso
54-
Stefano Menegon|www.mpasol.it
55+
Stefano Menegon|http://www.mpasol.it/
5556
Stephan Holl
5657
Sti Sas Di Meo
5758
Thierry Gonon
5859
Tim Baggett
5960
Tishampati Dhar
60-
Tyler Mitchell|spatialguru.com
61+
Tyler Mitchell|http://spatialguru.com/
6162
Yves Jacolin

‎src/app/qgsabout.cpp

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void QgsAbout::init()
133133
QStringList myTokens = sline.split( "|", QString::SkipEmptyParts );
134134
if ( myTokens.size() > 1 )
135135
{
136-
website = myTokens[1];
136+
website = "<a href=\"" + myTokens[1].remove(' ') + "\">" + myTokens[1] + "</a>";
137137
}
138138
else
139139
{
@@ -153,7 +153,55 @@ void QgsAbout::init()
153153
QgsDebugMsg( QString( "sponsorHTML:%1" ).arg( sponsorHTML.toAscii().constData() ) );
154154
QgsDebugMsg( QString( "txtSponsors:%1" ).arg( txtSponsors->toHtml().toAscii().constData() ) );
155155
}
156+
157+
// read the DONORS file and populate the text widget
158+
QFile donorsFile( QgsApplication::donorsFilePath() );
159+
#ifdef QGISDEBUG
160+
printf( "Reading donors file %s.............................................\n",
161+
donorsFile.fileName().toLocal8Bit().constData() );
162+
#endif
163+
if ( donorsFile.open( QIODevice::ReadOnly ) )
164+
{
165+
QString donorsHTML = ""
166+
+ tr( "<p>The following have sponsored QGIS by contributing "
167+
"money to fund development and other project costs</p>" )
168+
+ "<hr>"
169+
"<table width='100%'>"
170+
"<tr><th>" + tr( "Name" ) + "</th>"
171+
"<th>" + tr( "Website" ) + "</th></tr>";
172+
QString website;
173+
QTextStream donorsStream( &donorsFile );
174+
// Always use UTF-8
175+
donorsStream.setCodec( "UTF-8" );
176+
QString sline;
177+
while ( !donorsStream.atEnd() )
178+
{
179+
sline = donorsStream.readLine(); // line of text excluding '\n'
180+
//ignore the line if it starts with a hash....
181+
if ( sline.left( 1 ) == "#" ) continue;
182+
QStringList myTokens = sline.split( "|", QString::SkipEmptyParts );
183+
if ( myTokens.size() > 1 )
184+
{
185+
website = "<a href=\"" + myTokens[1].remove(' ') + "\">" + myTokens[1] + "</a>";
186+
}
187+
else
188+
{
189+
website = "&nbsp;";
190+
}
191+
donorsHTML += "<tr>";
192+
donorsHTML += "<td>" + myTokens[0] + "</td><td>" + website + "</td>";
193+
// close the row
194+
donorsHTML += "</tr>";
195+
}
196+
donorsHTML += "</table>";
156197

198+
QString myStyle = QgsApplication::reportStyleSheet();
199+
txtDonors->clear();
200+
txtDonors->document()->setDefaultStyleSheet( myStyle );
201+
txtDonors->setHtml( donorsHTML );
202+
QgsDebugMsg( QString( "donorsHTML:%1" ).arg( donorsHTML.toAscii().constData() ) );
203+
QgsDebugMsg( QString( "txtDonors:%1" ).arg( txtDonors->toHtml().toAscii().constData() ) );
204+
}
157205

158206
// read the TRANSLATORS file and populate the text widget
159207
QFile translatorFile( QgsApplication::translatorsFilePath() );

‎src/core/qgsapplication.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ const QString QgsApplication::sponsorsFilePath()
168168
{
169169
return mPkgDataPath + QString( "/doc/SPONSORS" );
170170
}
171+
172+
/*!
173+
Returns the path to the donors file.
174+
*/
175+
const QString QgsApplication::donorsFilePath()
176+
{
177+
return mPkgDataPath + QString( "/doc/DONORS" );
178+
}
179+
171180
/*!
172181
Returns the path to the sponsors file.
173182
@note Added in QGIS 1.1

‎src/core/qgsapplication.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class CORE_EXPORT QgsApplication: public QApplication
5757
//! Returns the path to the sponsors file.
5858
static const QString sponsorsFilePath();
5959

60+
//! Returns the path to the donors file.
61+
static const QString donorsFilePath();
62+
6063
/**
6164
* Returns the path to the sponsors file.
6265
* @note This was added in QGIS 1.1

0 commit comments

Comments
 (0)
Please sign in to comment.