Skip to content
Permalink
Browse files

[composer] Enable always disabled labels as outline checkbox in

svg export, hook up to labeling setting
  • Loading branch information
nyalldawson committed Sep 14, 2015
1 parent 4bc606c commit aedf08c8a44f0cd8f0afefc87a8cc34fd073851c
Showing with 20 additions and 3 deletions.
  1. +14 −0 src/app/composer/qgscomposer.cpp
  2. +6 −3 src/ui/{ → composer}/qgssvgexportoptions.ui
@@ -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()
@@ -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>

0 comments on commit aedf08c

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