File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -432,11 +432,23 @@ QStringList QgsCptCityColorRampV2::listSchemeNames( QString collectionName )
432432
433433QString QgsCptCityColorRampV2::getBaseDir ()
434434{
435- // currently hard-coded, but could be also in QGis install path and/or configurable
436- if ( mBaseDir .isNull () )
437- return QgsApplication::qgisSettingsDirPath () + " /" + " cpt-city" ;
438- else
439- return mBaseDir ;
435+ // if was set with setBaseDir, return that value
436+ QString baseDir = mBaseDir ;
437+
438+ // use CptCity/baseDir setting if set
439+ if ( baseDir.isNull () )
440+ {
441+ QSettings settings;
442+ baseDir = settings.value ( " CptCity/baseDir" , QString () ).toString ();
443+ if ( ! baseDir.isNull () )
444+ baseDir += " /cpt-city" ;
445+ }
446+
447+ // fallback to user setting dir
448+ if ( baseDir.isNull () )
449+ baseDir = QgsApplication::qgisSettingsDirPath () + " /" + " cpt-city" ;
450+
451+ return baseDir;
440452}
441453
442454QString QgsCptCityColorRampV2::getFilename () const
Original file line number Diff line number Diff line change @@ -48,7 +48,11 @@ QgsCptCityColorRampV2Dialog::QgsCptCityColorRampV2Dialog( QgsCptCityColorRampV2*
4848 edit->setReadOnly ( true );
4949 // not sure if we want this long string to be translated
5050 QString helpText = tr ( " Error - cpt-city gradient files not found.\n\n "
51- " Please download the complete collection (in svg format) "
51+ " You have two means of installing them:\n\n "
52+ " 1) Install the \" Color Ramp Manager\" python plugin "
53+ " (you must enable Experimental plugins in the plugin manager) "
54+ " and use it to download latest cpt-city package.\n\n "
55+ " 2) Download the complete collection (in svg format) "
5256 " and unzip it to your QGis settings directory [%1] .\n\n "
5357 " This file can be found at [%2]\n and current file is [%3]"
5458 ).arg ( QgsApplication::qgisSettingsDirPath ()
You can’t perform that action at this time.
0 commit comments