Skip to content
Permalink
Browse files

Remember last style import path

  • Loading branch information
nyalldawson committed Aug 31, 2018
1 parent fc8d90f commit 1f744bdc0ebea2819360e76420eb06eb81f62ba9
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/gui/symbology/qgsstyleexportimportdialog.cpp
@@ -24,6 +24,7 @@
#include "qgslogger.h"
#include "qgsstylegroupselectiondialog.h"
#include "qgsguiutils.h"
#include "qgssettings.h"
#include "qgsgui.h"

#include <QInputDialog>
@@ -84,6 +85,9 @@ QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle *style, QWidget
mImportFileWidget->setStorageMode( QgsFileWidget::GetFile );
mImportFileWidget->setDialogTitle( tr( "Load Styles" ) );
mImportFileWidget->setFilter( tr( "XML files (*.xml *.XML)" ) );

QgsSettings settings;
mImportFileWidget->setDefaultRoot( settings.value( QStringLiteral( "StyleManager/lastImportDir" ), QDir::homePath(), QgsSettings::Gui ).toString() );
connect( mImportFileWidget, &QgsFileWidget::fileChanged, this, &QgsStyleExportImportDialog::importFileChanged );

label->setText( tr( "Select items to import" ) );
@@ -525,7 +529,11 @@ void QgsStyleExportImportDialog::importFileChanged( const QString &path )
QString tag = pathInfo.fileName().remove( QStringLiteral( ".xml" ) );
mSymbolTags->setText( tag );
if ( QFileInfo::exists( mFileName ) )
{
populateStyles( mTempStyle );
QgsSettings settings;
settings.setValue( QStringLiteral( "StyleManager/lastImportDir" ), pathInfo.absolutePath(), QgsSettings::Gui );
}
}

void QgsStyleExportImportDialog::downloadStyleXml( const QUrl &url )

0 comments on commit 1f744bd

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