Skip to content

Commit 377dfc6

Browse files
author
g_j_m
committedSep 18, 2006
Provide a warning to the user that the svg output may well be less
than desired, and allow them to select whether to see that message in the future. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5836 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 11fafff commit 377dfc6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
 

‎src/composer/qgscomposer.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "qgscomposition.h"
2323
#include "qgsexception.h"
2424
#include "qgsproject.h"
25+
#include "qgsmessageviewer.h"
2526

2627
#include <QDesktopWidget>
2728
#include <QFileDialog>
@@ -37,6 +38,7 @@
3738
#include <QPixmap>
3839
#include <QToolBar>
3940
#include <QImageWriter>
41+
#include <QCheckBox>
4042
#include <iostream>
4143

4244

@@ -634,6 +636,35 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
634636
void QgsComposer::on_mActionExportAsSVG_activated(void)
635637
{
636638
QSettings myQSettings;
639+
640+
bool displaySVGWarning = myQSettings.value("/UI/displaySVGWarning", true).toBool();
641+
642+
if (displaySVGWarning)
643+
{
644+
QgsMessageViewer* m = new QgsMessageViewer(this);
645+
m->setWindowTitle(tr("SVG warning"));
646+
m->setCheckBoxText(tr("Don't show this message again"));
647+
m->setCheckBoxState(Qt::Unchecked);
648+
m->setCheckBoxVisible(true);
649+
m->setMessageAsHtml(tr("<p>The SVG export function in Qgis has several "
650+
"problems due to bugs and deficiencies in the "
651+
"Qt4 svg code. Of note, text does not "
652+
"appear in the SVG file and there are problems "
653+
"with the map bounding box clipping other items "
654+
"such as the legend or scale bar.</p>"
655+
"If you require a vector-based output file from "
656+
"Qgis it is suggested that you try exporting "
657+
"to pdf if the SVG output is not satisfactory."
658+
"</p>"));
659+
m->exec();
660+
661+
if (m->checkBoxState() == Qt::Checked)
662+
myQSettings.setValue("/UI/displaySVGWarning", false);
663+
else
664+
myQSettings.setValue("/UI/displaySVGWarning", true);
665+
delete m;
666+
}
667+
637668
QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsSvgFile","qgis.svg");
638669
QFileInfo file(myLastUsedFile);
639670

0 commit comments

Comments
 (0)