25from .
import PanelManager
26from .
import BoxManager
35from .
import CONNECTOR
42 QCustomEvent.__init__(self,8888)
46 QMessageBox.warning(parent,self.
caption,self.
msg)
50 threading.Thread.__init__(self)
58 except ValueError
as ex:
60 QApplication.postEvent(self.
parent,
ErrorEvent(
'YACS execution error',str(ex)))
64 QVBox.__init__(self,parent)
82 self.
log.text.setText(self.
proc.getLogger(
"parser").getStr())
100 if self.
thr and self.
thr.isAlive():
107 self.
thr.setDaemon(1)
114 """Suspend or resume an executing schema"""
117 if not self.
thr.isAlive():
124 self.
executor.resumeCurrentBreakPoint()
132 """Step on a paused schema"""
134 self.
executor = pilot.ExecutorSwig()
135 if not self.
thr or not self.
thr.isAlive():
139 self.
thr.setDaemon(1)
148 self.
executor.resumeCurrentBreakPoint()
151 """Stop the schema"""
154 if not self.
thr.isAlive():
158 self.
executor.resumeCurrentBreakPoint()
164 Cree la fenetre principale de l'interface utilisateur
167 QMainWindow.__init__(self)
188 self.
newAct=QAction(
'New', QIconSet(Icons.get_image(
"new")),
'&New',
189 QKeySequence(
"CTRL+N"),self)
190 self.
newAct.setStatusTip(
'Open an empty editor window')
191 self.
newAct.setWhatsThis(
"""<b>New</b>"""
192 """<p>An empty editor window will be created.</p>""")
196 self.
prefAct=QAction(
'Preferences',QIconSet(Icons.get_image(
"configure.png")),
'&Preferences...',
198 self.
prefAct.setStatusTip(
'Set the prefered configuration')
199 self.
prefAct.setWhatsThis(
"""<b>Preferences</b>"""
200 """<p>Set the configuration items of the application"""
201 """ with your prefered values.</p>""")
205 self.
runAct=QAction(
'Run',QIconSet(Icons.get_image(
"run.png")),
'&Run',0,self)
207 self.
runAct.setStatusTip(
'Run the selected schema')
210 self.
suspAct=QAction(
'Suspend/resume',QIconSet(Icons.get_image(
"suspend-resume.gif")),
'&Suspend/resume',0,self)
212 self.
suspAct.setStatusTip(
'Suspend/resume the selected schema')
215 self.
stepAct=QAction(
'Step',QIconSet(Icons.get_image(
"steps.png")),
'&Step',0,self)
217 self.
stepAct.setStatusTip(
'Step the selected schema')
220 self.
stopAct=QAction(
'Stop',QIconSet(Icons.get_image(
"kill.png")),
'&Stop',0,self)
222 self.
stopAct.setStatusTip(
'Stop the selected schema')
230 menubar = self.menuBar()
240 for file
in glob.glob(
"/local/chris/SALOME2/SUPERV/YACS/BR_CC/YACS_SRC/src/pyqt/*loader.py"):
241 d,f=os.path.split(file)
243 def call_loader(event,obj=self,file=file):
244 obj.openFileWithLoader(file)
245 self.
loaders.append(call_loader)
247 menubar.insertItem(
'&File',self.
fileMenu)
258 menubar.insertItem(
'&Edit', self.
editMenu)
274 menubar.insertItem(
'&Canvas', self.
canvasMenu)
280 menubar.insertItem(
'&Window', self.
windowMenu)
285 menubar.insertItem(
'&Help',self.
help)
286 self.
help.insertItem(
'&About',self.
about,Qt.Key_F1)
297 self.
loader.registerProcCataLoader()
300 fn = QFileDialog.getOpenFileName(QString.null,QString.null,self)
302 self.statusBar().message(
'Loading aborted',2000)
306 logger=proc.getLogger(
"parser")
307 if logger.hasErrors():
309 self.
logFile.text.setText(logger.getStr())
314 self.
tabWidget.addTab( panel,os.path.basename(fileName))
318 fn = QFileDialog.getOpenFileName(QString.null,QString.null,self)
320 self.statusBar().message(
'Loading aborted',2000)
323 proc=self.
loader.load(fileName)
324 logger=proc.getLogger(
"parser")
325 if logger.hasErrors():
327 self.
logFile.text.setText(logger.getStr())
332 self.
tabWidget.addTab( panel,os.path.basename(fileName))
337 proc=r.createProc(
"pr")
340 self.
tabWidget.addTab( panel,proc.getName())
344 d,f=os.path.split(file)
346 module=__import__(os.path.splitext(f)[0])
348 loader=module.Loader()
350 fn = QFileDialog.getOpenFileName(QString.null,QString.null,self)
352 self.statusBar().message(
'Loading aborted',2000)
355 proc=loader.load(fileName)
356 logger=proc.getLogger(
"parser")
357 if logger.hasErrors():
359 self.
logFile.text.setText(logger.getStr())
364 self.
tabWidget.addTab( panel,os.path.basename(fileName))
401 self.
currentPanel.panelManager.visible.graph.editor.zoomIn()
407 self.
currentPanel.panelManager.visible.graph.editor.zoomOut()
413 self.
currentPanel.panelManager.visible.graph.orthoLinks()
419 self.
currentPanel.panelManager.visible.graph.clearLinks()
428 QMessageBox.about(self,
'YACS browser GUI',
'YACS browser GUI')
431 QMessageBox.aboutQt(self,
'YACS browser GUI')
460 sb = self.statusBar()
463 QWhatsThis.add(self.
SBfile,
464 """<p>Partie de la statusbar qui donne le nom"""
465 """du fichier courant. </p>""")
469if __name__ ==
"__main__":
470 from .Item
import Item
471 app = QApplication(sys.argv)
473 t.objectBrowser.additem(
Item(
"item1"))
474 n=t.objectBrowser.additem(
Item(
"item2"))
475 n.additem(
Item(
"item3"))
def handleWindowMenu(self)
def handlePreferences(self)
def openFileWithLoader(self, file)
def rankdir(self, orient)
def handlePanelChanged(self, panel)
def __init__(self, parent, proc)
def onDblSelect(self, item)
def customEvent(self, ev)
def __init__(self, caption, msg)
def process(self, parent)
def __init__(self, parent, executor, proc)