Fix build errors with Sketcher, Support of workbenches with delayed retrieval of class name

This commit is contained in:
wmayer
2012-03-22 19:59:50 +01:00
parent ac75725737
commit 723d6cde00
4 changed files with 15 additions and 8 deletions

View File

@@ -947,6 +947,13 @@ bool Application::activateWorkbench(const char* name)
// import the matching module first
Py::Callable activate(handler.getAttr(std::string("Initialize")));
activate.apply(args);
// Dependent on the implementation of a workbench handler the type
// can be defined after the call of Initialize()
if (type.empty()) {
Py::String result(method.apply(args));
type = result.as_std_string();
}
}
// does the Python workbench handler have changed the workbench?