Skip to content
Permalink
Browse files

Mark project dirty in case of composer changes

  • Loading branch information
mhugent committed Jun 18, 2013
1 parent f48aff8 commit da0e4f342aaca22f7b76e6bb7e92355101583dbc
@@ -18,6 +18,7 @@
#include "qgsaddremoveitemcommand.h"
#include "qgscomposeritem.h"
#include "qgscomposition.h"
#include "qgsproject.h"

QgsAddRemoveItemCommand::QgsAddRemoveItemCommand( State s, QgsComposerItem* item, QgsComposition* c, const QString& text, QUndoCommand* parent ):
QUndoCommand( text, parent ), mItem( item ), mComposition( c ), mState( s ), mFirstRun( true )
@@ -72,4 +73,5 @@ void QgsAddRemoveItemCommand::switchState()
emit itemAdded( mItem );
mState = Added;
}
QgsProject::instance()->dirty( true );
}
@@ -18,6 +18,7 @@
#include "qgsaddremovemultiframecommand.h"
#include "qgscomposermultiframe.h"
#include "qgscomposition.h"
#include "qgsproject.h"


QgsAddRemoveMultiFrameCommand::QgsAddRemoveMultiFrameCommand( State s, QgsComposerMultiFrame* multiFrame, QgsComposition* c, const QString& text, QUndoCommand* parent ):
@@ -69,6 +70,7 @@ void QgsAddRemoveMultiFrameCommand::switchState()
mComposition->addMultiFrame( mMultiFrame );
mState = Added;
}
QgsProject::instance()->dirty( true );
}
}

@@ -17,6 +17,7 @@

#include "qgscomposeritemcommand.h"
#include "qgscomposeritem.h"
#include "qgsproject.h"

QgsComposerItemCommand::QgsComposerItemCommand( QgsComposerItem* item, const QString& text, QUndoCommand* parent ):
QUndoCommand( text, parent ), mItem( item ), mFirstRun( true )
@@ -74,6 +75,7 @@ void QgsComposerItemCommand::restoreState( QDomDocument& stateDoc ) const
{
mItem->readXML( stateDoc.documentElement().firstChild().toElement(), stateDoc );
mItem->repaint();
QgsProject::instance()->dirty( true );
}
}

@@ -17,6 +17,7 @@

#include "qgscomposermultiframecommand.h"
#include "qgscomposermultiframe.h"
#include "qgsproject.h"

QgsComposerMultiFrameCommand::QgsComposerMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, QUndoCommand* parent ):
QUndoCommand( text, parent ), mMultiFrame( multiFrame ), mFirstRun( true )
@@ -71,6 +72,7 @@ void QgsComposerMultiFrameCommand::restoreState( QDomDocument& stateDoc )
if ( mMultiFrame )
{
mMultiFrame->readXML( stateDoc.documentElement().firstChild().toElement(), stateDoc );
QgsProject::instance()->dirty( true );
}
}

@@ -34,6 +34,7 @@
#include "qgslogger.h"
#include "qgspaintenginehack.h"
#include "qgspaperitem.h"
#include "qgsproject.h"
#include "qgsgeometry.h"
#include "qgsvectorlayer.h"
#include "qgsvectordataprovider.h"
@@ -1572,6 +1573,7 @@ void QgsComposition::endCommand()
if ( mActiveItemCommand->containsChange() ) //protect against empty commands
{
mUndoStack.push( mActiveItemCommand );
QgsProject::instance()->dirty( true );
}
else
{
@@ -1602,6 +1604,7 @@ void QgsComposition::endMultiFrameCommand()
if ( mActiveMultiFrameCommand->containsChange() )
{
mUndoStack.push( mActiveMultiFrameCommand );
QgsProject::instance()->dirty( true );
}
else
{
@@ -1796,6 +1799,7 @@ void QgsComposition::pushAddRemoveCommand( QgsComposerItem* item, const QString&
QgsAddRemoveItemCommand* c = new QgsAddRemoveItemCommand( state, item, this, text );
connectAddRemoveCommandSignals( c );
undoStack()->push( c );
QgsProject::instance()->dirty( true );
}

void QgsComposition::connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c )

0 comments on commit da0e4f3

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