mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
[copyright decorator] improve default label string
- Instead of using (c) QGIS YYYY, rely on the project metadata to insert the author name. It's a more useful default string, and might help avoid a misconception about ownership of maps produced in QGIS.
This commit is contained in:
parent
2b8519c017
commit
3f153e91b8
@ -59,14 +59,11 @@ void QgsDecorationCopyright::projectRead()
|
||||
{
|
||||
QgsDecorationItem::projectRead();
|
||||
|
||||
QDate now = QDate::currentDate();
|
||||
QString defString = "© QGIS " + now.toString( QStringLiteral( "yyyy" ) );
|
||||
|
||||
// there is no font setting in the UI, so just use the Qt/QGIS default font (what mQFont gets when created)
|
||||
// mQFont.setFamily( QgsProject::instance()->readEntry( "CopyrightLabel", "/FontName", "Sans Serif" ) );
|
||||
// mQFont.setPointSize( QgsProject::instance()->readNumEntry( "CopyrightLabel", "/FontSize", 9 ) );
|
||||
|
||||
mLabelText = QgsProject::instance()->readEntry( mNameConfig, QStringLiteral( "/Label" ), defString );
|
||||
mLabelText = QgsProject::instance()->readEntry( mNameConfig, QStringLiteral( "/Label" ), QString() );
|
||||
mMarginHorizontal = QgsProject::instance()->readNumEntry( mNameConfig, QStringLiteral( "/MarginH" ), 0 );
|
||||
mMarginVertical = QgsProject::instance()->readNumEntry( mNameConfig, QStringLiteral( "/MarginV" ), 0 );
|
||||
mColor = QgsSymbolLayerUtils::decodeColor( QgsProject::instance()->readEntry( mNameConfig, QStringLiteral( "/Color" ), QStringLiteral( "#000000" ) ) );
|
||||
|
@ -46,8 +46,19 @@ QgsDecorationCopyrightDialog::QgsDecorationCopyrightDialog( QgsDecorationCopyrig
|
||||
connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationCopyrightDialog::apply );
|
||||
|
||||
grpEnable->setChecked( mDeco.enabled() );
|
||||
// text
|
||||
txtCopyrightText->setPlainText( mDeco.mLabelText );
|
||||
|
||||
// label text
|
||||
if ( !mDeco.enabled() && mDeco.mLabelText.isEmpty() )
|
||||
{
|
||||
QDate now = QDate::currentDate();
|
||||
QString defaultString = QString( "%1 %2 %3" ).arg( QChar( 0x00A9 ), QgsProject::instance()->metadata().author(), now.toString( QStringLiteral( "yyyy" ) ) );
|
||||
txtCopyrightText->setPlainText( defaultString );
|
||||
}
|
||||
else
|
||||
{
|
||||
txtCopyrightText->setPlainText( mDeco.mLabelText );
|
||||
}
|
||||
|
||||
// placement
|
||||
cboPlacement->addItem( tr( "Top left" ), QgsDecorationItem::TopLeft );
|
||||
cboPlacement->addItem( tr( "Top right" ), QgsDecorationItem::TopRight );
|
||||
|
Loading…
x
Reference in New Issue
Block a user