1 // Copyright (C) 2006-2021 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "FormContainer.hxx"
21 #include "FormAdvParamContainer.hxx"
22 #include "Container.hxx"
24 #include "YacsTrace.hxx"
33 FormContainer::FormContainer(QWidget *parent):FormContainerBase(parent),cb_type(new QComboBox(this))
35 gridLayout_2_2->addWidget(cb_type);
36 FormContainer::FillPanel(0); // --- set widgets before signal connexion to avoid false modif detection
37 connect(cb_type, SIGNAL(activated(const QString&)),this, SLOT(onModifyType(const QString&)));
38 connect(ch_aoc,SIGNAL(stateChanged(int)),this,SLOT(onModifyAOC(int)));
41 FormContainer::~FormContainer()
45 void FormContainer::FillPanel(YACS::ENGINE::Container *container)
47 DEBTRACE("FormContainer::FillPanel");
48 FormContainerBase::FillPanel(container);
51 ch_aoc->setCheckState(container->isAttachedOnCloning()?Qt::Checked:Qt::Unchecked);
54 cb_type->addItem("mono");
55 cb_type->addItem("multi");
56 if(_properties.count("type") && _properties["type"]=="multi")
57 cb_type->setCurrentIndex(1);
60 QString FormContainer::getTypeStr() const
62 return QString("Container");
65 void FormContainer::onModifyType(const QString &text)
67 DEBTRACE("onModifyType " << text.toStdString());
70 std::string prop=_container->getProperty("type");
71 _properties["type"] = text.toStdString();
72 if (_properties["type"] == "mono")
73 _advancedParams->setModeText("mono");
75 _advancedParams->setModeText("multi");
76 if (prop != text.toStdString())
80 void FormContainer::onModifyAOC(int val)
85 if(val==Qt::Unchecked)
89 bool prop(_container->isAttachedOnCloning());
91 std::ostringstream oss; oss << prop2;
92 _properties[YACS::ENGINE::Container::AOC_ENTRY]=oss.str();
93 _container->setAttachOnCloningStatus(val2);