From ebb02e687fbabaec5877c9b89777794e95dc02e5 Mon Sep 17 00:00:00 2001 From: caremoli Date: Wed, 17 Nov 2010 18:05:08 +0000 Subject: [PATCH] CCAR: fix bug in salome plugins manager. Menus now appear in all studies not only the first --- src/SalomeApp/salome_pluginsmanager.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/SalomeApp/salome_pluginsmanager.py b/src/SalomeApp/salome_pluginsmanager.py index 00199335d..da726a837 100644 --- a/src/SalomeApp/salome_pluginsmanager.py +++ b/src/SalomeApp/salome_pluginsmanager.py @@ -77,12 +77,21 @@ plugins={} current_plugins_manager=None def initialize(module,name,basemenuname,menuname): - if plugins.has_key(name):return - plugins[name]=PluginsManager(module,name,basemenuname,menuname) + if not plugins.has_key(name): + if module: + plugins[name]={} + else: + plugins[name]=[] + if module: + studyId=sg.getActiveStudyId() + if plugins[name].has_key(studyId):return + plugins[name][studyId]=PluginsManager(module,name,basemenuname,menuname) + else: + plugins[name].append(PluginsManager(module,name,basemenuname,menuname)) class Context: - def __init__(self,sg): - self.sg=sg + def __init__(self,sgpyqt): + self.sg=sgpyqt self.studyId=salome.sg.getActiveStudyId() self.study= salome.myStudyManager.GetStudyByID(self.studyId) -- 2.39.2