Skip to content

Commit

Permalink
add to canvas checkbox in raster "save as..." dialog (fix #6949)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed May 20, 2015
1 parent d393d26 commit 7e69bd1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5167,7 +5167,14 @@ void QgisApp::saveAsRasterFile()
}
else
{
if ( d.addToCanvas() )
{
addRasterLayers( QStringList( d.outputFileName() ) );
}
emit layerSavedAs( rasterLayer, d.outputFileName() );
messageBar()->pushMessage( tr( "Saving done" ),
tr( "Export to raster file has been completed" ),
QgsMessageBar::INFO, messageTimeout() );
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/gui/qgsrasterlayersaveasdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ bool QgsRasterLayerSaveAsDialog::tileMode() const
return mTileModeCheckBox->isChecked();
}

bool QgsRasterLayerSaveAsDialog::addToCanvas() const
{
return mAddToCanvas->isChecked();
}

QString QgsRasterLayerSaveAsDialog::outputFileName() const
{
return mSaveAsLineEdit->text();
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsrasterlayersaveasdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class GUI_EXPORT QgsRasterLayerSaveAsDialog: public QDialog, private Ui::QgsRast
int maximumTileSizeX() const;
int maximumTileSizeY() const;
bool tileMode() const;
bool addToCanvas() const;
QString outputFileName() const;
QString outputFormat() const;
QgsCoordinateReferenceSystem outputCrs();
Expand Down
16 changes: 13 additions & 3 deletions src/ui/qgsrasterlayersaveasdialogbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<item>
<widget class="QCheckBox" name="mTileModeCheckBox">
<property name="toolTip">
<string>Create GDAL Virtual Format composed of multiple
<string>Create GDAL Virtual Format composed of multiple
datasets with maximum width and height specified below.</string>
</property>
<property name="text">
Expand Down Expand Up @@ -163,6 +163,16 @@ datasets with maximum width and height specified below.</string>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="mAddToCanvas">
<property name="text">
<string>Add saved file to map</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QScrollArea" name="mScrollArea">
<property name="frameShape">
Expand All @@ -178,9 +188,9 @@ datasets with maximum width and height specified below.</string>
<property name="geometry">
<rect>
<x>0</x>
<y>-179</y>
<y>0</y>
<width>541</width>
<height>583</height>
<height>577</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
Expand Down

0 comments on commit 7e69bd1

Please sign in to comment.