Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dwg import: make curves optional (enabled by default, disabled comple…
…tely with GDAL 1)
  • Loading branch information
jef-n committed Dec 15, 2016
1 parent 49055c6 commit c956fe9
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 218 deletions.
9 changes: 8 additions & 1 deletion src/app/dwg/qgsdwgimportdialog.cpp
Expand Up @@ -67,6 +67,12 @@ QgsDwgImportDialog::QgsDwgImportDialog( QWidget *parent, Qt::WindowFlags f )
leDatabase->setText( s.value( "/DwgImport/lastDatabase", "" ).toString() );
cbExpandInserts->setChecked( s.value( "/DwgImport/lastExpandInserts", true ).toBool() );
cbMergeLayers->setChecked( s.value( "/DwgImport/lastMergeLayers", false ).toBool() );
cbUseCurves->setChecked( s.value( "/DwgImport/lastUseCurves", true ).toBool() );

#if !defined(GDAL_COMPUTE_VERSION) || GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,0,0)
cbUseCurves->setChecked( false );
cbUseCurves->setHidden( true );
#endif

leDrawing->setReadOnly( true );
pbImportDrawing->setHidden( true );
Expand All @@ -92,6 +98,7 @@ QgsDwgImportDialog::~QgsDwgImportDialog()
s.setValue( "/DwgImport/lastDatabase", leDatabase->text() );
s.setValue( "/DwgImport/lastExpandInserts", cbExpandInserts->isChecked() );
s.setValue( "/DwgImport/lastMergeLayers", cbMergeLayers->isChecked() );
s.setValue( "/DwgImport/lastUseCurves", cbUseCurves->isChecked() );
s.setValue( "/Windows/DwgImport/geometry", saveGeometry() );
}

Expand Down Expand Up @@ -250,7 +257,7 @@ void QgsDwgImportDialog::on_pbImportDrawing_clicked()
QgsDwgImporter importer( leDatabase->text(), mCrsSelector->crs() );

QString error;
if ( importer.import( leDrawing->text(), error, cbExpandInserts->isChecked() ) )
if ( importer.import( leDrawing->text(), error, cbExpandInserts->isChecked(), cbUseCurves->isChecked() ) )
{
QgisApp::instance()->messageBar()->pushMessage( tr( "Drawing import completed." ), QgsMessageBar::INFO, 4 );
}
Expand Down

0 comments on commit c956fe9

Please sign in to comment.