@@ -62,6 +62,22 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
6262 QgsDebugMsg ( QString ( " Standard Identify radius setting read from settings file: %1" ).arg ( identifyValue ) );
6363 spinBoxIdentifyValue->setValue ( identifyValue );
6464
65+
66+ // local directories to search when looking for an SVG with a given basename
67+ QString myPaths = settings.value ( " svg/searchPathsForSVG" , " " ).toString ();
68+ if ( !myPaths.isEmpty () )
69+ {
70+ QStringList myPathList = myPaths.split ( " |" );
71+ QStringList::const_iterator pathIt = myPathList.constBegin ();
72+ for ( ; pathIt != myPathList.constEnd (); ++pathIt )
73+ {
74+ QListWidgetItem* newItem = new QListWidgetItem ( mListSVGPaths );
75+ newItem->setText ( *pathIt );
76+ newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
77+ mListSVGPaths ->addItem ( newItem );
78+ }
79+ }
80+
6581 // Web proxy settings
6682 grpProxy->setChecked ( settings.value ( " proxy/proxyEnabled" , " 0" ).toBool () );
6783 leProxyHost->setText ( settings.value ( " proxy/proxyHost" , " " ).toString () );
@@ -336,6 +352,19 @@ QString QgsOptions::theme()
336352void QgsOptions::saveOptions ()
337353{
338354 QSettings settings;
355+
356+ // search directories for svgs
357+ QString myPaths;
358+ for ( int i = 0 ; i < mListSVGPaths ->count (); ++i )
359+ {
360+ if ( i != 0 )
361+ {
362+ myPaths += " |" ;
363+ }
364+ myPaths += mListSVGPaths ->item ( i )->text ();
365+ }
366+ settings.setValue ( " svg/searchPathsForSVG" , myPaths );
367+
339368 // Web proxy settings
340369 settings.setValue ( " proxy/proxyEnabled" , grpProxy->isChecked () );
341370 settings.setValue ( " proxy/proxyHost" , leProxyHost->text () );
@@ -344,6 +373,7 @@ void QgsOptions::saveOptions()
344373 settings.setValue ( " proxy/proxyPassword" , leProxyPassword->text () );
345374 settings.setValue ( " proxy/proxyType" , mProxyTypeComboBox ->currentText () );
346375
376+
347377 // url to exclude from proxys
348378 QString proxyExcludeString;
349379 for ( int i = 0 ; i < mExcludeUrlListWidget ->count (); ++i )
@@ -677,6 +707,31 @@ QStringList QgsOptions::i18nList()
677707 return myList;
678708}
679709
710+ void QgsOptions::on_mBtnAddSVGPath_clicked ()
711+ {
712+ QString myDir = QFileDialog::getExistingDirectory (
713+ this ,
714+ tr ( " Choose a directory" ),
715+ QDir::toNativeSeparators ( QDir::homePath () ),
716+ QFileDialog::ShowDirsOnly
717+ );
718+ if ( ! myDir.isEmpty () )
719+ {
720+ QListWidgetItem* newItem = new QListWidgetItem ( mListSVGPaths );
721+ newItem->setText ( myDir );
722+ newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
723+ mListSVGPaths ->addItem ( newItem );
724+ mListSVGPaths ->setCurrentItem ( newItem );
725+ }
726+ }
727+
728+ void QgsOptions::on_mBtnRemoveSVGPath_clicked ()
729+ {
730+ int currentRow = mListSVGPaths ->currentRow ();
731+ QListWidgetItem* itemToRemove = mListSVGPaths ->takeItem ( currentRow );
732+ delete itemToRemove;
733+ }
734+
680735void QgsOptions::on_mAddUrlPushButton_clicked ()
681736{
682737 QListWidgetItem* newItem = new QListWidgetItem ( mExcludeUrlListWidget );
0 commit comments