From e4793c1fb8af1d27363d6c85530c56215a0bc52c Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Tue, 17 Dec 2024 19:07:39 +0100 Subject: [PATCH] qgs3dmapcanvaswidget: Display a message to report export success state With this change, the messagebar is used to show a message if the export operation failed or succeeded. --- src/app/3d/qgs3dmapcanvaswidget.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/3d/qgs3dmapcanvaswidget.cpp b/src/app/3d/qgs3dmapcanvaswidget.cpp index 87da3271f8c7..f21c393fac73 100644 --- a/src/app/3d/qgs3dmapcanvaswidget.cpp +++ b/src/app/3d/qgs3dmapcanvaswidget.cpp @@ -568,7 +568,18 @@ void Qgs3DMapCanvasWidget::exportScene() layout->addWidget( &exportWidget, 1 ); layout->addWidget( buttons ); if ( dlg.exec() ) - exportWidget.exportScene(); + { + const bool success = exportWidget.exportScene(); + const QString exportFilePath = QDir( exportSettings.sceneFolderPath() ).filePath( exportSettings.sceneName() + QStringLiteral( ".obj" ) ); + if ( success ) + { + mMessageBar->pushMessage( tr( "Export 3D scene" ), tr( "Successfully exported scene to %2" ).arg( QUrl::fromLocalFile( exportFilePath ).toString(), QDir::toNativeSeparators( exportFilePath ) ), Qgis::MessageLevel::Success, 0 ); + } + else + { + mMessageBar->pushMessage( tr( "Export 3D scene" ), tr( "Unable to export scene to %2" ).arg( QUrl::fromLocalFile( exportFilePath ).toString(), QDir::toNativeSeparators( exportFilePath ) ), Qgis::MessageLevel::Warning, 0 ); + } + } } void Qgs3DMapCanvasWidget::onMainCanvasLayersChanged()