Skip to content

Commit

Permalink
Tweak section descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 6, 2018
1 parent 015e754 commit 1ef87a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/app/layout/qgsreportfieldgroupsectionwidget.cpp
Expand Up @@ -73,7 +73,7 @@ void QgsReportSectionFieldGroupWidget::editHeader()
{ {
mSection->header()->reportContext().setLayer( mSection->layer() ); mSection->header()->reportContext().setLayer( mSection->layer() );
mDesigner->setCurrentLayout( mSection->header() ); mDesigner->setCurrentLayout( mSection->header() );
mDesigner->setSectionTitle( tr( "%1 Header" ).arg( mSection->description() ) ); mDesigner->setSectionTitle( tr( "Header: %1" ).arg( mSection->description() ) );
mOrganizer->setEditedSection( mSection ); mOrganizer->setEditedSection( mSection );
} }
} }
Expand All @@ -91,7 +91,7 @@ void QgsReportSectionFieldGroupWidget::editFooter()
{ {
mSection->footer()->reportContext().setLayer( mSection->layer() ); mSection->footer()->reportContext().setLayer( mSection->layer() );
mDesigner->setCurrentLayout( mSection->footer() ); mDesigner->setCurrentLayout( mSection->footer() );
mDesigner->setSectionTitle( tr( "%1 Footer" ).arg( mSection->description() ) ); mDesigner->setSectionTitle( tr( "Footer: %1" ).arg( mSection->description() ) );
mOrganizer->setEditedSection( mSection ); mOrganizer->setEditedSection( mSection );
} }
} }
Expand All @@ -114,7 +114,7 @@ void QgsReportSectionFieldGroupWidget::editBody()
{ {
mSection->body()->reportContext().setLayer( mSection->layer() ); mSection->body()->reportContext().setLayer( mSection->layer() );
mDesigner->setCurrentLayout( mSection->body() ); mDesigner->setCurrentLayout( mSection->body() );
mDesigner->setSectionTitle( tr( "%1 Body" ).arg( mSection->description() ) ); mDesigner->setSectionTitle( tr( "Body: %1" ).arg( mSection->description() ) );
mOrganizer->setEditedSection( mSection ); mOrganizer->setEditedSection( mSection );
} }
} }
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout/qgsreportlayoutsectionwidget.cpp
Expand Up @@ -63,7 +63,7 @@ void QgsReportLayoutSectionWidget::editHeader()
if ( mSection->header() ) if ( mSection->header() )
{ {
mDesigner->setCurrentLayout( mSection->header() ); mDesigner->setCurrentLayout( mSection->header() );
mDesigner->setSectionTitle( tr( "%1 Header" ).arg( mSection->description() ) ); mDesigner->setSectionTitle( tr( "Header: %1" ).arg( mSection->description() ) );
mOrganizer->setEditedSection( mSection ); mOrganizer->setEditedSection( mSection );
} }
} }
Expand All @@ -80,7 +80,7 @@ void QgsReportLayoutSectionWidget::editFooter()
if ( mSection->footer() ) if ( mSection->footer() )
{ {
mDesigner->setCurrentLayout( mSection->footer() ); mDesigner->setCurrentLayout( mSection->footer() );
mDesigner->setSectionTitle( tr( "%1 Footer" ).arg( mSection->description() ) ); mDesigner->setSectionTitle( tr( "Footer: %1" ).arg( mSection->description() ) );
mOrganizer->setEditedSection( mSection ); mOrganizer->setEditedSection( mSection );
} }
} }
Expand All @@ -100,6 +100,6 @@ void QgsReportLayoutSectionWidget::editBody()
} }


mDesigner->setCurrentLayout( mSection->body() ); mDesigner->setCurrentLayout( mSection->body() );
mDesigner->setSectionTitle( tr( "%1 Body" ).arg( mSection->description() ) ); mDesigner->setSectionTitle( tr( "Body: %1" ).arg( mSection->description() ) );
mOrganizer->setEditedSection( mSection ); mOrganizer->setEditedSection( mSection );
} }
5 changes: 4 additions & 1 deletion src/core/layout/qgsreportsectionfieldgroup.cpp
Expand Up @@ -27,7 +27,10 @@ QgsReportSectionFieldGroup::QgsReportSectionFieldGroup( QgsAbstractReportSection


QString QgsReportSectionFieldGroup::description() const QString QgsReportSectionFieldGroup::description() const
{ {
return QObject::tr( "Group: %1" ).arg( mField ); if ( mCoverageLayer.get() )
return QObject::tr( "Group: %1 - %2" ).arg( mCoverageLayer->name(), mField );
else
return QObject::tr( "Group" );
} }


QIcon QgsReportSectionFieldGroup::icon() const QIcon QgsReportSectionFieldGroup::icon() const
Expand Down

0 comments on commit 1ef87a4

Please sign in to comment.