Drag&Drop: Tree is responsible for undo/redo
The user expects to undo the drag and drop action with a single click (as it happens with a single drag&drop action). Hence the command must be handled by the tree, not the viewproviders.
This commit is contained in:
@@ -94,11 +94,9 @@ bool ViewProviderGroupExtension::extensionCanDropObject(App::DocumentObject* obj
|
||||
|
||||
void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj) {
|
||||
|
||||
// Open command
|
||||
App::DocumentObject* grp = static_cast<App::DocumentObject*>(getExtendedViewProvider()->getObject());
|
||||
App::Document* doc = grp->getDocument();
|
||||
Gui::Document* gui = Gui::Application::Instance->getDocument(doc);
|
||||
gui->openCommand("Move object");
|
||||
|
||||
// build Python command for execution
|
||||
QString cmd;
|
||||
@@ -109,8 +107,6 @@ void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj) {
|
||||
.arg(QString::fromLatin1(obj->getNameInDocument()));
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::App, cmd.toUtf8());
|
||||
|
||||
gui->commitCommand();
|
||||
}
|
||||
|
||||
std::vector< App::DocumentObject* > ViewProviderGroupExtension::extensionClaimChildren(void) const {
|
||||
|
||||
Reference in New Issue
Block a user