diff --git a/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp b/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp index 2a19c6510..4e2c1cb5d 100644 --- a/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp @@ -79,6 +79,14 @@ TaskLoftParameters::TaskLoftParameters(ViewProviderLoft *LoftView,bool newObj, Q // Temporarily prevent unnecessary feature recomputes for(QWidget* child : proxy->findChildren()) child->blockSignals(true); + + //add the profiles + for(auto obj : static_cast(LoftView->getObject())->Sections.getValues()) { + + QString objn = QString::fromLatin1(obj->getNameInDocument()); + if(!objn.isEmpty()) + ui->listWidgetReferences->addItem(objn); + } // activate and de-activate dialog elements as appropriate for(QWidget* child : proxy->findChildren()) diff --git a/src/Mod/PartDesign/Gui/ViewProviderLoft.cpp b/src/Mod/PartDesign/Gui/ViewProviderLoft.cpp index 22d3654b1..8435949c0 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderLoft.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderLoft.cpp @@ -78,52 +78,21 @@ bool ViewProviderLoft::doubleClicked(void) bool ViewProviderLoft::setEdit(int ModNum) { - if (ModNum == ViewProvider::Default || ModNum == 1 ) { - + if (ModNum == ViewProvider::Default) setPreviewDisplayMode(true); - // When double-clicking on the item for this pad the - // object unsets and sets its edit mode without closing - // the task panel - Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); - TaskDlgLoftParameters *padDlg = qobject_cast(dlg); - if (padDlg && padDlg->getLoftView() != this) - padDlg = 0; // another pad left open its task panel - if (dlg && !padDlg) { - QMessageBox msgBox; - msgBox.setText(QObject::tr("A dialog is already open in the task panel")); - msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?")); - msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - msgBox.setDefaultButton(QMessageBox::Yes); - int ret = msgBox.exec(); - if (ret == QMessageBox::Yes) - Gui::Control().reject(); - else - return false; - } - - // clear the selection (convenience) - Gui::Selection().clearSelection(); - - // always change to PartDesign WB, remember where we come from - oldWb = Gui::Command::assureWorkbench("PartDesignWorkbench"); - - // start the edit dialog - if (padDlg) - Gui::Control().showDialog(padDlg); - else - Gui::Control().showDialog(new TaskDlgLoftParameters(this,ModNum == 1)); - - return true; - } - else { - return ViewProviderPart::setEdit(ModNum); - } + return ViewProviderAddSub::setEdit(ModNum); } +TaskDlgFeatureParameters* ViewProviderLoft::getEditDialog() { + return new TaskDlgLoftParameters(this); +} + + void ViewProviderLoft::unsetEdit(int ModNum) { + setPreviewDisplayMode(false); - PartDesignGui::ViewProvider::unsetEdit(ModNum); + ViewProviderAddSub::unsetEdit(ModNum); } diff --git a/src/Mod/PartDesign/Gui/ViewProviderLoft.h b/src/Mod/PartDesign/Gui/ViewProviderLoft.h index 9680532f2..03b1be7de 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderLoft.h +++ b/src/Mod/PartDesign/Gui/ViewProviderLoft.h @@ -49,6 +49,8 @@ public: protected: virtual bool setEdit(int ModNum); virtual void unsetEdit(int ModNum); + virtual TaskDlgFeatureParameters* getEditDialog(); + virtual QIcon getIcon(void) const; private: