Skip to content

Commit aedf08c

Browse files
committedSep 14, 2015
[composer] Enable always disabled labels as outline checkbox in
svg export, hook up to labeling setting
1 parent 4bc606c commit aedf08c

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,6 +2303,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
23032303
QString outputFileName;
23042304
QString outputDir;
23052305
bool groupLayers = false;
2306+
bool prevSettingLabelsAsOutlines = QgsProject::instance()->readBoolEntry( "PAL", "/DrawOutlineLabels", true );
23062307

23072308
if ( mode == QgsComposer::Single )
23082309
{
@@ -2333,8 +2334,12 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
23332334
QDialog dialog;
23342335
Ui::QgsSvgExportOptionsDialog options;
23352336
options.setupUi( &dialog );
2337+
options.chkTextAsOutline->setChecked( prevSettingLabelsAsOutlines );
2338+
23362339
dialog.exec();
23372340
groupLayers = options.chkMapLayersAsGroup->isChecked();
2341+
//temporarily override label draw outlines setting
2342+
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", options.chkTextAsOutline->isChecked() );
23382343
}
23392344

23402345
if ( !outputFileName.endsWith( ".svg", Qt::CaseInsensitive ) )
@@ -2388,8 +2393,12 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
23882393
QDialog dialog;
23892394
Ui::QgsSvgExportOptionsDialog options;
23902395
options.setupUi( &dialog );
2396+
options.chkTextAsOutline->setChecked( prevSettingLabelsAsOutlines );
2397+
23912398
dialog.exec();
23922399
groupLayers = options.chkMapLayersAsGroup->isChecked();
2400+
//temporarily override label draw outlines setting
2401+
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", options.chkTextAsOutline->isChecked() );
23932402
}
23942403

23952404

@@ -2409,6 +2418,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
24092418
QMessageBox::Ok,
24102419
QMessageBox::Ok );
24112420
mView->setPaintingEnabled( true );
2421+
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
24122422
return;
24132423
}
24142424
}
@@ -2437,6 +2447,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
24372447
QMessageBox::Ok,
24382448
QMessageBox::Ok );
24392449
mView->setPaintingEnabled( true );
2450+
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
24402451
return;
24412452
}
24422453
outputFileName = QDir( outputDir ).filePath( atlasMap->currentFilename() ) + ".svg";
@@ -2481,6 +2492,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
24812492
QMessageBox::Ok,
24822493
QMessageBox::Ok );
24832494
mView->setPaintingEnabled( true );
2495+
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
24842496
return;
24852497
}
24862498

@@ -2604,6 +2616,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
26042616
QMessageBox::Ok,
26052617
QMessageBox::Ok );
26062618
mView->setPaintingEnabled( true );
2619+
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
26072620
return;
26082621
}
26092622

@@ -2618,6 +2631,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
26182631
atlasMap->endRender();
26192632

26202633
mView->setPaintingEnabled( true );
2634+
QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", prevSettingLabelsAsOutlines );
26212635
}
26222636

26232637
void QgsComposer::on_mActionSelectMoveItem_triggered()

‎src/ui/qgssvgexportoptions.ui renamed to ‎src/ui/composer/qgssvgexportoptions.ui

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>463</width>
9+
<width>471</width>
1010
<height>103</height>
1111
</rect>
1212
</property>
@@ -29,10 +29,13 @@
2929
<item>
3030
<widget class="QCheckBox" name="chkTextAsOutline">
3131
<property name="enabled">
32-
<bool>false</bool>
32+
<bool>true</bool>
33+
</property>
34+
<property name="toolTip">
35+
<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>
3336
</property>
3437
<property name="text">
35-
<string>Render text as outline</string>
38+
<string>Render map labels as outlines</string>
3639
</property>
3740
<property name="checked">
3841
<bool>true</bool>

0 commit comments

Comments
 (0)
Please sign in to comment.