Skip to content
Permalink
Browse files

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 c956fe9d628b01e451870315792fed3b72d51d90
Showing with 130 additions and 218 deletions.
  1. +8 −1 src/app/dwg/qgsdwgimportdialog.cpp
  2. +74 −183 src/app/dwg/qgsdwgimporter.cpp
  3. +4 −1 src/app/dwg/qgsdwgimporter.h
  4. +1 −0 src/app/qgisapp.cpp
  5. +43 −33 src/ui/qgsdwgimportbase.ui
@@ -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 );
@@ -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() );
}

@@ -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 );
}

0 comments on commit c956fe9

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