PartDesign NewSketch: Add a parameter to use attachment dialog instead of feature pick
This commit is contained in:
committed by
Chris Hennes
parent
ddd86bd7b3
commit
a61db12828
@@ -111,27 +111,13 @@ void ViewProviderAttachExtension::extensionSetupContextMenu(QMenu* menu, QObject
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderAttachExtension::showAttachmentEditor()
|
||||
void ViewProviderAttachExtension::showAttachmentEditor(std::function<void()> onAccept, std::function<void()> onReject)
|
||||
{
|
||||
if (Gui::Control().activeDialog()) {
|
||||
Gui::Control().closeDialog();
|
||||
}
|
||||
|
||||
// See PropertyEnumAttacherItem::openTask()
|
||||
Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog();
|
||||
TaskDlgAttacher* task;
|
||||
task = qobject_cast<TaskDlgAttacher*>(dlg);
|
||||
|
||||
if (dlg && !task) {
|
||||
// there is already another task dialog which must be closed first
|
||||
Gui::Control().showDialog(dlg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!task) {
|
||||
task = new TaskDlgAttacher(getExtendedViewProvider());
|
||||
}
|
||||
|
||||
TaskDlgAttacher* task = new TaskDlgAttacher(getExtendedViewProvider(), true, onAccept, onReject);
|
||||
Gui::Control().showDialog(task);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user