mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Show helpful warning message when labels cannot be moved because
they are set to store in a column which no longer exists on the layer
This commit is contained in:
parent
204af6f02f
commit
442e16cc6c
@ -193,7 +193,17 @@ void QgsMapToolMoveLabel::cadCanvasPressEvent( QgsMapMouseEvent *e )
|
||||
return;
|
||||
|
||||
if ( !labelMoveable( vlayer, mCurrentLabel.settings, xCol, yCol ) )
|
||||
{
|
||||
QString xColName = dataDefinedColumnName( QgsPalLayerSettings::PositionX, mCurrentLabel.settings, vlayer );
|
||||
QString yColName = dataDefinedColumnName( QgsPalLayerSettings::PositionY, mCurrentLabel.settings, vlayer );
|
||||
if ( xCol < 0 && yCol < 0 )
|
||||
QgisApp::instance()->messageBar()->pushWarning( tr( "Move Label" ), tr( "The label X/Y columns “%1” and “%2” do not exist in the layer" ).arg( xColName, yColName ) );
|
||||
else if ( xCol < 0 )
|
||||
QgisApp::instance()->messageBar()->pushWarning( tr( "Move Label" ), tr( "The label X column “%1” does not exist in the layer" ).arg( xColName ) );
|
||||
else if ( yCol < 0 )
|
||||
QgisApp::instance()->messageBar()->pushWarning( tr( "Move Label" ), tr( "The label Y column “%1” does not exist in the layer" ).arg( yColName ) );
|
||||
return;
|
||||
}
|
||||
|
||||
xCol = indexes[ QgsPalLayerSettings::PositionX ];
|
||||
yCol = indexes[ QgsPalLayerSettings::PositionY ];
|
||||
|
Loading…
x
Reference in New Issue
Block a user