Skip to content

Commit

Permalink
Partial fix for #13143; fix Mac exports for composer with HTML labels
Browse files Browse the repository at this point in the history
- Does not work with Print dialogs (still non functional)
  • Loading branch information
dakcarto committed Oct 23, 2015
1 parent d8303a7 commit c5cbd6d
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1616,12 +1616,16 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
{
outputFileName = file.path();
}

#ifdef Q_OS_MAC
mQgis->activateWindow();
this->raise();
#endif
outputFileName = QFileDialog::getSaveFileName(
this,
tr( "Save composition as" ),
outputFileName,
tr( "PDF Format" ) + " (*.pdf *.PDF)" );
this->activateWindow();
if ( outputFileName.isEmpty() )
{
return;
Expand Down Expand Up @@ -1995,7 +1999,12 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
outputFileName = QDir( lastUsedDir ).filePath( atlasMap->currentFilename() );
}

#ifdef Q_OS_MAC
mQgis->activateWindow();
this->raise();
#endif
QPair<QString, QString> fileNExt = QgisGui::getSaveAsImageName( this, tr( "Save composition as" ), outputFileName );
this->activateWindow();

if ( fileNExt.first.isEmpty() )
{
Expand Down Expand Up @@ -2449,11 +2458,16 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
}

// open file dialog
#ifdef Q_OS_MAC
mQgis->activateWindow();
this->raise();
#endif
outputFileName = QFileDialog::getSaveFileName(
this,
tr( "Save composition as" ),
outputFileName,
tr( "SVG Format" ) + " (*.svg *.SVG)" );
this->activateWindow();

if ( outputFileName.isEmpty() )
return;
Expand Down Expand Up @@ -2983,6 +2997,10 @@ void QgsComposer::on_mActionSaveAsTemplate_triggered()
//show file dialog
QSettings settings;
QString lastSaveDir = settings.value( "UI/lastComposerTemplateDir", "" ).toString();
#ifdef Q_OS_MAC
mQgis->activateWindow();
this->raise();
#endif
QString saveFileName = QFileDialog::getSaveFileName(
this,
tr( "Save template" ),
Expand Down Expand Up @@ -3908,7 +3926,6 @@ void QgsComposer::on_mActionPageSetup_triggered()

//set printer page orientation
setPrinterPageOrientation();

QPageSetupDialog pageSetupDialog( printer(), this );
pageSetupDialog.exec();
}
Expand Down

0 comments on commit c5cbd6d

Please sign in to comment.