Skip to content
Permalink
Browse files

dwg import:

* allow entering new gpkg filenames (fixes #20305)
* move messagebar to dialog

(cherry picked from commit 8400a8b)
  • Loading branch information
jef-n committed Nov 2, 2018
1 parent e96e41d commit 86a94142e36ee6ada178cb90ba5842dd73d84859
Showing with 17 additions and 6 deletions.
  1. +5 −3 src/app/dwg/qgsdwgimportdialog.cpp
  2. +12 −3 src/ui/qgsdwgimportbase.ui
@@ -54,6 +54,8 @@ QgsDwgImportDialog::QgsDwgImportDialog( QWidget *parent, Qt::WindowFlags f )
: QDialog( parent, f )
{
setupUi( this );
mDatabaseFileWidget->setStorageMode( QgsFileWidget::SaveFile );

connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsDwgImportDialog::buttonBox_accepted );
connect( mDatabaseFileWidget, &QgsFileWidget::fileChanged, this, &QgsDwgImportDialog::mDatabaseFileWidget_textChanged );
connect( pbBrowseDrawing, &QPushButton::clicked, this, &QgsDwgImportDialog::pbBrowseDrawing_clicked );
@@ -222,7 +224,7 @@ void QgsDwgImportDialog::pbLoadDatabase_clicked()
}
else
{
QgisApp::instance()->messageBar()->pushMessage( tr( "Could not open layer list" ), Qgis::Critical, 4 );
bar->pushMessage( tr( "Could not open layer list" ), Qgis::Critical, 4 );
}
}

@@ -247,11 +249,11 @@ void QgsDwgImportDialog::pbImportDrawing_clicked()
QString error;
if ( importer.import( leDrawing->text(), error, cbExpandInserts->isChecked(), cbUseCurves->isChecked() ) )
{
QgisApp::instance()->messageBar()->pushMessage( tr( "Drawing import completed." ), Qgis::Info, 4 );
bar->pushMessage( tr( "Drawing import completed." ), Qgis::Info, 4 );
}
else
{
QgisApp::instance()->messageBar()->pushMessage( tr( "Drawing import failed (%1)" ).arg( error ), Qgis::Critical, 4 );
bar->pushMessage( tr( "Drawing import failed (%1)" ).arg( error ), Qgis::Critical, 4 );
}

pbLoadDatabase_clicked();
@@ -14,7 +14,7 @@
<string>DWG/DXF Import</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="7" column="0" colspan="2">
<item row="8" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -24,7 +24,7 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="mGroupBox">
<property name="title">
<string>Layers to Import into Project</string>
@@ -107,7 +107,7 @@
</layout>
</widget>
</item>
<item row="0" column="0" colspan="2">
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Import Drawing into GeoPackage</string>
@@ -221,6 +221,9 @@
</layout>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QgsMessageBar" name="bar" native="true"/>
</item>
</layout>
</widget>
<customwidgets>
@@ -235,6 +238,12 @@
<header>qgsprojectionselectionwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsMessageBar</class>
<extends>QWidget</extends>
<header>qgsmessagebar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>pbLoadDatabase</tabstop>

0 comments on commit 86a9414

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