Skip to content

Commit

Permalink
Extensions: Group fix for python
Browse files Browse the repository at this point in the history
  • Loading branch information
ickby authored and wwmayer committed Dec 4, 2016
1 parent 19e7088 commit 1787a4f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App/GroupExtension.h
Expand Up @@ -117,7 +117,7 @@ class GroupExtensionPythonT : public ExtensionT {
EXTENSION_PROXY_ONEARG(allowObject, pyobj);

if(result.isNone())
ExtensionT::allowObject(obj);
return ExtensionT::allowObject(obj);

if(result.isBoolean())
return result.isTrue();
Expand Down
5 changes: 4 additions & 1 deletion src/Gui/ViewProvider.cpp
Expand Up @@ -580,9 +580,12 @@ void ViewProvider::dragObject(App::DocumentObject* obj) {
bool ViewProvider::canDropObject(App::DocumentObject* obj) const {

auto vector = getExtensionsDerivedFromType<Gui::ViewProviderExtension>();
for(Gui::ViewProviderExtension* ext : vector)
Base::Console().Message("Check extensions for drop\n");
for(Gui::ViewProviderExtension* ext : vector){
Base::Console().Message("Check extensions %s\n", ext->name());
if(ext->extensionCanDropObject(obj))
return true;
}

return false;
}
Expand Down
3 changes: 3 additions & 0 deletions src/Gui/ViewProviderGroupExtension.cpp
Expand Up @@ -36,6 +36,7 @@
#include <App/DocumentObject.h>
#include <App/GroupExtension.h>
#include <App/Expression.h>
#include <Base/Console.h>
#include <QMessageBox>

using namespace Gui;
Expand Down Expand Up @@ -76,6 +77,8 @@ bool ViewProviderGroupExtension::extensionCanDropObjects() const {

bool ViewProviderGroupExtension::extensionCanDropObject(App::DocumentObject* obj) const {

Base::Console().Message("Check ViewProviderGroupExtension");

auto* group = getExtendedViewProvider()->getObject()->getExtensionByType<App::GroupExtension>();

//we cannot drop thing of this group into it again
Expand Down

0 comments on commit 1787a4f

Please sign in to comment.