Salome HOME
Copyright update 2021
[modules/yacs.git] / src / salomewrap / SalomeWrap_Module.cxx
index e69ccb9ddbe705f3b82b9db44ba6bb643e29e3ab..41f3650b37c4ae63cb488d834f353714754e790d 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2006-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2021  CEA/DEN, EDF R&D
 //
 // 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.
+// 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
@@ -71,20 +71,17 @@ QxScene_ViewWindow* SalomeWrap_Module::getNewWindow(QGraphicsScene *scene)
   return aView;
 }
 
-int SalomeWrap_Module::AssociateViewToWindow(QGraphicsView* gView,
+void SalomeWrap_Module::AssociateViewToWindow(QGraphicsView* gView,
                                              QxScene_ViewWindow* viewWindow)
 {
   viewWindow->setSceneView(gView);
   viewWindow->setCentralWidget(gView);
-  return viewWindow->getViewManager()->study()->id();
-}
-
-int SalomeWrap_Module::activeStudyId()
-{
-  return getApp()->activeStudy()->id();
 }
 
 QDockWidget* SalomeWrap_Module::objectBrowser() {
+  if ( !getApp()->objectBrowser() )
+    return 0;
+
   QWidget* wid = getApp()->objectBrowser()->treeView();
 
   if ( !wid ) {
@@ -169,9 +166,9 @@ int SalomeWrap_Module::wCreateMenu(QAction* action,
   return createMenu(action, menu, actionId, groupId, index);
 }
 
-int SalomeWrap_Module::wCreateTool(const QString& name)
+int SalomeWrap_Module::wCreateTool(const QString& title, const QString& name)
 {
-  return createTool(name);
+  return createTool(title, name);
 }
 
 int SalomeWrap_Module::wCreateTool(const int actionId,