+ fixes #0001667: 'Save file' disabled when viewing a drawing

This commit is contained in:
wmayer 2014-08-11 22:59:16 +02:00
parent 29f3f0cfc2
commit 4ad43e60b0

View File

@ -58,6 +58,7 @@
#include <Base/Stream.h>
#include <Base/gzstream.h>
#include <Base/PyObjectBase.h>
#include <Gui/Document.h>
#include <Gui/FileDialog.h>
#include <Gui/WaitCursor.h>
@ -312,6 +313,20 @@ bool DrawingView::onMsg(const char* pMsg, const char** ppReturn)
viewAll();
return true;
}
else if (strcmp("Save",pMsg) == 0) {
Gui::Document *doc = getGuiDocument();
if (doc) {
doc->save();
return true;
}
}
else if (strcmp("SaveAs",pMsg) == 0) {
Gui::Document *doc = getGuiDocument();
if (doc) {
doc->saveAs();
return true;
}
}
return false;
}
@ -319,6 +334,10 @@ bool DrawingView::onHasMsg(const char* pMsg) const
{
if (strcmp("ViewFit",pMsg) == 0)
return true;
else if (strcmp("Save",pMsg) == 0)
return getGuiDocument() != 0;
else if (strcmp("SaveAs",pMsg) == 0)
return getGuiDocument() != 0;
else if (strcmp("Print",pMsg) == 0)
return true;
else if (strcmp("PrintPreview",pMsg) == 0)