def __init__(self, distributedObjects): QObject.__init__(self) self.__do = distributedObjects self.__view = MiTraceView() self.__do.mainwindow.insertDockWidget(self.__view, "MI Trace", Qt.BottomDockWidgetArea, True) self.__do.gdb_connector.commandExecuted.connect(self.appendCommand) self.__do.gdb_connector.reader.asyncRecordReceived.connect(self.appendAsync)
class MiTraceController(QObject): def __init__(self, distributedObjects): QObject.__init__(self) self.__do = distributedObjects self.__view = MiTraceView() self.__do.mainwindow.insertDockWidget(self.__view, "MI Trace", Qt.BottomDockWidgetArea, True) self.__do.gdb_connector.commandExecuted.connect(self.appendCommand) self.__do.gdb_connector.reader.asyncRecordReceived.connect(self.appendAsync) def appendCommand(self, cmd, rec): self.__view.append("<b>" + cmd + "</b>") color = 'color="#ff3333"' if rec.class_ == GdbOutput.ERROR else "" self.__view.append("<font %s>%s</font>" % (color, rec.raw)) def appendAsync(self, rec): self.__view.append('<font color="#777777">%s</font>' % rec.raw)