[composer] Enable always disabled labels as outline checkbox in

svg export, hook up to labeling setting
This commit is contained in:
Nyall Dawson 2015-09-14 20:35:25 +10:00
parent 4bc606c854
commit aedf08c8a4
2 changed files with 20 additions and 3 deletions

View File

@ -2303,6 +2303,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
QString outputFileName;
QString outputDir;
bool groupLayers = false;
bool prevSettingLabelsAsOutlines = QgsProject::instance()->readBoolEntry( "PAL", "/DrawOutlineLabels", true );
if ( mode == QgsComposer::Single )
{
@ -2333,8 +2334,12 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
QDialog dialog;
Ui::QgsSvgExportOptionsDialog options;
options.setupUi( &dialog );
options.chkTextAsOutline->setChecked( prevSettingLabelsAsOutlines );
dialog.exec();
groupLayers = options.chkMapLayersAsGroup->isChecked();
//temporarily override label draw outlines setting
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", options.chkTextAsOutline->isChecked() );
}
if ( !outputFileName.endsWith( ".svg", Qt::CaseInsensitive ) )
@ -2388,8 +2393,12 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
QDialog dialog;
Ui::QgsSvgExportOptionsDialog options;
options.setupUi( &dialog );
options.chkTextAsOutline->setChecked( prevSettingLabelsAsOutlines );
dialog.exec();
groupLayers = options.chkMapLayersAsGroup->isChecked();
//temporarily override label draw outlines setting
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", options.chkTextAsOutline->isChecked() );
}
@ -2409,6 +2418,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
return;
}
}
@ -2437,6 +2447,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
return;
}
outputFileName = QDir( outputDir ).filePath( atlasMap->currentFilename() ) + ".svg";
@ -2481,6 +2492,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
return;
}
@ -2604,6 +2616,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
return;
}
@ -2618,6 +2631,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
atlasMap->endRender();
mView->setPaintingEnabled( true );
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
}
void QgsComposer::on_mActionSelectMoveItem_triggered()

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>463</width>
<width>471</width>
<height>103</height>
</rect>
</property>
@ -29,10 +29,13 @@
<item>
<widget class="QCheckBox" name="chkTextAsOutline">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="toolTip">
<string>Uncheck to render map labels as text objects. This will degrade the quality of the map labels but allow editing in vector illustration software.</string>
</property>
<property name="text">
<string>Render text as outline</string>
<string>Render map labels as outlines</string>
</property>
<property name="checked">
<bool>true</bool>