|
22 | 22 | #include "qgscomposition.h"
|
23 | 23 | #include "qgsexception.h"
|
24 | 24 | #include "qgsproject.h"
|
| 25 | +#include "qgsmessageviewer.h" |
25 | 26 |
|
26 | 27 | #include <QDesktopWidget>
|
27 | 28 | #include <QFileDialog>
|
|
37 | 38 | #include <QPixmap>
|
38 | 39 | #include <QToolBar>
|
39 | 40 | #include <QImageWriter>
|
| 41 | +#include <QCheckBox> |
40 | 42 | #include <iostream>
|
41 | 43 |
|
42 | 44 |
|
@@ -634,6 +636,35 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
|
634 | 636 | void QgsComposer::on_mActionExportAsSVG_activated(void)
|
635 | 637 | {
|
636 | 638 | 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 | + |
637 | 668 | QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsSvgFile","qgis.svg");
|
638 | 669 | QFileInfo file(myLastUsedFile);
|
639 | 670 |
|
|
0 commit comments