properly close task dialog when document is getting closed
This commit is contained in:
@@ -571,8 +571,13 @@ void CmdPartDesignNewSketch::activated(int iMsg)
|
||||
Gui::Command::doCommand(Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
|
||||
};
|
||||
|
||||
// Called by dialog for "Cancel", or "OK" iff accepter returns false
|
||||
auto quitter( Gui::Command::abortCommand );
|
||||
// Called by dialog for "Cancel", or "OK" if accepter returns false
|
||||
std::string docname = doc->getName();
|
||||
auto quitter = [docname]() {
|
||||
Gui::Document* document = Gui::Application::Instance->getDocument(docname.c_str());
|
||||
if (document)
|
||||
document->abortCommand();
|
||||
};
|
||||
|
||||
if (validPlaneCount == 0) {
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No valid planes in this document"),
|
||||
|
||||
@@ -449,6 +449,12 @@ void TaskFeaturePick::slotUndoDocument(const Gui::Document&)
|
||||
}
|
||||
}
|
||||
|
||||
void TaskFeaturePick::slotDeleteDocument(const Gui::Document&)
|
||||
{
|
||||
origins.clear();
|
||||
QTimer::singleShot(100, &Gui::Control(), SLOT(closeDialog()));
|
||||
}
|
||||
|
||||
void TaskFeaturePick::showExternal(bool val)
|
||||
{
|
||||
ui->checkOtherBody->setChecked(val);
|
||||
|
||||
@@ -77,6 +77,8 @@ protected:
|
||||
virtual void slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj);
|
||||
/** Notifies on undo */
|
||||
virtual void slotUndoDocument(const Gui::Document& Doc);
|
||||
/** Notifies on document deletion */
|
||||
virtual void slotDeleteDocument(const Gui::Document& Doc);
|
||||
|
||||
private:
|
||||
Ui_TaskFeaturePick* ui;
|
||||
|
||||
Reference in New Issue
Block a user