PartDesign: Fix pipe preview display

When a base feature was available the preview mode did not show the pipe and also set the visibility of the pipe to false
This commit is contained in:
Stefan Tröger
2016-04-14 20:19:16 +02:00
committed by wmayer
parent 62f563938b
commit c5ca99658b
3 changed files with 14 additions and 49 deletions

View File

@@ -76,49 +76,11 @@ bool ViewProviderPipe::doubleClicked(void)
return true;
}
bool ViewProviderPipe::setEdit(int ModNum)
{
if (ModNum == ViewProvider::Default || ModNum == 1 ) {
bool ViewProviderPipe::setEdit(int ModNum) {
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();
TaskDlgPipeParameters *padDlg = qobject_cast<TaskDlgPipeParameters *>(dlg);
if (padDlg && padDlg->getPipeView() != 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 TaskDlgPipeParameters(this,ModNum == 1));
return true;
}
else {
return ViewProviderPart::setEdit(ModNum);
}
return PartDesignGui::ViewProvider::setEdit(ModNum);
}
void ViewProviderPipe::unsetEdit(int ModNum) {
@@ -127,6 +89,10 @@ void ViewProviderPipe::unsetEdit(int ModNum) {
}
TaskDlgFeatureParameters* ViewProviderPipe::getEditDialog() {
return new TaskDlgPipeParameters(this, false);
}
bool ViewProviderPipe::onDelete(const std::vector<std::string> &s)
{/*
PartDesign::Pipe* pcPipe = static_cast<PartDesign::Pipe*>(getObject());