0000789: Sketcher active in one document blocks closing another.
This commit is contained in:
parent
70bb37ab9d
commit
6efe6ff0cb
|
@ -930,6 +930,8 @@ bool Document::canClose ()
|
|||
return false;
|
||||
}
|
||||
else if (!Gui::Control().isAllowedAlterDocument()) {
|
||||
std::string name = Gui::Control().activeDialog()->getDocumentName();
|
||||
if (name == this->getDocument()->getName()) {
|
||||
QMessageBox::warning(getActiveView(),
|
||||
QObject::tr("Document not closable"),
|
||||
QObject::tr("The document is in editing mode and thus cannot be closed for the moment.\n"
|
||||
|
@ -938,6 +940,7 @@ bool Document::canClose ()
|
|||
if (dlg) Gui::Control().showDialog(dlg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isModified())
|
||||
return true;
|
||||
|
|
|
@ -67,6 +67,8 @@ public:
|
|||
virtual void modifyStandardButtons(QDialogButtonBox*)
|
||||
{}
|
||||
|
||||
const std::string& getDocumentName() const
|
||||
{ return documentName; }
|
||||
virtual bool isAllowedAlterDocument(void) const
|
||||
{ return false; }
|
||||
virtual bool isAllowedAlterView(void) const
|
||||
|
@ -92,6 +94,7 @@ protected:
|
|||
/// List of TaskBoxes of that dialog
|
||||
std::vector<QWidget*> Content;
|
||||
ButtonPosition pos;
|
||||
std::string documentName;
|
||||
};
|
||||
|
||||
} //namespace TaskView
|
||||
|
|
|
@ -65,8 +65,6 @@ public:
|
|||
|
||||
protected:
|
||||
ViewProviderSketch *sketchView;
|
||||
std::string documentName;
|
||||
|
||||
TaskSketcherConstrains *Constraints;
|
||||
TaskSketcherGeneral *General;
|
||||
TaskSketcherMessages *Messages;
|
||||
|
|
Loading…
Reference in New Issue
Block a user