Skip to content

Commit

Permalink
Cleanup undo strings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 7, 2017
1 parent ab4606d commit cef5dbc
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions src/app/layout/qgslayoutmapgridwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ void QgsLayoutMapGridWidget::handleChangedFrameDisplay( QgsLayoutItemMapGrid::Bo
return;
}

mMap->beginCommand( tr( "Frame divisions changed" ) );
mMap->beginCommand( tr( "Change Frame Divisions" ) );
mMapGrid->setFrameDivisions( mode, border );
mMap->endCommand();
mMap->updateBoundingRect();
Expand All @@ -298,7 +298,7 @@ void QgsLayoutMapGridWidget::handleChangedAnnotationDisplay( QgsLayoutItemMapGri
return;
}

mMap->beginCommand( tr( "Annotation display changed" ) );
mMap->beginCommand( tr( "Change Annotation Format" ) );
if ( text == tr( "Show all" ) )
{
mMapGrid->setAnnotationDisplay( QgsLayoutItemMapGrid::ShowAll, border );
Expand Down Expand Up @@ -400,7 +400,7 @@ void QgsLayoutMapGridWidget::handleChangedAnnotationPosition( QgsLayoutItemMapGr
return;
}

mMap->beginCommand( tr( "Annotation position changed" ) );
mMap->beginCommand( tr( "Change Annotation Position" ) );
if ( text == tr( "Inside frame" ) )
{
mMapGrid->setAnnotationPosition( QgsLayoutItemMapGrid::InsideMapFrame, border );
Expand All @@ -422,7 +422,7 @@ void QgsLayoutMapGridWidget::handleChangedAnnotationDirection( QgsLayoutItemMapG
return;
}

mMap->beginCommand( tr( "Changed annotation direction" ) );
mMap->beginCommand( tr( "Change Annotation Direction" ) );
mMapGrid->setAnnotationDirection( direction, border );
mMap->updateBoundingRect();
mMap->update();
Expand Down Expand Up @@ -727,7 +727,7 @@ void QgsLayoutMapGridWidget::mIntervalXSpinBox_editingFinished()
return;
}

mMap->beginCommand( tr( "Grid interval changed" ) );
mMap->beginCommand( tr( "Change Grid Interval" ) );
mMapGrid->setIntervalX( mIntervalXSpinBox->value() );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -741,7 +741,7 @@ void QgsLayoutMapGridWidget::mIntervalYSpinBox_editingFinished()
return;
}

mMap->beginCommand( tr( "Grid interval changed" ) );
mMap->beginCommand( tr( "Change Grid Interval" ) );
mMapGrid->setIntervalY( mIntervalYSpinBox->value() );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -755,7 +755,7 @@ void QgsLayoutMapGridWidget::mOffsetXSpinBox_valueChanged( double value )
return;
}

mMap->beginCommand( tr( "Grid offset changed" ) );
mMap->beginCommand( tr( "Change Grid Offset" ) );
mMapGrid->setOffsetX( value );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -769,7 +769,7 @@ void QgsLayoutMapGridWidget::mOffsetYSpinBox_valueChanged( double value )
return;
}

mMap->beginCommand( tr( "Grid offset changed" ) );
mMap->beginCommand( tr( "Change Grid Offset" ) );
mMapGrid->setOffsetY( value );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -783,7 +783,7 @@ void QgsLayoutMapGridWidget::mCrossWidthSpinBox_valueChanged( double val )
return;
}

mMap->beginCommand( tr( "Cross width changed" ) );
mMap->beginCommand( tr( "Change Cross Width" ) );
mMapGrid->setCrossLength( val );
mMap->update();
mMap->endCommand();
Expand All @@ -796,7 +796,7 @@ void QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged( double val )
return;
}

mMap->beginCommand( tr( "Frame width changed" ) );
mMap->beginCommand( tr( "Change Frame Width" ) );
mMapGrid->setFrameWidth( val );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -810,7 +810,7 @@ void QgsLayoutMapGridWidget::mCheckGridLeftSide_toggled( bool checked )
return;
}

mMap->beginCommand( tr( "Frame left side changed" ) );
mMap->beginCommand( tr( "Change Frame Left" ) );
mMapGrid->setFrameSideFlag( QgsLayoutItemMapGrid::FrameLeft, checked );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -824,7 +824,7 @@ void QgsLayoutMapGridWidget::mCheckGridRightSide_toggled( bool checked )
return;
}

