From cfd6c68cc5ee419929a97c32a3f7b5a75f49d5d5 Mon Sep 17 00:00:00 2001 From: rugginoso Date: Thu, 2 Jul 2009 16:54:18 +0000 Subject: [PATCH] Updated the about dialog to take care of DONORS file. git-svn-id: http://svn.osgeo.org/qgis/trunk@11009 c8812cc2-4d05-0410-92ff-de0c093fc19c --- AUTHORS | 1 + CMakeLists.txt | 2 +- DONORS | 39 ++++--- src/app/qgsabout.cpp | 50 +++++++- src/core/qgsapplication.cpp | 9 ++ src/core/qgsapplication.h | 3 + src/ui/qgsabout.ui | 224 +++++++++++++++++++++--------------- 7 files changed, 213 insertions(+), 115 deletions(-) diff --git a/AUTHORS b/AUTHORS index b6a1ff8db66..5723a4d636d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -37,3 +37,4 @@ Peter Ersts Borys Jurgiel Paolo Cavallini Carson J. Q. Farmer +Lorenzo Masini diff --git a/CMakeLists.txt b/CMakeLists.txt index dff39765daf..59ce88b528f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/DONORS b/DONORS index 1e40cca1e8c..4f2bb63fb8c 100644 --- a/DONORS +++ b/DONORS @@ -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 diff --git a/src/app/qgsabout.cpp b/src/app/qgsabout.cpp index 95cb1c2d321..c173a2a0eb6 100644 --- a/src/app/qgsabout.cpp +++ b/src/app/qgsabout.cpp @@ -133,7 +133,7 @@ void QgsAbout::init() QStringList myTokens = sline.split( "|", QString::SkipEmptyParts ); if ( myTokens.size() > 1 ) { - website = myTokens[1]; + website = "" + myTokens[1] + ""; } else { @@ -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( "

The following have sponsored QGIS by contributing " + "money to fund development and other project costs

" ) + + "
" + "" + "" + ""; + 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 = "" + myTokens[1] + ""; + } + else + { + website = " "; + } + donorsHTML += ""; + donorsHTML += ""; + // close the row + donorsHTML += ""; + } + donorsHTML += "
" + tr( "Name" ) + "" + tr( "Website" ) + "
" + myTokens[0] + "" + website + "
"; + 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() ); diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 63529dfbc05..30f4ac8bf6c 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -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 diff --git a/src/core/qgsapplication.h b/src/core/qgsapplication.h index fd5694bbe56..f3391b2ea32 100644 --- a/src/core/qgsapplication.h +++ b/src/core/qgsapplication.h @@ -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 diff --git a/src/ui/qgsabout.ui b/src/ui/qgsabout.ui index e9494b53bd0..fe7dfa972a0 100644 --- a/src/ui/qgsabout.ui +++ b/src/ui/qgsabout.ui @@ -1,7 +1,8 @@ - + + QgsAbout - - + + 0 0 @@ -9,75 +10,75 @@ 375 - + About Quantum GIS - + true - - - - + + + + 0 - - + + About - - - + + + - - + + 60 60 - - :/images/icons/qgis-icon-60x60.png + + :/images/icons/qgis-icon-60x60.png - + false - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:x-large; font-weight:600;"><span style=" font-size:x-large;">Quantum GIS (QGIS)</span></p></body></html> +</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:x-large; font-weight:600;"><span style=" font-size:x-large;">Quantum GIS (QGIS)</span></p></body></html> - + Qt::AlignCenter - - - + + + Version - + Qt::AlignCenter - + true - + - + Qt::Vertical - + 20 21 @@ -85,35 +86,35 @@ p, li { white-space: pre-wrap; } - - - + + + Quantum GIS is licensed under the GNU General Public License - + Qt::AlignCenter - + true - - - + + + http://www.gnu.org/licenses - + Qt::AlignCenter - + - + Qt::Vertical - + 20 40 @@ -121,24 +122,24 @@ p, li { white-space: pre-wrap; } - - + + - - + + QGIS Home Page - + false - - + + Join our user mailing list - + false @@ -147,86 +148,121 @@ p, li { white-space: pre-wrap; } - - + + What's New - - - - + + + + Qt::NoFocus - + false - + 2 - + true - - + + Developers - - - - + + + + true - - + + Providers - - - + + + - - + + Sponsors - - - + + + + + Sponsors + + + + + + true + + + true + + + + + + + + + + Donors + + + + + + true + + + true + + + + + - - + + Translators - - - + + + - - + + - + Qt::Horizontal - + QSizePolicy::Expanding - + 20 0 @@ -235,14 +271,14 @@ p, li { white-space: pre-wrap; } - - + + Ok - + - + true @@ -251,7 +287,7 @@ p, li { white-space: pre-wrap; } - + tabWidget btnQgisUser @@ -261,7 +297,7 @@ p, li { white-space: pre-wrap; } listBox1 - +