Skip to content
Permalink
Browse files

Merge pull request #1738 from mbernasocchi/emit-saved-as

added layerSavedAs signal
  • Loading branch information
NathanW2 committed Dec 21, 2014
2 parents df06057 + 729bdec commit 07182b6c01b3740f6fb8285e9565aae4690c27e3
Showing with 23 additions and 0 deletions.
  1. +5 −0 python/gui/qgisinterface.sip
  2. +5 −0 src/app/qgisapp.cpp
  3. +5 −0 src/app/qgisapp.h
  4. +2 −0 src/app/qgisappinterface.cpp
  5. +6 −0 src/gui/qgisinterface.h
@@ -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 );
};
@@ -5000,6 +5000,10 @@ void QgisApp::saveAsRasterFile()
QMessageBox::Ok );

}
else
{
emit layerSavedAs( rasterLayer, d.outputFileName() );
}
delete pipe;
}
}
@@ -5146,6 +5150,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() );
@@ -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
@@ -65,6 +65,8 @@ QgisAppInterface::QgisAppInterface( QgisApp * _qgis )
this, SIGNAL( newProjectCreated() ) );
connect( qgis, SIGNAL( projectRead() ),
this, SIGNAL( projectRead() ) );
connect( qgis, SIGNAL( layerSavedAs( QgsMapLayer*, QString ) ),
this, SIGNAL( layerSavedAs(QgsMapLayer*, QString ) ) );
}

QgisAppInterface::~QgisAppInterface()
@@ -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

0 comments on commit 07182b6

Please sign in to comment.
You can’t perform that action at this time.