mMap->beginCommand( tr( "Frame right side changed" ) );
mMap->beginCommand( tr( "Change Frame Right" ) );
mMapGrid->setFrameSideFlag( QgsLayoutItemMapGrid::FrameRight, checked );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -838,7 +838,7 @@ void QgsLayoutMapGridWidget::mCheckGridTopSide_toggled( bool checked )
return;
}

mMap->beginCommand( tr( "Frame top side changed" ) );
mMap->beginCommand( tr( "Change Frame Top" ) );
mMapGrid->setFrameSideFlag( QgsLayoutItemMapGrid::FrameTop, checked );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -852,7 +852,7 @@ void QgsLayoutMapGridWidget::mCheckGridBottomSide_toggled( bool checked )
return;
}

mMap->beginCommand( tr( "Frame bottom side changed" ) );
mMap->beginCommand( tr( "Change Frame Bottom" ) );
mMapGrid->setFrameSideFlag( QgsLayoutItemMapGrid::FrameBottom, checked );
mMap->updateBoundingRect();
mMap->update();
Expand Down Expand Up @@ -886,7 +886,7 @@ void QgsLayoutMapGridWidget::mGridFramePenSizeSpinBox_valueChanged( double d )
return;
}

mMap->beginCommand( tr( "Changed grid frame line thickness" ) );
mMap->beginCommand( tr( "Change Frame Thickness" ) );
mMapGrid->setFramePenSize( d );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -900,7 +900,7 @@ void QgsLayoutMapGridWidget::mGridFramePenColorButton_colorChanged( const QColor
return;
}

mMap->beginCommand( tr( "Grid frame color changed" ), QgsLayoutItem::UndoGridFramePenColor );
mMap->beginCommand( tr( "Change Frame Color" ), QgsLayoutItem::UndoGridFramePenColor );
mMapGrid->setFramePenColor( newColor );
mMap->update();
mMap->endCommand();
Expand All @@ -913,7 +913,7 @@ void QgsLayoutMapGridWidget::mGridFrameFill1ColorButton_colorChanged( const QCol
return;
}

mMap->beginCommand( tr( "Grid frame first fill color changed" ), QgsLayoutItem::UndoMapGridFrameFill1Color );
mMap->beginCommand( tr( "Change Frame Fill Color" ), QgsLayoutItem::UndoMapGridFrameFill1Color );
mMapGrid->setFrameFillColor1( newColor );
mMap->update();
mMap->endCommand();
Expand All @@ -926,7 +926,7 @@ void QgsLayoutMapGridWidget::mGridFrameFill2ColorButton_colorChanged( const QCol
return;
}

mMap->beginCommand( tr( "Grid frame second fill color changed" ), QgsLayoutItem::UndoMapGridFrameFill2Color );
mMap->beginCommand( tr( "Change Frame Fill Color" ), QgsLayoutItem::UndoMapGridFrameFill2Color );
mMapGrid->setFrameFillColor2( newColor );
mMap->update();
mMap->endCommand();
Expand All @@ -939,7 +939,7 @@ void QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged( const QStr
return;
}

