+ fix inconsistency problem after undo/redo
This commit is contained in:
parent
2ead6f9bcf
commit
62de0655d7
|
@ -24,6 +24,7 @@
|
|||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <boost/bind.hpp>
|
||||
#endif
|
||||
|
||||
#include "TaskDlgEditSketch.h"
|
||||
|
@ -46,16 +47,33 @@ TaskDlgEditSketch::TaskDlgEditSketch(ViewProviderSketch *sketchView)
|
|||
Elements = new TaskSketcherElements(sketchView);
|
||||
General = new TaskSketcherGeneral(sketchView);
|
||||
Messages = new TaskSketcherMessages(sketchView);
|
||||
|
||||
|
||||
Content.push_back(Messages);
|
||||
Content.push_back(General);
|
||||
Content.push_back(Constraints);
|
||||
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()
|
||||
{
|
||||
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 ===============================================================
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
#include "TaskSketcherElements.h"
|
||||
#include "TaskSketcherGeneral.h"
|
||||
#include "TaskSketcherMessages.h"
|
||||
#include <boost/signals.hpp>
|
||||
|
||||
typedef boost::signals::connection Connection;
|
||||
|
||||
namespace SketcherGui {
|
||||
|
||||
|
@ -65,11 +68,17 @@ public:
|
|||
{ return QDialogButtonBox::Close|QDialogButtonBox::Help; }
|
||||
|
||||
protected:
|
||||
ViewProviderSketch *sketchView;
|
||||
void slotUndoDocument(const App::Document&);
|
||||
void slotRedoDocument(const App::Document&);
|
||||
|
||||
protected:
|
||||
ViewProviderSketch *sketchView;
|
||||
TaskSketcherConstrains *Constraints;
|
||||
TaskSketcherElements *Elements;
|
||||
TaskSketcherElements *Elements;
|
||||
TaskSketcherGeneral *General;
|
||||
TaskSketcherMessages *Messages;
|
||||
Connection connectUndoDocument;
|
||||
Connection connectRedoDocument;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user