Skip to content
Permalink
Browse files

Disable edit section buttons in reports if the section is disabled

  • Loading branch information
nyalldawson committed Feb 3, 2018
1 parent be6674b commit 213d4b7cbcdb5441f665587ae5d6a77c9506d031
@@ -39,12 +39,15 @@ QgsReportSectionFieldGroupWidget::QgsReportSectionFieldGroupWidget( QgsReportOrg
mSortAscendingCheckBox->setChecked( section->sortAscending() );

mCheckShowHeader->setChecked( section->headerEnabled() );
mButtonEditHeader->setChecked( section->headerEnabled() );
mCheckHeaderAlwaysVisible->setChecked( section->headerVisibility() == QgsReportSectionFieldGroup::AlwaysInclude );
mCheckHeaderAlwaysVisible->setEnabled( section->headerEnabled() );
mCheckShowFooter->setChecked( section->footerEnabled() );
mButtonEditFooter->setEnabled( section->footerEnabled() );
mCheckFooterAlwaysVisible->setChecked( section->headerVisibility() == QgsReportSectionFieldGroup::AlwaysInclude );
mCheckFooterAlwaysVisible->setEnabled( section->footerEnabled() );
mCheckShowBody->setChecked( section->bodyEnabled() );
mButtonEditBody->setEnabled( section->bodyEnabled() );

connect( mSortAscendingCheckBox, &QCheckBox::toggled, this, &QgsReportSectionFieldGroupWidget::sortAscendingToggled );
connect( mLayerComboBox, &QgsMapLayerComboBox::layerChanged, this, &QgsReportSectionFieldGroupWidget::setLayer );
@@ -54,6 +57,10 @@ QgsReportSectionFieldGroupWidget::QgsReportSectionFieldGroupWidget( QgsReportOrg
connect( mCheckShowFooter, &QCheckBox::toggled, this, &QgsReportSectionFieldGroupWidget::toggleFooter );
connect( mCheckFooterAlwaysVisible, &QCheckBox::toggled, this, &QgsReportSectionFieldGroupWidget::toggleFooterAlwaysVisible );
connect( mCheckShowBody, &QCheckBox::toggled, this, &QgsReportSectionFieldGroupWidget::toggleBody );

connect( mCheckShowHeader, &QCheckBox::toggled, mButtonEditHeader, &QPushButton::setEnabled );
connect( mCheckShowFooter, &QCheckBox::toggled, mButtonEditFooter, &QPushButton::setEnabled );
connect( mCheckShowBody, &QCheckBox::toggled, mButtonEditBody, &QPushButton::setEnabled );
}

void QgsReportSectionFieldGroupWidget::toggleHeader( bool enabled )
@@ -33,12 +33,19 @@ QgsReportLayoutSectionWidget::QgsReportLayoutSectionWidget( QgsReportOrganizerWi
connect( mButtonEditFooter, &QPushButton::clicked, this, &QgsReportLayoutSectionWidget::editFooter );

mCheckShowHeader->setChecked( section->headerEnabled() );
mButtonEditHeader->setEnabled( section->headerEnabled() );
mCheckShowFooter->setChecked( section->footerEnabled() );
mButtonEditFooter->setEnabled( section->footerEnabled() );
mCheckShowBody->setChecked( section->bodyEnabled() );
mButtonEditBody->setEnabled( section->bodyEnabled() );

connect( mCheckShowHeader, &QCheckBox::toggled, this, &QgsReportLayoutSectionWidget::toggleHeader );
connect( mCheckShowFooter, &QCheckBox::toggled, this, &QgsReportLayoutSectionWidget::toggleFooter );
connect( mCheckShowBody, &QCheckBox::toggled, this, &QgsReportLayoutSectionWidget::toggleBody );

connect( mCheckShowHeader, &QCheckBox::toggled, mButtonEditHeader, &QPushButton::setEnabled );
connect( mCheckShowFooter, &QCheckBox::toggled, mButtonEditFooter, &QPushButton::setEnabled );
connect( mCheckShowBody, &QCheckBox::toggled, mButtonEditBody, &QPushButton::setEnabled );
}

void QgsReportLayoutSectionWidget::toggleHeader( bool enabled )
@@ -32,10 +32,15 @@ QgsReportSectionWidget::QgsReportSectionWidget( QgsReportOrganizerWidget *parent
connect( mButtonEditFooter, &QPushButton::clicked, this, &QgsReportSectionWidget::editFooter );

mCheckShowHeader->setChecked( section->headerEnabled() );
mButtonEditHeader->setEnabled( section->headerEnabled() );
mCheckShowFooter->setChecked( section->footerEnabled() );
mButtonEditFooter->setEnabled( section->footerEnabled() );

connect( mCheckShowHeader, &QCheckBox::toggled, this, &QgsReportSectionWidget::toggleHeader );
connect( mCheckShowFooter, &QCheckBox::toggled, this, &QgsReportSectionWidget::toggleFooter );

connect( mCheckShowHeader, &QCheckBox::toggled, mButtonEditHeader, &QPushButton::setEnabled );
connect( mCheckShowFooter, &QCheckBox::toggled, mButtonEditFooter, &QPushButton::setEnabled );
}

void QgsReportSectionWidget::toggleHeader( bool enabled )

0 comments on commit 213d4b7

Please sign in to comment.
You can’t perform that action at this time.