Skip to content
Permalink
Browse files

Make sure print as raster checkbox is updated after blend mode warning

  • Loading branch information
nyalldawson committed May 5, 2013
1 parent a3573ce commit 5c240bccf71722ec255270cb92fe493720a1e31a
@@ -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
@@ -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
@@ -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;
@@ -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
@@ -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 )
@@ -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;

0 comments on commit 5c240bc

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