Skip to content

Commit

Permalink
Added contributors list to qgsabout as requested by Germán Carrillo -…
Browse files Browse the repository at this point in the history
… and implemented attendant changes needed to support this. Also cleanups for the QgsAbout dialog to remove deprecated / unused code.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11628 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Sep 11, 2009
1 parent 1f94564 commit c147724
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 220 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ ENDIF (ENABLE_TESTS)
#############################################################
# install stuff

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

# manual page - makes sense only on unix systems
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
The following people have submitted code, patches, graphics, comments,
feedback, reviews and/or many other things that have aided the development of
QGIS:

# This file will be used to populate the contributors tab in the about dialog
# Lines prefixed with # will be ignored
# The following people have submitted code, patches, graphics, comments,
# feedback, reviews and/or many other things that have aided the development of
# QGIS:
#
Arthur Nanni
Baba Yoshihiko
Brent Wood
Expand All @@ -17,12 +19,10 @@ Hyao (IRC nickname)
Ivan Lucena
Jean-Denis Giguere
Jerrit Collord
Jürgen E. Fischer
Magnus Homann
Markus Neteler
Maurizio Napolitano
Paul Ramsey
Peter Ersts
Richard Kostecky
Stefanie Tellex
Tom Russo
Expand Down
95 changes: 42 additions & 53 deletions src/app/qgsabout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,53 +55,64 @@ void QgsAbout::init()
QPixmap icon( QgsApplication::iconsPath() + "qgis-icon-60x60.png" );
qgisIcon->setPixmap( icon );

//read the authors file to populate the contributors list
//read the authors file to populate the svn committers list
QStringList lines;

//
// Load the authors (svn committers) list
//
QFile file( QgsApplication::authorsFilePath() );
#ifdef QGISDEBUG
printf( "Reading authors file %s.............................................\n",
file.fileName().toLocal8Bit().constData() );
#endif
if ( file.open( QIODevice::ReadOnly ) )
{
QTextStream stream( &file );
// Always use UTF-8
stream.setCodec( "UTF-8" );
QString line;
#ifdef QGISDEBUG
int i = 1;
#endif

while ( !stream.atEnd() )
{
line = stream.readLine(); // line of text excluding '\n'
//ignore the line if it starts with a hash....
if ( line.left( 1 ) == "#" ) continue;
#ifdef QGISDEBUG
printf( "Contributor: %3d: %s\n", i++, line.toLocal8Bit().constData() );
#endif
QStringList myTokens = line.split( "\t", QString::SkipEmptyParts );
//printf ("Added contributor name to listbox: %s ",myTokens[0]);
lines += myTokens[0];

// add the image to the map
/* Uncomment this block to preload the images (takes time at initial startup)
QString authorName = myTokens[0].replace(" ","_");
QString myString =QString(appPath + "/images/developers/") + authorName + QString(".jpg");
printf ("Loading mug: %s\n", myString.toLocal8Bit().constData());
QPixmap *pixmap = new QPixmap(myString);
mugs[myTokens[0]] = *pixmap;
*/
}
file.close();
listBox1->clear();
listBox1->insertItems( 0, lines );
lstDevelopers->clear();
lstDevelopers->insertItems( 0, lines );

// Load in the image for the first author
if ( listBox1->count() > 0 )
listBox1->setCurrentRow( 0 );
if ( lstDevelopers->count() > 0 )
{
lstDevelopers->setCurrentRow( 0 );
}
}

lines.clear();
//
// Now load up the contributors list
//
QFile file2( QgsApplication::contributorsFilePath() );
printf( "Reading contributors file %s.............................................\n",
file2.fileName().toLocal8Bit().constData() );
if ( file2.open( QIODevice::ReadOnly ) )
{
QTextStream stream( &file2 );
// Always use UTF-8
stream.setCodec( "UTF-8" );
QString line;
while ( !stream.atEnd() )
{
line = stream.readLine(); // line of text excluding '\n'
//ignore the line if it starts with a hash....
if ( line.left( 1 ) == "#" ) continue;
lines += line;
}
file2.close();
lstContributors->clear();
lstContributors->insertItems( 0, lines );
if ( lstContributors->count() > 0 )
{
lstContributors->setCurrentRow( 0 );
}
}


Expand Down Expand Up @@ -294,38 +305,16 @@ void QgsAbout::setPluginInfo()
myString += "</li>\n</ol>\n";

QString myStyle = QgsApplication::reportStyleSheet();
txtBrowserPlugins->clear();
txtBrowserPlugins->document()->setDefaultStyleSheet( myStyle );
txtBrowserPlugins->setText( myString );
txtProviders->clear();
txtProviders->document()->setDefaultStyleSheet( myStyle );
txtProviders->setText( myString );
}

void QgsAbout::on_buttonCancel_clicked()
{
reject();
}

void QgsAbout::on_listBox1_currentItemChanged( QListWidgetItem *theItem )
{
//replace spaces in author name
#ifdef QGISDEBUG
printf( "Loading mug: " );
#endif
QString myString = listBox1->currentItem()->text();
myString = myString.replace( " ", "_" );
myString = QgsAbout::fileSystemSafe( myString );
#ifdef QGISDEBUG
printf( "Loading mug: %s", myString.toLocal8Bit().constData() );
#endif
myString = QgsApplication::developerPath() + myString + QString( ".jpg" );
#ifdef QGISDEBUG
printf( "Loading mug: %s\n", myString.toLocal8Bit().constData() );
#endif

/* Uncomment this block to use preloaded images
pixAuthorMug->setPixmap(mugs[myString]);
*/
}

void QgsAbout::on_btnQgisUser_clicked()
{
// find a browser
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsabout.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class QgsAbout : public QDialog, private Ui::QgsAbout

private slots:
void on_buttonCancel_clicked();
void on_listBox1_currentItemChanged( QListWidgetItem *theItem );
void on_btnQgisUser_clicked();
void on_btnQgisHome_clicked();
};
Expand Down
7 changes: 7 additions & 0 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ const QString QgsApplication::authorsFilePath()
{
return mPkgDataPath + QString( "/doc/AUTHORS" );
}
/*!
Returns the path to the contributors file.
*/
const QString QgsApplication::contributorsFilePath()
{
return mPkgDataPath + QString( "/doc/CONTRIBUTORS" );
}
/*!
Returns the path to the sponsors file.
*/
Expand Down
6 changes: 6 additions & 0 deletions src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class CORE_EXPORT QgsApplication: public QApplication
//! Returns the path to the authors file.
static const QString authorsFilePath();

/** Returns the path to the contributors file.
* Contributors are people who have submitted patches
* but dont have svn write access.
* @note this function was added in version 1.3 */
static const QString contributorsFilePath();

/**Returns the path to the sponsors file.
@note this function was added in version 1.2*/
static const QString sponsorsFilePath();
Expand Down
Loading

0 comments on commit c147724

Please sign in to comment.