25 from .
import PanelManager
26 from .
import BoxManager
35 from .
import CONNECTOR
42 QCustomEvent.__init__(self,8888)
46 QMessageBox.warning(parent,self.
captioncaption,self.
msgmsg)
50 threading.Thread.__init__(self)
58 except ValueError
as ex:
60 QApplication.postEvent(self.
parentparent,
ErrorEvent(
'YACS execution error',str(ex)))
64 QVBox.__init__(self,parent)
68 self.
hSplitterhSplitter = QSplitter(self,
"hSplitter")
82 self.
loglog.text.setText(self.
procproc.getLogger(
"parser").getStr())
99 self.
executorexecutor = pilot.ExecutorSwig()
100 if self.
thrthr
and self.
thrthr.isAlive():
103 self.
executorexecutor.setExecMode(0)
107 self.
thrthr.setDaemon(1)
114 """Suspend or resume an executing schema"""
117 if not self.
thrthr.isAlive():
122 self.
executorexecutor.setExecMode(0)
124 self.
executorexecutor.resumeCurrentBreakPoint()
128 self.
executorexecutor.setExecMode(1)
132 """Step on a paused schema"""
134 self.
executorexecutor = pilot.ExecutorSwig()
135 if not self.
thrthr
or not self.
thrthr.isAlive():
137 self.
executorexecutor.setExecMode(1)
139 self.
thrthr.setDaemon(1)
146 self.
executorexecutor.setExecMode(1)
148 self.
executorexecutor.resumeCurrentBreakPoint()
151 """Stop the schema"""
154 if not self.
thrthr.isAlive():
156 self.
executorexecutor.setExecMode(1)
158 self.
executorexecutor.resumeCurrentBreakPoint()
164 Cree la fenetre principale de l'interface utilisateur
167 QMainWindow.__init__(self)
179 self.setCentralWidget(self.
tabWidgettabWidget)
188 self.
newActnewAct=QAction(
'New', QIconSet(Icons.get_image(
"new")),
'&New',
189 QKeySequence(
"CTRL+N"),self)
190 self.
newActnewAct.setStatusTip(
'Open an empty editor window')
191 self.
newActnewAct.setWhatsThis(
"""<b>New</b>"""
192 """<p>An empty editor window will be created.</p>""")
196 self.
prefActprefAct=QAction(
'Preferences',QIconSet(Icons.get_image(
"configure.png")),
'&Preferences...',
198 self.
prefActprefAct.setStatusTip(
'Set the prefered configuration')
199 self.
prefActprefAct.setWhatsThis(
"""<b>Preferences</b>"""
200 """<p>Set the configuration items of the application"""
201 """ with your prefered values.</p>""")
205 self.
runActrunAct=QAction(
'Run',QIconSet(Icons.get_image(
"run.png")),
'&Run',0,self)
206 self.
runActrunAct.connect(self.
runActrunAct,SIGNAL(
'activated()'), self.
runrun)
207 self.
runActrunAct.setStatusTip(
'Run the selected schema')
210 self.
suspActsuspAct=QAction(
'Suspend/resume',QIconSet(Icons.get_image(
"suspend-resume.gif")),
'&Suspend/resume',0,self)
212 self.
suspActsuspAct.setStatusTip(
'Suspend/resume the selected schema')
215 self.
stepActstepAct=QAction(
'Step',QIconSet(Icons.get_image(
"steps.png")),
'&Step',0,self)
217 self.
stepActstepAct.setStatusTip(
'Step the selected schema')
220 self.
stopActstopAct=QAction(
'Stop',QIconSet(Icons.get_image(
"kill.png")),
'&Stop',0,self)
222 self.
stopActstopAct.setStatusTip(
'Stop the selected schema')
225 self.
cataToolActcataToolAct=QAction(
'Catalog Tool',0,self,
"catatool")
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.
loadersloaders.append(call_loader)
246 self.
loadersMenuloadersMenu.insertItem(name, call_loader)
247 menubar.insertItem(
'&File',self.
fileMenufileMenu)
251 menubar.insertItem(
'&Settings', self.
settingsMenusettingsMenu)
258 menubar.insertItem(
'&Edit', self.
editMenueditMenu)
263 self.
layoutMenulayoutMenu.insertItem(
"&Left Right", self.
LRLR)
264 self.
layoutMenulayoutMenu.insertItem(
"Right Left", self.
RLRL)
265 self.
layoutMenulayoutMenu.insertItem(
"Top Bottom", self.
TBTB)
266 self.
layoutMenulayoutMenu.insertItem(
"Bottom Top", self.
BTBT)
274 menubar.insertItem(
'&Canvas', self.
canvasMenucanvasMenu)
280 menubar.insertItem(
'&Window', self.
windowMenuwindowMenu)
285 menubar.insertItem(
'&Help',self.
helphelp)
286 self.
helphelp.insertItem(
'&About',self.
aboutabout,Qt.Key_F1)
287 self.
helphelp.insertItem(
'About &Qt',self.
aboutQtaboutQt)
297 self.
loaderloader.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.
logFilelogFile.text.setText(logger.getStr())
314 self.
tabWidgettabWidget.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.
loaderloader.load(fileName)
324 logger=proc.getLogger(
"parser")
325 if logger.hasErrors():
327 self.
logFilelogFile.text.setText(logger.getStr())
332 self.
tabWidgettabWidget.addTab( panel,os.path.basename(fileName))
337 proc=r.createProc(
"pr")
340 self.
tabWidgettabWidget.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.
logFilelogFile.text.setText(logger.getStr())
364 self.
tabWidgettabWidget.addTab( panel,os.path.basename(fileName))
383 self.
currentPanelcurrentPanel.panelManager.visible.layout(orient)
389 self.
currentPanelcurrentPanel.selected.graph.editor.updateCanvas()
401 self.
currentPanelcurrentPanel.panelManager.visible.graph.editor.zoomIn()
407 self.
currentPanelcurrentPanel.panelManager.visible.graph.editor.zoomOut()
413 self.
currentPanelcurrentPanel.panelManager.visible.graph.orthoLinks()
419 self.
currentPanelcurrentPanel.panelManager.visible.graph.clearLinks()
428 QMessageBox.about(self,
'YACS browser GUI',
'YACS browser GUI')
431 QMessageBox.aboutQt(self,
'YACS browser GUI')
451 self.
newActnewAct.addTo(tb)
452 self.
runActrunAct.addTo(tb)
460 sb = self.statusBar()
462 sb.addWidget(self.
SBfileSBfile)
463 QWhatsThis.add(self.
SBfileSBfile,
464 """<p>Partie de la statusbar qui donne le nom"""
465 """du fichier courant. </p>""")
466 self.
SBfileSBfile.setText(
"")
469 if __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)