Skip to content

Commit

Permalink
added layerSavedAs signal
Browse files Browse the repository at this point in the history
  • Loading branch information
mbernasocchi committed Dec 16, 2014
1 parent 4e4e161 commit 0670818
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -522,4 +522,9 @@ class QgisInterface : QObject
signal for when this happens.
*/
void newProjectCreated();
/**This signal is emitted when a layer has been saved using save as
@note
added in version 2.7
*/
void layerSavedAs( QgsMapLayer* l, QString path );
};
5 changes: 5 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4993,6 +4993,10 @@ void QgisApp::saveAsRasterFile()
QMessageBox::Ok );

}
else
{
emit layerSavedAs( rasterLayer, d.outputFileName() );
}
delete pipe;
}
}
Expand Down Expand Up @@ -5139,6 +5143,7 @@ void QgisApp::saveAsVectorFileGeneral( QgsVectorLayer* vlayer, bool symbologyOpt
{
addVectorLayers( QStringList( newFilename ), encoding, "file" );
}
emit layerSavedAs( vlayer, vectorFilename );
messageBar()->pushMessage( tr( "Saving done" ),
tr( "Export to vector file has been completed" ),
QgsMessageBar::INFO, messageTimeout() );
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,11 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow

void customSrsValidation( QgsCoordinateReferenceSystem &crs );

/**This signal is emitted when a layer has been saved using save as
@note added in version 2.7
*/
void layerSavedAs( QgsMapLayer* l, QString path );

private:
/** This method will open a dialog so the user can select GDAL sublayers to load
* @returns true if any items were loaded
Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgisinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,12 @@ class GUI_EXPORT QgisInterface : public QObject
signal for when this happens.
*/
void newProjectCreated();

/**This signal is emitted when a layer has been saved using save as
@note
added in version 2.7
*/
void layerSavedAs( QgsMapLayer* l, QString path );
};

// FIXME: also in core/qgis.h
Expand Down

0 comments on commit 0670818

Please sign in to comment.