Skip to content

Commit 5c240bc

Browse files
committedMay 5, 2013
Make sure print as raster checkbox is updated after blend mode warning
1 parent a3573ce commit 5c240bc

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed
 

‎src/app/composer/qgscomposer.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
330330

331331
QgsCompositionWidget* compositionWidget = new QgsCompositionWidget( mGeneralDock, mComposition );
332332
connect( mComposition, SIGNAL( paperSizeChanged() ), compositionWidget, SLOT( displayCompositionWidthHeight() ) );
333+
connect( this, SIGNAL( printAsRasterChanged( bool ) ), compositionWidget, SLOT( setPrintAsRasterCheckBox( bool ) ) );
333334
mGeneralDock->setWidget( compositionWidget );
334335

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

18231825
//read and restore all the items
@@ -2087,14 +2089,16 @@ void QgsComposer::showBlendModePrintingWarning()
20872089
m->setCheckBoxVisible( true );
20882090
m->showMessage( true );
20892091

2090-
// also need to make sure composer print as raster checkbox is updated
20912092
if ( m->checkBoxState() == Qt::Checked )
20922093
{
20932094
mComposition->setPrintAsRaster( true );
2095+
//make sure print as raster checkbox is updated
2096+
emit printAsRasterChanged( true );
20942097
}
20952098
else
20962099
{
20972100
mComposition->setPrintAsRaster( false );
2101+
emit printAsRasterChanged( false );
20982102
}
20992103

21002104
delete m;

‎src/app/composer/qgscomposer.h

+3
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
397397
//! @note added in 1.9
398398
QMenu* mHelpMenu;
399399

400+
signals:
401+
void printAsRasterChanged( bool state );
402+
400403
private slots:
401404

402405
//! Populate Print Composers menu from main app's

‎src/app/composer/qgscompositionwidget.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,13 @@ void QgsCompositionWidget::displayCompositionWidthHeight()
377377
}
378378
}
379379

380+
void QgsCompositionWidget::setPrintAsRasterCheckBox( bool state )
381+
{
382+
mPrintAsRasterGroupCheckBox->blockSignals( true );
383+
mPrintAsRasterGroupCheckBox->setChecked( state );
384+
mPrintAsRasterGroupCheckBox->blockSignals( false );
385+
}
386+
380387
void QgsCompositionWidget::displaySnapingSettings()
381388
{
382389
if ( !mComposition )

‎src/app/composer/qgscompositionwidget.h

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase
6262

6363
/**Sets GUI elements to width/height from composition*/
6464
void displayCompositionWidthHeight();
65+
/**Sets Print as raster checkbox value*/
66+
void setPrintAsRasterCheckBox( bool state );
6567

6668
private:
6769
QgsComposition* mComposition;

0 commit comments

Comments
 (0)
Please sign in to comment.