diff --git a/src/Mod/Drawing/Gui/DrawingView.cpp b/src/Mod/Drawing/Gui/DrawingView.cpp index b5f0166d5..3cd5c5e61 100644 --- a/src/Mod/Drawing/Gui/DrawingView.cpp +++ b/src/Mod/Drawing/Gui/DrawingView.cpp @@ -327,6 +327,20 @@ bool DrawingView::onMsg(const char* pMsg, const char** ppReturn) return true; } } + else if(strcmp("Undo",pMsg) == 0 ) { + Gui::Document *doc = getGuiDocument(); + if (doc) { + doc->undo(1); + return true; + } + } + else if(strcmp("Redo",pMsg) == 0 ) { + Gui::Document *doc = getGuiDocument(); + if (doc) { + doc->redo(1); + return true; + } + } return false; } @@ -338,6 +352,14 @@ bool DrawingView::onHasMsg(const char* pMsg) const return getGuiDocument() != 0; else if (strcmp("SaveAs",pMsg) == 0) return getGuiDocument() != 0; + else if (strcmp("Undo",pMsg) == 0) { + App::Document* doc = getAppDocument(); + return doc && doc->getAvailableUndos() > 0; + } + else if (strcmp("Redo",pMsg) == 0) { + App::Document* doc = getAppDocument(); + return doc && doc->getAvailableRedos() > 0; + } else if (strcmp("Print",pMsg) == 0) return true; else if (strcmp("PrintPreview",pMsg) == 0)