+ fix inconsistency problem after undo/redo
This commit is contained in:
parent
2ead6f9bcf
commit
62de0655d7
|
@ -24,6 +24,7 @@
|
||||||
#include "PreCompiled.h"
|
#include "PreCompiled.h"
|
||||||
|
|
||||||
#ifndef _PreComp_
|
#ifndef _PreComp_
|
||||||
|
# include <boost/bind.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "TaskDlgEditSketch.h"
|
#include "TaskDlgEditSketch.h"
|
||||||
|
@ -51,11 +52,28 @@ TaskDlgEditSketch::TaskDlgEditSketch(ViewProviderSketch *sketchView)
|
||||||
Content.push_back(General);
|
Content.push_back(General);
|
||||||
Content.push_back(Constraints);
|
Content.push_back(Constraints);
|
||||||
Content.push_back(Elements);
|
Content.push_back(Elements);
|
||||||
|
|
||||||
|
App::Document* document = sketchView->getObject()->getDocument();
|
||||||
|
connectUndoDocument =
|
||||||
|
document->signalUndo.connect(boost::bind(&TaskDlgEditSketch::slotUndoDocument, this, _1));
|
||||||
|
connectRedoDocument =
|
||||||
|
document->signalRedo.connect(boost::bind(&TaskDlgEditSketch::slotRedoDocument, this, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskDlgEditSketch::~TaskDlgEditSketch()
|
TaskDlgEditSketch::~TaskDlgEditSketch()
|
||||||
{
|
{
|
||||||
|
connectUndoDocument.disconnect();
|
||||||
|
connectRedoDocument.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TaskDlgEditSketch::slotUndoDocument(const App::Document& doc)
|
||||||
|
{
|
||||||
|
const_cast<App::Document&>(doc).recomputeFeature(sketchView->getObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
void TaskDlgEditSketch::slotRedoDocument(const App::Document& doc)
|
||||||
|
{
|
||||||
|
const_cast<App::Document&>(doc).recomputeFeature(sketchView->getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
//==== calls from the TaskView ===============================================================
|
//==== calls from the TaskView ===============================================================
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
#include "TaskSketcherElements.h"
|
#include "TaskSketcherElements.h"
|
||||||
#include "TaskSketcherGeneral.h"
|
#include "TaskSketcherGeneral.h"
|
||||||
#include "TaskSketcherMessages.h"
|
#include "TaskSketcherMessages.h"
|
||||||
|
#include <boost/signals.hpp>
|
||||||
|
|
||||||
|
typedef boost::signals::connection Connection;
|
||||||
|
|
||||||
namespace SketcherGui {
|
namespace SketcherGui {
|
||||||
|
|
||||||
|
@ -65,11 +68,17 @@ public:
|
||||||
{ return QDialogButtonBox::Close|QDialogButtonBox::Help; }
|
{ return QDialogButtonBox::Close|QDialogButtonBox::Help; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ViewProviderSketch *sketchView;
|
void slotUndoDocument(const App::Document&);
|
||||||
|
void slotRedoDocument(const App::Document&);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
ViewProviderSketch *sketchView;
|
||||||
TaskSketcherConstrains *Constraints;
|
TaskSketcherConstrains *Constraints;
|
||||||
TaskSketcherElements *Elements;
|
TaskSketcherElements *Elements;
|
||||||
TaskSketcherGeneral *General;
|
TaskSketcherGeneral *General;
|
||||||
TaskSketcherMessages *Messages;
|
TaskSketcherMessages *Messages;
|
||||||
|
Connection connectUndoDocument;
|
||||||
|
Connection connectRedoDocument;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user