Skip to content
Permalink
Browse files

Update frame widgets if the multiframe object has changed

  • Loading branch information
mhugent committed Jul 30, 2012
1 parent 2e6ecbc commit eb0841480e3027d25cdb7b8f3e113e6b2b5ac12e
@@ -7,8 +7,17 @@
QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml* html, QgsComposerFrame* frame ): mHtml( html ), mFrame( frame )
{
setupUi( this );

blockSignals( true );
mResizeModeComboBox->addItem( tr( "Use existing frames" ), QgsComposerMultiFrame::UseExistingFrames );
mResizeModeComboBox->addItem( tr( "Extend to next page" ), QgsComposerMultiFrame::ExtendToNextPage );
blockSignals( false );
setGuiElementValues();

if ( mHtml )
{
QObject::connect( mHtml, SIGNAL( changed() ), this, SLOT( setGuiElementValues() ) );
}

//embed widget for general options
if ( mFrame )
@@ -65,6 +65,7 @@ void QgsComposerHtml::setUrl( const QUrl& url )
mSize.setWidth( contentsSize.width() / mHtmlUnitsToMM );
mSize.setHeight( contentsSize.height() / mHtmlUnitsToMM );
recalculateFrameSizes();
emit changed();
}

void QgsComposerHtml::frameLoaded( bool ok )
@@ -111,6 +112,7 @@ void QgsComposerHtml::addFrame( QgsComposerFrame* frame )
if ( mComposition )
{
mComposition->addComposerHtmlFrame( this, frame );
mComposition->pushAddRemoveCommand( frame, tr( "HTML frame added" ) );
}
}

@@ -35,6 +35,7 @@ void QgsComposerMultiFrame::setResizeMode( ResizeMode mode )
{
mResizeMode = mode;
recalculateFrameSizes();
emit changed();
}
}

@@ -70,6 +70,9 @@ class QgsComposerMultiFrame: public QObject

private:
QgsComposerMultiFrame(); //forbidden

signals:
void changed();
};

#endif // QGSCOMPOSERMULTIFRAME_H
@@ -324,12 +324,10 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e )
{
QgsComposerHtml* composerHtml = new QgsComposerHtml( composition(), mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(),
mRubberBandItem->rect().width(), mRubberBandItem->rect().height() );
//composition()->addComposerHtml( composerHtml );
scene()->removeItem( mRubberBandItem );
delete mRubberBandItem;
mRubberBandItem = 0;
emit actionFinished();
//composition()->pushAddRemoveCommand...
}
default:
break;

0 comments on commit eb08414

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