Skip to content

Commit

Permalink
Don't omit .pdf extension when exporting map to pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 19, 2019
1 parent 8d89dd9 commit 7f00ea9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/app/qgsmapsavedialog.cpp
Expand Up @@ -43,7 +43,7 @@
#include "qgsmessagebar.h"
#include "qgsapplication.h"
#include "qgsexpressioncontextutils.h"

#include "qgsfileutils.h"

Q_GUI_EXPORT extern int qt_defaultDpiX();

Expand Down Expand Up @@ -467,6 +467,8 @@ void QgsMapSaveDialog::onAccepted()
QString fileName = QFileDialog::getSaveFileName( QgisApp::instance(), tr( "Save Map As" ), lastUsedDir, tr( "PDF Format" ) + " (*.pdf *.PDF)" );
if ( !fileName.isEmpty() )
{
fileName = QgsFileUtils::ensureFileNameHasExtension( fileName, QStringList() << QStringLiteral( "pdf" ) );

settings.setValue( QStringLiteral( "UI/lastSaveAsImageDir" ), QFileInfo( fileName ).absolutePath() );

QgsMapSettings ms = QgsMapSettings();
Expand Down
13 changes: 5 additions & 8 deletions src/ui/qgsmapsavedialog.ui
Expand Up @@ -15,7 +15,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0,1,0,0,0">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
Expand Down Expand Up @@ -43,7 +43,7 @@
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<item row="8" column="0" colspan="2">
<widget class="QGroupBox" name="mGeoPDFGroupBox">
<property name="title">
<string>Create Geospatial PDF (GeoPDF)</string>
Expand Down Expand Up @@ -105,7 +105,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>133</height>
</size>
</property>
</spacer>
Expand Down Expand Up @@ -158,7 +158,7 @@
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="mSaveAsRaster">
<property name="visible">
<bool>false</bool>
Expand Down Expand Up @@ -287,16 +287,13 @@ Rasterizing the map is recommended when such effects are used.</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<item row="10" column="0" colspan="2">
<widget class="QLabel" name="mInfo">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QTextBrowser" name="textBrowser"/>
</item>
</layout>
</item>
<item>
Expand Down

0 comments on commit 7f00ea9

Please sign in to comment.