1 # Copyright (C) 2006-2008 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.
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
25 class Browser(browser.Browser):
27 self.rootItem=sessions.Sessions(port=2809)
28 self.objectBrowser.additem(self.rootItem)
29 self.boxManager.setRootItem(self.rootItem)
30 self.setStretchFactor(self.hSplitter,10)
32 class MainBrowser(QMainWindow):
33 def __init__(self,parent,appli):
34 QMainWindow.__init__(self,parent)
36 self.catalogTool=parent
39 def createWidgets(self):
43 self.browser=Browser(hb,self.appli)
46 but1=QPushButton( "Import catalog", row2 )
47 but1.setFixedSize( but1.sizeHint())
48 #but2=QPushButton( "Cancel", row2 )
49 self.connect( but1, SIGNAL("clicked()"), self.handleBut1 )
50 #box.connect( but2, SIGNAL("clicked()"), self.handleCancel )
51 self.setCentralWidget(box)
55 addr=self.browser.selected.addr+"#Kernel.dir/ModulCatalog.object"
56 cata=pilot.getRuntime().loadCatalog("session",addr)
57 self.catalogTool.register(cata,self.browser.selected.addr)
59 if __name__ == "__main__":
60 app = QApplication(sys.argv)
61 t=MainBrowser(None,None)