Skip to content

Commit

Permalink
Make sure print as raster checkbox is updated after blend mode warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 5, 2013
1 parent a3573ce commit 5c240bc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -330,6 +330,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )

QgsCompositionWidget* compositionWidget = new QgsCompositionWidget( mGeneralDock, mComposition );
connect( mComposition, SIGNAL( paperSizeChanged() ), compositionWidget, SLOT( displayCompositionWidthHeight() ) );
connect( this, SIGNAL( printAsRasterChanged( bool ) ), compositionWidget, SLOT( setPrintAsRasterCheckBox( bool ) ) );
mGeneralDock->setWidget( compositionWidget );

//undo widget
Expand Down Expand Up @@ -1818,6 +1819,7 @@ void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument&
//create compositionwidget
QgsCompositionWidget* compositionWidget = new QgsCompositionWidget( mGeneralDock, mComposition );
QObject::connect( mComposition, SIGNAL( paperSizeChanged() ), compositionWidget, SLOT( displayCompositionWidthHeight() ) );
QObject::connect( this, SIGNAL( printAsRasterChanged( bool ) ), compositionWidget, SLOT( setPrintAsRasterCheckBox( bool ) ) );
mGeneralDock->setWidget( compositionWidget );

//read and restore all the items
Expand Down Expand Up @@ -2087,14 +2089,16 @@ void QgsComposer::showBlendModePrintingWarning()
m->setCheckBoxVisible( true );
m->showMessage( true );

// also need to make sure composer print as raster checkbox is updated
if ( m->checkBoxState() == Qt::Checked )
{
mComposition->setPrintAsRaster( true );
//make sure print as raster checkbox is updated
emit printAsRasterChanged( true );
}
else
{
mComposition->setPrintAsRaster( false );
emit printAsRasterChanged( false );
}

delete m;
Expand Down
3 changes: 3 additions & 0 deletions src/app/composer/qgscomposer.h
Expand Up @@ -397,6 +397,9 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! @note added in 1.9
QMenu* mHelpMenu;

signals:
void printAsRasterChanged( bool state );

private slots:

//! Populate Print Composers menu from main app's
Expand Down
7 changes: 7 additions & 0 deletions src/app/composer/qgscompositionwidget.cpp
Expand Up @@ -377,6 +377,13 @@ void QgsCompositionWidget::displayCompositionWidthHeight()
}
}

void QgsCompositionWidget::setPrintAsRasterCheckBox( bool state )
{
mPrintAsRasterGroupCheckBox->blockSignals( true );
mPrintAsRasterGroupCheckBox->setChecked( state );
mPrintAsRasterGroupCheckBox->blockSignals( false );
}

void QgsCompositionWidget::displaySnapingSettings()
{
if ( !mComposition )
Expand Down
2 changes: 2 additions & 0 deletions src/app/composer/qgscompositionwidget.h
Expand Up @@ -62,6 +62,8 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase

/**Sets GUI elements to width/height from composition*/
void displayCompositionWidthHeight();
/**Sets Print as raster checkbox value*/
void setPrintAsRasterCheckBox( bool state );

private:
QgsComposition* mComposition;
Expand Down

0 comments on commit 5c240bc

Please sign in to comment.