Skip to content
Permalink
Browse files
integrate with Color Ramp Manager plugin to download cpt-city files
  • Loading branch information
etiennesky committed Aug 6, 2012
1 parent fbbb71a commit a58f737b75b9c3bcfbaf21914aa83506fb526a76
Showing with 22 additions and 6 deletions.
  1. +17 −5 src/core/symbology-ng/qgsvectorcolorrampv2.cpp
  2. +5 −1 src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp
@@ -432,11 +432,23 @@ QStringList QgsCptCityColorRampV2::listSchemeNames( QString collectionName )

QString QgsCptCityColorRampV2::getBaseDir()
{
// currently hard-coded, but could be also in QGis install path and/or configurable
if ( mBaseDir.isNull() )
return QgsApplication::qgisSettingsDirPath() + "/" + "cpt-city";
else
return mBaseDir;
// if was set with setBaseDir, return that value
QString baseDir = mBaseDir;

// use CptCity/baseDir setting if set
if ( baseDir.isNull() )
{
QSettings settings;
baseDir = settings.value( "CptCity/baseDir", QString() ).toString();
if ( ! baseDir.isNull() )
baseDir += "/cpt-city";
}

// fallback to user setting dir
if ( baseDir.isNull() )
baseDir = QgsApplication::qgisSettingsDirPath() + "/" + "cpt-city";

return baseDir;
}

QString QgsCptCityColorRampV2::getFilename() const
@@ -48,7 +48,11 @@ QgsCptCityColorRampV2Dialog::QgsCptCityColorRampV2Dialog( QgsCptCityColorRampV2*
edit->setReadOnly( true );
// not sure if we want this long string to be translated
QString helpText = tr( "Error - cpt-city gradient files not found.\n\n"
"Please download the complete collection (in svg format) "
"You have two means of installing them:\n\n"
"1) Install the \"Color Ramp Manager\" python plugin "
"(you must enable Experimental plugins in the plugin manager) "
"and use it to download latest cpt-city package.\n\n"
"2) Download the complete collection (in svg format) "
"and unzip it to your QGis settings directory [%1] .\n\n"
"This file can be found at [%2]\nand current file is [%3]"
).arg( QgsApplication::qgisSettingsDirPath()

0 comments on commit a58f737

Please sign in to comment.