Skip to content

Commit

Permalink
Update frame widgets if the multiframe object has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 30, 2012
1 parent 2e6ecbc commit eb08414
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/app/composer/qgscomposerhtmlwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposerhtml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -111,6 +112,7 @@ void QgsComposerHtml::addFrame( QgsComposerFrame* frame )
if ( mComposition )
{
mComposition->addComposerHtmlFrame( this, frame );
mComposition->pushAddRemoveCommand( frame, tr( "HTML frame added" ) );
}
}

Expand Down
1 change: 1 addition & 0 deletions src/core/composer/qgscomposermultiframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void QgsComposerMultiFrame::setResizeMode( ResizeMode mode )
{
mResizeMode = mode;
recalculateFrameSizes();
emit changed();
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/core/composer/qgscomposermultiframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class QgsComposerMultiFrame: public QObject

private:
QgsComposerMultiFrame(); //forbidden

signals:
void changed();
};

#endif // QGSCOMPOSERMULTIFRAME_H
2 changes: 0 additions & 2 deletions src/gui/qgscomposerview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eb08414

Please sign in to comment.