]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/genericgui/SchemaDirContainersItem.cxx
Salome HOME
Updated copyright comment
[modules/yacs.git] / src / genericgui / SchemaDirContainersItem.cxx
index 17fddc29e710c349bffed44c564ddedb58a2fed3..07a2f3f897846cd9587b804dc8ea930dfb7b7473 100644 (file)
@@ -1,27 +1,29 @@
-//  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2024  CEA, EDF
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SchemaDirContainersItem.hxx"
 #include "SchemaContainerItem.hxx"
 #include "SchemaModel.hxx"
 #include "QtGuiContext.hxx"
 #include "ComponentInstance.hxx"
 #include "Container.hxx"
+#include "Menus.hxx"
 
 #include <QIcon>
 #include <cassert>
@@ -34,13 +36,21 @@ using namespace YACS::ENGINE;
 using namespace YACS::HMI;
 
 SchemaDirContainersItem::SchemaDirContainersItem(SchemaItem *parent, QString label, Subject* subject)
-  : SchemaItem::SchemaItem(parent, label, subject)
+  : SchemaItem(parent, label, subject)
 {
   _itemDeco.replace(YLabel, QIcon("icons:folder_cyan.png"));
   _schemaContItemMap.clear();
   _waitingCompItemMap.clear();
 }
 
+void SchemaDirContainersItem::popupMenu(QWidget *caller, const QPoint &globalPos)
+{
+  ContainerDirMenu m;
+  m.popupMenu(caller, globalPos);
+}
+
+
+
 /*! When loading a schema, a container may appear after a component using this container.
  *  After creating the SchemaContainerItem, check if there are SchemaComponentItems to
  *  to create as children of this SchemaContainerItem
@@ -69,9 +79,9 @@ void SchemaDirContainersItem::addComponentItem(Subject* subject)
 {
   DEBTRACE("SchemaDirContainersItem::addComponentItem");
   SubjectComponent *aSComp = dynamic_cast<SubjectComponent*>(subject);
-  assert(aSComp);
+  YASSERT(aSComp);
   ComponentInstance* component = aSComp->getComponent();
-  assert(component);
+  YASSERT(component);
 
   string contName = "DefaultContainer";
   Container *container = component->getContainer();
@@ -86,7 +96,14 @@ void SchemaDirContainersItem::addComponentItem(Subject* subject)
         }
     }
 
-  assert(_schemaContItemMap.count(contName));
+  YASSERT(_schemaContItemMap.count(contName));
   SchemaContainerItem *sci = _schemaContItemMap[contName];
   aSComp->associateToContainer(static_cast<SubjectContainer*>(sci->getSubject()));
 }
+
+QVariant SchemaDirContainersItem::editionWhatsThis(int column) const
+{
+  return "<p>Containers used in this schema appears in this folder.\n" \
+      "You can add containers by using the context menu (entry \"Create container\") " \
+      "and then edit its properties in the input panel. <a href=\"modification.html#property-page-for-container\">More...</a></p>";
+}