Skip to content
Permalink
Browse files

use native separators for message bar hyperlinks

  • Loading branch information
nirvn committed Jan 17, 2018
1 parent 8bb6fde commit f274456fcec5d08f8aebc4fc21c22c619e65ec3a
@@ -54,7 +54,7 @@ Qgs3DMapCanvasDockWidget::Qgs3DMapCanvasDockWidget( QWidget *parent )

connect( mCanvas, &Qgs3DMapCanvas::savedAsImage, this, [ = ]( const QString fileName )
{
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as Image" ), tr( "Successfully saved the 3D map to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( QFileInfo( fileName ).path() ).toString(), fileName ) );
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as Image" ), tr( "Successfully saved the 3D map to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( QFileInfo( fileName ).path() ).toString(), QDir::toNativeSeparators( fileName ) ) );
} );

mLabelPendingJobs = new QLabel( this );
@@ -1762,7 +1762,7 @@ void QgsLayoutDesignerDialog::exportToRaster()
{
case QgsLayoutExporter::Success:
mMessageBar->pushMessage( tr( "Export layout" ),
tr( "Successfully exported layout to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), fileNExt.first ),
tr( "Successfully exported layout to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), QDir::toNativeSeparators( fileNExt.first ) ),
QgsMessageBar::SUCCESS, 0 );
break;

@@ -1866,7 +1866,7 @@ void QgsLayoutDesignerDialog::exportToPdf()
case QgsLayoutExporter::Success:
{
mMessageBar->pushMessage( tr( "Export layout" ),
tr( "Successfully exported layout to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), outputFileName ),
tr( "Successfully exported layout to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), QDir::toNativeSeparators( outputFileName ) ),
QgsMessageBar::SUCCESS, 0 );
break;
}
@@ -1973,7 +1973,7 @@ void QgsLayoutDesignerDialog::exportToSvg()
case QgsLayoutExporter::Success:
{
mMessageBar->pushMessage( tr( "Export layout" ),
tr( "Successfully exported layout to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), outputFileName ),
tr( "Successfully exported layout to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), QDir::toNativeSeparators( outputFileName ) ),
QgsMessageBar::SUCCESS, 0 );
break;
}
@@ -2411,7 +2411,7 @@ void QgsLayoutDesignerDialog::exportAtlasToRaster()
{
case QgsLayoutExporter::Success:
mMessageBar->pushMessage( tr( "Export atlas" ),
tr( "Successfully exported atlas to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( dir ).toString(), dir ),
tr( "Successfully exported atlas to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( dir ).toString(), QDir::toNativeSeparators( dir ) ),
QgsMessageBar::SUCCESS, 0 );
break;

@@ -2563,7 +2563,7 @@ void QgsLayoutDesignerDialog::exportAtlasToSvg()
case QgsLayoutExporter::Success:
{
mMessageBar->pushMessage( tr( "Export atlas" ),
tr( "Successfully exported atlas to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( dir ).toString(), dir ),
tr( "Successfully exported atlas to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( dir ).toString(), QDir::toNativeSeparators( dir ) ),
QgsMessageBar::SUCCESS, 0 );
break;
}
@@ -2777,13 +2777,13 @@ void QgsLayoutDesignerDialog::exportAtlasToPdf()
if ( singleFile )
{
mMessageBar->pushMessage( tr( "Export atlas" ),
tr( "Successfully exported atlas to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), outputFileName ),
tr( "Successfully exported atlas to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), QDir::toNativeSeparators( outputFileName ) ),
QgsMessageBar::SUCCESS, 0 );
}
else
{
mMessageBar->pushMessage( tr( "Export atlas" ),
tr( "Successfully exported atlas to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( outputFileName ).toString(), outputFileName ),
tr( "Successfully exported atlas to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( outputFileName ).toString(), QDir::toNativeSeparators( outputFileName ) ),
QgsMessageBar::SUCCESS, 0 );
}
break;
@@ -2894,7 +2894,7 @@ void QgsLayoutDesignerDialog::exportReportToRaster()
{
case QgsLayoutExporter::Success:
mMessageBar->pushMessage( tr( "Export report" ),
tr( "Successfully exported report to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( dir ).toString(), dir ),
tr( "Successfully exported report to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( dir ).toString(), QDir::toNativeSeparators( dir ) ),
QgsMessageBar::SUCCESS, 0 );
break;

@@ -3010,7 +3010,7 @@ void QgsLayoutDesignerDialog::exportReportToSvg()
case QgsLayoutExporter::Success:
{
mMessageBar->pushMessage( tr( "Export report" ),
tr( "Successfully exported report to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( dir ).toString(), dir ),
tr( "Successfully exported report to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( dir ).toString(), QDir::toNativeSeparators( dir ) ),
QgsMessageBar::SUCCESS, 0 );
break;
}
@@ -3140,7 +3140,7 @@ void QgsLayoutDesignerDialog::exportReportToPdf()
case QgsLayoutExporter::Success:
{
mMessageBar->pushMessage( tr( "Export report" ),
tr( "Successfully exported report to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), outputFileName ),
tr( "Successfully exported report to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fi.path() ).toString(), QDir::toNativeSeparators( outputFileName ) ),
QgsMessageBar::SUCCESS, 0 );
break;
}
@@ -6853,7 +6853,7 @@ void QgisApp::saveAsRasterFile( QgsRasterLayer *rasterLayer )
emit layerSavedAs( rlWeakPointer, fileName );

messageBar()->pushMessage( tr( "Saving Done" ),
tr( "Successfully saved raster layer to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( QFileInfo( newFilename ).path() ).toString() ).arg( newFilename ),
tr( "Successfully saved raster layer to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( QFileInfo( newFilename ).path() ).toString() ).arg( QDir::toNativeSeparators( newFilename ) ),
QgsMessageBar::SUCCESS, messageTimeout() );
} );

@@ -7056,7 +7056,7 @@ void QgisApp::saveAsVectorFileGeneral( QgsVectorLayer *vlayer, bool symbologyOpt
}
this->emit layerSavedAs( vlayer, vectorFilename );
this->messageBar()->pushMessage( tr( "Saving Done" ),
tr( "Successfully saved vector layer to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( QFileInfo( newFilename ).path() ).toString() ).arg( newFilename ),
tr( "Successfully saved vector layer to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( QFileInfo( newFilename ).path() ).toString() ).arg( QDir::toNativeSeparators( newFilename ) ),
QgsMessageBar::SUCCESS, messageTimeout() );
}
);
@@ -403,7 +403,7 @@ void QgsMapSaveDialog::onAccepted()
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [ = ]
{
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as image" ), tr( "Successfully saved map to <a href=\"%1\">%2</a>" )
.arg( QUrl::fromLocalFile( QFileInfo( fileNameAndFilter.first ).path() ).toString(), fileNameAndFilter.first ) );
.arg( QUrl::fromLocalFile( QFileInfo( fileNameAndFilter.first ).path() ).toString(), QDir::toNativeSeparators( fileNameAndFilter.first ) ) );
} );
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, [ = ]( int error )
{
@@ -452,7 +452,7 @@ void QgsMapSaveDialog::onAccepted()
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [ = ]
{
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as PDF" ), tr( "Successfully saved map to <a href=\"%1\">%2</a>" )
.arg( QUrl::fromLocalFile( QFileInfo( fileName ).path() ).toString(), fileName ) );
.arg( QUrl::fromLocalFile( QFileInfo( fileName ).path() ).toString(), QDir::toNativeSeparators( fileName ) ) );
} );
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, [ = ]( int )
{

0 comments on commit f274456

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