Skip to content

Commit

Permalink
+ make undo/redo accessible from drawing view
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Dec 26, 2014
1 parent 9290274 commit 93e5668
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Mod/Drawing/Gui/DrawingView.cpp
Expand Up @@ -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;
}

Expand All @@ -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)
Expand Down

0 comments on commit 93e5668

Please sign in to comment.