Merge branch 'master' of ssh://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad
This commit is contained in:
commit
061b1cba54
|
@ -112,8 +112,10 @@ public:
|
|||
boost::signal<void (const Document&)> signalActiveDocument;
|
||||
/// signal on saving Document
|
||||
boost::signal<void (const Document&)> signalSaveDocument;
|
||||
/// signal on starting to restore Document
|
||||
boost::signal<void (const Document&)> signalStartRestoreDocument;
|
||||
/// signal on restoring Document
|
||||
boost::signal<void (const Document&)> signalRestoreDocument;
|
||||
boost::signal<void (const Document&)> signalFinishRestoreDocument;
|
||||
//@}
|
||||
|
||||
|
||||
|
|
|
@ -999,6 +999,8 @@ void Document::restore (void)
|
|||
if (!reader.isValid())
|
||||
throw Base::FileException("Error reading compression file",FileName.getValue());
|
||||
|
||||
GetApplication().signalStartRestoreDocument(*this);
|
||||
|
||||
try {
|
||||
Document::Restore(reader);
|
||||
}
|
||||
|
@ -1019,7 +1021,7 @@ void Document::restore (void)
|
|||
It->second->purgeTouched();
|
||||
}
|
||||
|
||||
GetApplication().signalRestoreDocument(*this);
|
||||
GetApplication().signalFinishRestoreDocument(*this);
|
||||
}
|
||||
|
||||
bool Document::isSaved() const
|
||||
|
|
|
@ -89,7 +89,8 @@ struct DocumentP
|
|||
Connection connectActObject;
|
||||
Connection connectSaveDocument;
|
||||
Connection connectRestDocument;
|
||||
Connection connectLoadDocument;
|
||||
Connection connectStartLoadDocument;
|
||||
Connection connectFinishLoadDocument;
|
||||
};
|
||||
|
||||
} // namespace Gui
|
||||
|
@ -127,8 +128,10 @@ Document::Document(App::Document* pcDocument,Application * app)
|
|||
(boost::bind(&Gui::Document::Save, this, _1));
|
||||
d->connectRestDocument = pcDocument->signalRestoreDocument.connect
|
||||
(boost::bind(&Gui::Document::Restore, this, _1));
|
||||
d->connectLoadDocument = App::GetApplication().signalRestoreDocument.connect
|
||||
(boost::bind(&Gui::Document::slotRestoredDocument, this, _1));
|
||||
d->connectStartLoadDocument = App::GetApplication().signalStartRestoreDocument.connect
|
||||
(boost::bind(&Gui::Document::slotStartRestoreDocument, this, _1));
|
||||
d->connectFinishLoadDocument = App::GetApplication().signalFinishRestoreDocument.connect
|
||||
(boost::bind(&Gui::Document::slotFinishRestoreDocument, this, _1));
|
||||
|
||||
// pointer to the python class
|
||||
// NOTE: As this Python object doesn't get returned to the interpreter we
|
||||
|
@ -154,7 +157,8 @@ Document::~Document()
|
|||
d->connectActObject.disconnect();
|
||||
d->connectSaveDocument.disconnect();
|
||||
d->connectRestDocument.disconnect();
|
||||
d->connectLoadDocument.disconnect();
|
||||
d->connectStartLoadDocument.disconnect();
|
||||
d->connectFinishLoadDocument.disconnect();
|
||||
|
||||
// e.g. if document gets closed from within a Python command
|
||||
d->_isClosing = true;
|
||||
|
@ -668,8 +672,26 @@ void Document::RestoreDocFile(Base::Reader &reader)
|
|||
setModified(false);
|
||||
}
|
||||
|
||||
void Document::slotRestoredDocument(const App::Document&)
|
||||
void Document::slotStartRestoreDocument(const App::Document& doc)
|
||||
{
|
||||
if (d->_pcDocument != &doc)
|
||||
return;
|
||||
// disable this singal while loading a document
|
||||
d->connectActObject.block();
|
||||
}
|
||||
|
||||
void Document::slotFinishRestoreDocument(const App::Document& doc)
|
||||
{
|
||||
if (d->_pcDocument != &doc)
|
||||
return;
|
||||
d->connectActObject.unblock();
|
||||
App::DocumentObject* act = doc.getActiveObject();
|
||||
if (act) {
|
||||
ViewProvider* viewProvider = getViewProvider(act);
|
||||
if (viewProvider && viewProvider->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())) {
|
||||
signalActivatedObject(*(static_cast<ViewProviderDocumentObject*>(viewProvider)));
|
||||
}
|
||||
}
|
||||
// some post-processing of view providers
|
||||
std::map<const App::DocumentObject*,ViewProviderDocumentObject*>::iterator it;
|
||||
for (it = d->_ViewProviderMap.begin(); it != d->_ViewProviderMap.end(); ++it) {
|
||||
|
|
|
@ -68,7 +68,8 @@ protected:
|
|||
void slotChangedObject(const App::DocumentObject&, const App::Property&);
|
||||
void slotRenamedObject(const App::DocumentObject&);
|
||||
void slotActivatedObject(const App::DocumentObject&);
|
||||
void slotRestoredDocument(const App::Document&);
|
||||
void slotStartRestoreDocument(const App::Document&);
|
||||
void slotFinishRestoreDocument(const App::Document&);
|
||||
//@}
|
||||
|
||||
public:
|
||||
|
@ -86,9 +87,9 @@ public:
|
|||
mutable boost::signal<void (const Gui::ViewProviderDocumentObject&)> signalRenamedObject;
|
||||
/// signal on activated Object
|
||||
mutable boost::signal<void (const Gui::ViewProviderDocumentObject&)> signalActivatedObject;
|
||||
/// signal on goes in edti mode
|
||||
/// signal on entering in edit mode
|
||||
mutable boost::signal<void (const Gui::ViewProviderDocumentObject&)> signalInEdit;
|
||||
/// signal on leave edit mode
|
||||
/// signal on leaving edit mode
|
||||
mutable boost::signal<void (const Gui::ViewProviderDocumentObject&)> signalResetEdit;
|
||||
//@}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ class MyForm(QtGui.QDialog,Ui_dialog):
|
|||
"set label \"" + z_axis_label + "\\nin [mm]\" at screen 0.03, screen 0.5 center rotate by 90\n"+
|
||||
"set xtics in nomirror offset character 0,-0.5\n"+
|
||||
"splot \"postprocessing_input.txt\" u " + str(offset_column) + ":" + str(rot_column) + ":" + str(abs_disp_column) + " with pm3d title \"\"\n" +
|
||||
"exit" )
|
||||
"exit" ))
|
||||
|
||||
gnu_plot_input_file.close()
|
||||
os.chdir(str(self.dirname))
|
||||
|
|
Loading…
Reference in New Issue
Block a user