Skip to content
Permalink
Browse files

Added contributors list to qgsabout as requested by Germán Carrillo -…

… 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@11628 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Sep 11, 2009
1 parent 7a87b13 commit cbca8093ba10c7ce525106fb3a7c9efc6b5dc848
Showing with 225 additions and 220 deletions.
  1. +1 −1 CMakeLists.txt
  2. +6 −6 CONTRIBUTORS
  3. +42 −53 src/app/qgsabout.cpp
  4. +0 −1 src/app/qgsabout.h
  5. +7 −0 src/core/qgsapplication.cpp
  6. +6 −0 src/core/qgsapplication.h
  7. +163 −159 src/ui/qgsabout.ui
@@ -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
@@ -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
@@ -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
@@ -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 );
}
}


@@ -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
@@ -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();
};
@@ -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.
*/
@@ -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();

0 comments on commit cbca809

Please sign in to comment.
You can’t perform that action at this time.