|
@@ -829,51 +829,6 @@ void QgsLayoutMapWidget::blockAllSignals( bool b ) |
|
|
blockOverviewItemsSignals( b ); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::handleChangedFrameDisplay( QgsLayoutItemMapGrid::BorderSide border, const QgsLayoutItemMapGrid::DisplayMode mode ) |
|
|
{ |
|
|
QgsLayoutItemMapGrid *grid = currentGrid(); |
|
|
if ( !grid ) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
|
|
|
mMapItem->layout()->undoStack()->beginCommand( mMapItem, tr( "Change Frame Divisions" ) ); |
|
|
grid->setFrameDivisions( mode, border ); |
|
|
mMapItem->layout()->undoStack()->endCommand(); |
|
|
mMapItem->updateBoundingRect(); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::handleChangedAnnotationDisplay( QgsLayoutItemMapGrid::BorderSide border, const QString &text ) |
|
|
{ |
|
|
QgsLayoutItemMapGrid *grid = currentGrid(); |
|
|
if ( !grid ) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
|
|
|
mMapItem->layout()->undoStack()->beginCommand( mMapItem, tr( "Change Annotation Display" ) ); |
|
|
if ( text == tr( "Show all" ) ) |
|
|
{ |
|
|
grid->setAnnotationDisplay( QgsLayoutItemMapGrid::ShowAll, border ); |
|
|
} |
|
|
else if ( text == tr( "Show latitude only" ) ) |
|
|
{ |
|
|
grid->setAnnotationDisplay( QgsLayoutItemMapGrid::LatitudeOnly, border ); |
|
|
} |
|
|
else if ( text == tr( "Show longitude only" ) ) |
|
|
{ |
|
|
grid->setAnnotationDisplay( QgsLayoutItemMapGrid::LongitudeOnly, border ); |
|
|
} |
|
|
else //disabled |
|
|
{ |
|
|
grid->setAnnotationDisplay( QgsLayoutItemMapGrid::HideAll, border ); |
|
|
} |
|
|
|
|
|
mMapItem->updateBoundingRect(); |
|
|
mMapItem->update(); |
|
|
mMapItem->layout()->undoStack()->endCommand(); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::updatePreview() |
|
|
{ |
|
|
if ( !mMapItem ) |
|
@@ -974,133 +929,6 @@ void QgsLayoutMapWidget::mDrawCanvasItemsCheckBox_stateChanged( int state ) |
|
|
mMapItem->layout()->undoStack()->endCommand(); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::insertAnnotationPositionEntries( QComboBox *c ) |
|
|
{ |
|
|
c->insertItem( 0, tr( "Inside frame" ) ); |
|
|
c->insertItem( 1, tr( "Outside frame" ) ); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::insertAnnotationDirectionEntries( QComboBox *c ) |
|
|
{ |
|
|
c->addItem( tr( "Horizontal" ), QgsLayoutItemMapGrid::Horizontal ); |
|
|
c->addItem( tr( "Vertical ascending" ), QgsLayoutItemMapGrid::Vertical ); |
|
|
c->addItem( tr( "Vertical descending" ), QgsLayoutItemMapGrid::VerticalDescending ); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::initFrameDisplayBox( QComboBox *c, QgsLayoutItemMapGrid::DisplayMode display ) |
|
|
{ |
|
|
if ( !c ) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
c->setCurrentIndex( c->findData( display ) ); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::initAnnotationDisplayBox( QComboBox *c, QgsLayoutItemMapGrid::DisplayMode display ) |
|
|
{ |
|
|
if ( !c ) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
|
|
|
if ( display == QgsLayoutItemMapGrid::ShowAll ) |
|
|
{ |
|
|
c->setCurrentIndex( c->findText( tr( "Show all" ) ) ); |
|
|
} |
|
|
else if ( display == QgsLayoutItemMapGrid::LatitudeOnly ) |
|
|
{ |
|
|
c->setCurrentIndex( c->findText( tr( "Show latitude only" ) ) ); |
|
|
} |
|
|
else if ( display == QgsLayoutItemMapGrid::LongitudeOnly ) |
|
|
{ |
|
|
c->setCurrentIndex( c->findText( tr( "Show longitude only" ) ) ); |
|
|
} |
|
|
else |
|
|
{ |
|
|
c->setCurrentIndex( c->findText( tr( "Disabled" ) ) ); |
|
|
} |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::handleChangedAnnotationPosition( QgsLayoutItemMapGrid::BorderSide border, const QString &text ) |
|
|
{ |
|
|
QgsLayoutItemMapGrid *grid = currentGrid(); |
|
|
if ( !grid ) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
|
|
|
mMapItem->layout()->undoStack()->beginCommand( mMapItem, tr( "Change Annotation Position" ) ); |
|
|
if ( text == tr( "Inside frame" ) ) |
|
|
{ |
|
|
grid->setAnnotationPosition( QgsLayoutItemMapGrid::InsideMapFrame, border ); |
|
|
} |
|
|
else //Outside frame |
|
|
{ |
|
|
grid->setAnnotationPosition( QgsLayoutItemMapGrid::OutsideMapFrame, border ); |
|
|
} |
|
|
|
|
|
mMapItem->updateBoundingRect(); |
|
|
mMapItem->update(); |
|
|
mMapItem->layout()->undoStack()->endCommand(); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::handleChangedAnnotationDirection( QgsLayoutItemMapGrid::BorderSide border, QgsLayoutItemMapGrid::AnnotationDirection direction ) |
|
|
{ |
|
|
QgsLayoutItemMapGrid *grid = currentGrid(); |
|
|
if ( !grid ) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
|
|
|
mMapItem->layout()->undoStack()->beginCommand( mMapItem, tr( "Change Annotation Direction" ) ); |
|
|
grid->setAnnotationDirection( direction, border ); |
|
|
mMapItem->updateBoundingRect(); |
|
|
mMapItem->update(); |
|
|
mMapItem->layout()->undoStack()->endCommand(); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::insertFrameDisplayEntries( QComboBox *c ) |
|
|
{ |
|
|
c->addItem( tr( "All" ), QgsLayoutItemMapGrid::ShowAll ); |
|
|
c->addItem( tr( "Latitude/Y only" ), QgsLayoutItemMapGrid::LatitudeOnly ); |
|
|
c->addItem( tr( "Longitude/X only" ), QgsLayoutItemMapGrid::LongitudeOnly ); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::insertAnnotationDisplayEntries( QComboBox *c ) |
|
|
{ |
|
|
c->insertItem( 0, tr( "Show all" ) ); |
|
|
c->insertItem( 1, tr( "Show latitude only" ) ); |
|
|
c->insertItem( 2, tr( "Show longitude only" ) ); |
|
|
c->insertItem( 3, tr( "Disabled" ) ); |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::initAnnotationPositionBox( QComboBox *c, QgsLayoutItemMapGrid::AnnotationPosition pos ) |
|
|
{ |
|
|
if ( !c ) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
|
|
|
if ( pos == QgsLayoutItemMapGrid::InsideMapFrame ) |
|
|
{ |
|
|
c->setCurrentIndex( c->findText( tr( "Inside frame" ) ) ); |
|
|
} |
|
|
else |
|
|
{ |
|
|
c->setCurrentIndex( c->findText( tr( "Outside frame" ) ) ); |
|
|
} |
|
|
} |
|
|
|
|
|
void QgsLayoutMapWidget::initAnnotationDirectionBox( QComboBox *c, QgsLayoutItemMapGrid::AnnotationDirection dir ) |
|
|
{ |
|
|
if ( !c ) |
|
|
{ |
|
|
return; |
|
|
} |
|
|
c->setCurrentIndex( c->findData( dir ) ); |
|
|
} |
|
|
|
|
|
|
|
|
void QgsLayoutMapWidget::atlasLayerChanged( QgsVectorLayer *layer ) |
|
|
{ |
|
|
if ( !layer || layer->wkbType() == QgsWkbTypes::NoGeometry ) |
|
|