Ejemplo n.º 1
0
    def __init__(self, parent, mainWindow, pid):
        QDialog.__init__(self, parent)
        self.translation()
        self.setWindowTitle(self.nameTitle)
        self.tm = TaskManager()
        self.pid = pid
        res = {}
        args = {}
        self.tabwidget = QTabWidget(self)
        stream = None
        for proc in self.tm.lprocessus:
            if str(proc.pid) == self.pid:
                res = proc.res
                args = proc.args

                if proc.streamOut == None:
                    try:
                        proc.streamOut = ""
                        txt = proc.stream.get(0)
                        proc.streamOut += txt
                        while txt:
                            txt = proc.stream.get(0)
                            proc.streamOut += txt
                    except Empty:
                        pass
                if proc.streamOut and proc.streamOut != "":
                    stream = proc.streamOut
        self.box = QVBoxLayout()
        self.setLayout(self.box)
        self.box.addWidget(self.tabwidget)
        self.dialogButtonsLayout = QHBoxLayout()
        self.dialogButtonsBox = QDialogButtonBox()
        self.dialogButtonsBox.setStandardButtons(QDialogButtonBox.Ok)
        self.connect(self.dialogButtonsBox, SIGNAL("accepted()"), self.accept)
        self.dialogButtonsLayout.addWidget(self.dialogButtonsBox)
        self.setMinimumSize(800, 600)
        if len(args) > 0:
            self.treeargs = VariantTreeWidget(self)
            self.treeargs.fillMap(self.treeargs, args)
            self.tabwidget.addTab(self.treeargs, self.argname)
            for i in [0, 1]:
                self.treeargs.resizeColumnToContents(i)
        if stream:
            textWidget = TextEdit(proc)
            textWidget.emit(SIGNAL("puttext"), proc.streamOut)
            self.tabwidget.addTab(textWidget, self.outputname)
        if len(res) > 0:
            self.treeres = VariantTreeWidget(self)
            self.treeres.fillMap(self.treeres, res)
            self.tabwidget.addTab(self.treeres, self.resname)
            for i in [0, 1]:
                self.treeres.resizeColumnToContents(i)
        else:
            label = QLabel(self.noResult)
            label.setAlignment(Qt.AlignCenter)
            self.tabwidget.addTab(label, self.resname)
        self.box.addLayout(self.dialogButtonsLayout)
Ejemplo n.º 2
0
    def strResultView(self, proc):
   	widget = TextEdit(proc)
	try :
	   res = ''
	   txt = proc.stream.get(0)
	   res += txt	
	   while txt:
	      txt = proc.stream.get(0)   
	      res += txt
	except Empty:
	    pass   
	if res and res != '':
	   widget.emit(SIGNAL("puttext"), res)
           self.addDockWidgets(widget, proc.name)