Skip to content

Commit c5cbd6d

Browse files
committedOct 23, 2015
Partial fix for #13143; fix Mac exports for composer with HTML labels
- Does not work with Print dialogs (still non functional)
1 parent d8303a7 commit c5cbd6d

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed
 

‎src/app/composer/qgscomposer.cpp‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,12 +1616,16 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
16161616
{
16171617
outputFileName = file.path();
16181618
}
1619-
1619+
#ifdef Q_OS_MAC
1620+
mQgis->activateWindow();
1621+
this->raise();
1622+
#endif
16201623
outputFileName = QFileDialog::getSaveFileName(
16211624
this,
16221625
tr( "Save composition as" ),
16231626
outputFileName,
16241627
tr( "PDF Format" ) + " (*.pdf *.PDF)" );
1628+
this->activateWindow();
16251629
if ( outputFileName.isEmpty() )
16261630
{
16271631
return;
@@ -1995,7 +1999,12 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
19951999
outputFileName = QDir( lastUsedDir ).filePath( atlasMap->currentFilename() );
19962000
}
19972001

2002+
#ifdef Q_OS_MAC
2003+
mQgis->activateWindow();
2004+
this->raise();
2005+
#endif
19982006
QPair<QString, QString> fileNExt = QgisGui::getSaveAsImageName( this, tr( "Save composition as" ), outputFileName );
2007+
this->activateWindow();
19992008

20002009
if ( fileNExt.first.isEmpty() )
20012010
{
@@ -2449,11 +2458,16 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
24492458
}
24502459

24512460
// open file dialog
2461+
#ifdef Q_OS_MAC
2462+
mQgis->activateWindow();
2463+
this->raise();
2464+
#endif
24522465
outputFileName = QFileDialog::getSaveFileName(
24532466
this,
24542467
tr( "Save composition as" ),
24552468
outputFileName,
24562469
tr( "SVG Format" ) + " (*.svg *.SVG)" );
2470+
this->activateWindow();
24572471

24582472
if ( outputFileName.isEmpty() )
24592473
return;
@@ -2983,6 +2997,10 @@ void QgsComposer::on_mActionSaveAsTemplate_triggered()
29832997
//show file dialog
29842998
QSettings settings;
29852999
QString lastSaveDir = settings.value( "UI/lastComposerTemplateDir", "" ).toString();
3000+
#ifdef Q_OS_MAC
3001+
mQgis->activateWindow();
3002+
this->raise();
3003+
#endif
29863004
QString saveFileName = QFileDialog::getSaveFileName(
29873005
this,
29883006
tr( "Save template" ),
@@ -3908,7 +3926,6 @@ void QgsComposer::on_mActionPageSetup_triggered()
39083926

39093927
//set printer page orientation
39103928
setPrinterPageOrientation();
3911-
39123929
QPageSetupDialog pageSetupDialog( printer(), this );
39133930
pageSetupDialog.exec();
39143931
}

0 commit comments

Comments
 (0)
Please sign in to comment.