PartGui: avoid code duplication for handing TaskAttacher

A better fix for #0004188

Delay calling setPreviewDisplayMode() in ViewProviderPrimitive::setEdit
also fixed issue of not turning off preview mode if the user cancels
editing because there is already a task dialog active.
This commit is contained in:
Zheng, Lei
2020-02-08 21:37:01 +08:00
committed by wmayer
parent 147b00f2cb
commit 4dad08eff6
2 changed files with 5 additions and 2 deletions

View File

@@ -746,6 +746,7 @@ TaskPrimitiveParameters::TaskPrimitiveParameters(ViewProviderPrimitive* Primitiv
primitive = new TaskBoxPrimitives(PrimitiveView);
Content.push_back(primitive);
/*
// handle visibility automation differently to the default method
auto customvisfunc = [] (bool opening_not_closing,
const std::string &postfix,
@@ -780,6 +781,8 @@ TaskPrimitiveParameters::TaskPrimitiveParameters(ViewProviderPrimitive* Primitiv
}
};
parameter = new PartGui::TaskAttacher(PrimitiveView, nullptr, QString(), tr("Attachment"), customvisfunc);
*/
parameter = new PartGui::TaskAttacher(PrimitiveView, nullptr, QString(), tr("Attachment"));
Content.push_back(parameter);
}