mMap->beginCommand( tr( "Changed grid frame style" ) );
mMap->beginCommand( tr( "Change Frame Style" ) );
if ( text == tr( "Zebra" ) )
{
mMapGrid->setFrameStyle( QgsLayoutItemMapGrid::Zebra );
Expand Down Expand Up @@ -982,7 +982,7 @@ void QgsLayoutMapGridWidget::mMapGridUnitComboBox_currentIndexChanged( const QSt
return;
}

mMap->beginCommand( tr( "Changed grid unit" ) );
mMap->beginCommand( tr( "Change Grid Unit" ) );
if ( text == tr( "Map unit" ) )
{
mMapGrid->setUnits( QgsLayoutItemMapGrid::MapUnit );
Expand All @@ -1005,7 +1005,7 @@ void QgsLayoutMapGridWidget::mGridBlendComboBox_currentIndexChanged( int index )
Q_UNUSED( index );
if ( mMapGrid )
{
mMap->beginCommand( tr( "Grid blend mode changed" ) );
mMap->beginCommand( tr( "Change Grid Blend Mode" ) );
mMapGrid->setBlendMode( mGridBlendComboBox->blendMode() );
mMap->update();
mMap->endCommand();
Expand All @@ -1020,7 +1020,7 @@ void QgsLayoutMapGridWidget::mGridTypeComboBox_currentIndexChanged( const QStrin
return;
}

mMap->beginCommand( tr( "Grid type changed" ) );
mMap->beginCommand( tr( "Change Grid Type" ) );
if ( text == tr( "Cross" ) )
{
mMapGrid->setStyle( QgsLayoutItemMapGrid::Cross );
Expand Down Expand Up @@ -1088,7 +1088,7 @@ void QgsLayoutMapGridWidget::mMapGridCRSButton_clicked()

if ( crsDialog.exec() == QDialog::Accepted )
{
mMap->beginCommand( tr( "Grid CRS changed" ) );
mMap->beginCommand( tr( "Change Grid CRS" ) );
mMapGrid->setCrs( crsDialog.crs() );
mMap->updateBoundingRect();
mMapGridCRSButton->setText( crsDialog.crs().authid() );
Expand All @@ -1103,7 +1103,7 @@ void QgsLayoutMapGridWidget::mDrawAnnotationGroupBox_toggled( bool state )
return;
}

mMap->beginCommand( tr( "Annotation toggled" ) );
mMap->beginCommand( tr( "Toggle Annotations" ) );
mMapGrid->setAnnotationEnabled( state );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -1125,7 +1125,7 @@ void QgsLayoutMapGridWidget::mAnnotationFormatButton_clicked()
if ( exprDlg.exec() == QDialog::Accepted )
{
QString expression = exprDlg.expressionText();
mMap->beginCommand( tr( "Annotation format changed" ) );
mMap->beginCommand( tr( "Change Annotation Format" ) );
mMapGrid->setAnnotationExpression( expression );
mMap->updateBoundingRect();
mMap->update();
Expand Down Expand Up @@ -1200,7 +1200,7 @@ void QgsLayoutMapGridWidget::mDistanceToMapFrameSpinBox_valueChanged( double d )
return;
}

mMap->beginCommand( tr( "Annotation distance changed" ), QgsLayoutItem::UndoMapAnnotationDistance );
mMap->beginCommand( tr( "Change Annotation Distance" ), QgsLayoutItem::UndoMapAnnotationDistance );
mMapGrid->setAnnotationFrameDistance( d );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -1214,7 +1214,7 @@ void QgsLayoutMapGridWidget::annotationFontChanged()
return;
}

mMap->beginCommand( tr( "Annotation font changed" ) );
mMap->beginCommand( tr( "Change Annotation Font" ) );
mMapGrid->setAnnotationFont( mAnnotationFontButton->currentFont() );
mMap->updateBoundingRect();
mMap->update();
Expand All @@ -1228,7 +1228,7 @@ void QgsLayoutMapGridWidget::mAnnotationFontColorButton_colorChanged( const QCol
return;
}

mMap->beginCommand( tr( "Annotation color changed" ), QgsLayoutItem::UndoMapGridAnnotationFontColor );
mMap->beginCommand( tr( "Change Annotation Color" ), QgsLayoutItem::UndoMapGridAnnotationFontColor );
mMapGrid->setAnnotationFontColor( color );
mMap->update();
mMap->endCommand();
Expand All @@ -1241,7 +1241,7 @@ void QgsLayoutMapGridWidget::mAnnotationFormatComboBox_currentIndexChanged( int
return;
}

mMap->beginCommand( tr( "Annotation format changed" ) );
mMap->beginCommand( tr( "Change Annotation Format" ) );

mMapGrid->setAnnotationFormat( ( QgsLayoutItemMapGrid::AnnotationFormat )mAnnotationFormatComboBox->itemData( index ).toInt() );
mAnnotationFormatButton->setEnabled( mMapGrid->annotationFormat() == QgsLayoutItemMapGrid::CustomFormat );
Expand All @@ -1257,7 +1257,7 @@ void QgsLayoutMapGridWidget::mCoordinatePrecisionSpinBox_valueChanged( int value
{
return;
}
mMap->beginCommand( tr( "Changed annotation precision" ) );
mMap->beginCommand( tr( "Change Annotation Precision" ) );
mMapGrid->setAnnotationPrecision( value );
mMap->updateBoundingRect();
mMap->update();
Expand Down

0 comments on commit cef5dbc

Please sign in to comment.