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