Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 27, 2018
1 parent f33f238 commit 026f914
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 187 deletions.
172 changes: 0 additions & 172 deletions src/app/layout/qgslayoutmapwidget.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down
15 changes: 0 additions & 15 deletions src/app/layout/qgslayoutmapwidget.h
Expand Up @@ -138,21 +138,6 @@ class QgsLayoutMapWidget: public QgsLayoutItemBaseWidget, private Ui::QgsLayoutM

void rotationChanged( double value );

void handleChangedFrameDisplay( QgsLayoutItemMapGrid::BorderSide border, QgsLayoutItemMapGrid::DisplayMode mode );
void handleChangedAnnotationDisplay( QgsLayoutItemMapGrid::BorderSide border, const QString &text );
void handleChangedAnnotationPosition( QgsLayoutItemMapGrid::BorderSide border, const QString &text );
void handleChangedAnnotationDirection( QgsLayoutItemMapGrid::BorderSide border, QgsLayoutItemMapGrid::AnnotationDirection direction );

void insertFrameDisplayEntries( QComboBox *c );
void insertAnnotationDisplayEntries( QComboBox *c );
void insertAnnotationPositionEntries( QComboBox *c );
void insertAnnotationDirectionEntries( QComboBox *c );

void initFrameDisplayBox( QComboBox *c, QgsLayoutItemMapGrid::DisplayMode display );
void initAnnotationDisplayBox( QComboBox *c, QgsLayoutItemMapGrid::DisplayMode display );
void initAnnotationPositionBox( QComboBox *c, QgsLayoutItemMapGrid::AnnotationPosition pos );
void initAnnotationDirectionBox( QComboBox *c, QgsLayoutItemMapGrid::AnnotationDirection dir );

//! Enables or disables the atlas margin and predefined scales radio depending on the atlas coverage layer type
void toggleAtlasScalingOptionsByLayerType();

Expand Down

0 comments on commit 026f914

Please sign in to comment.