Skip to content

Commit

Permalink
[composer] Update number of pages in gui whenever number of pages is …
Browse files Browse the repository at this point in the history
…changed by multi frame items (sponsored by City of Uster, Switzerland)
  • Loading branch information
nyalldawson committed Apr 28, 2014
1 parent 8b9c9c4 commit 94a547e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/composer/qgscompositionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget* parent, QgsComposition* c )
if ( mComposition )
{
mNumPagesSpinBox->setValue( mComposition->numPages() );
connect( mComposition, SIGNAL( nPagesChanged() ), this, SLOT( setNumberPages() ) );

updatePageStyle();

Expand Down Expand Up @@ -431,6 +432,18 @@ void QgsCompositionWidget::setPrintAsRasterCheckBox( bool state )
mPrintAsRasterCheckBox->blockSignals( false );
}

void QgsCompositionWidget::setNumberPages()
{
if ( !mComposition )
{
return;
}

mNumPagesSpinBox->blockSignals( true );
mNumPagesSpinBox->setValue( mComposition->numPages() );
mNumPagesSpinBox->blockSignals( false );
}

void QgsCompositionWidget::displaySnapingSettings()
{
if ( !mComposition )
Expand Down
2 changes: 2 additions & 0 deletions src/app/composer/qgscompositionwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase
void displayCompositionWidthHeight();
/**Sets Print as raster checkbox value*/
void setPrintAsRasterCheckBox( bool state );
/**Sets number of pages spin box value*/
void setNumberPages();

signals:
/**Is emitted when page orientation changes*/
Expand Down

0 comments on commit 94a547e

Please sign in to comment.