Esempio n. 1
0
class TrickplayBacktrace(QWidget):
    def __init__(self, parent=None, f=0):
        QWidget.__init__(self, parent)

        self.ui = Ui_TrickplayBacktrace()
        self.ui.setupUi(self)
        self.ui.traceTable.setSortingEnabled(False)
        self.ui.traceTable.setColumnCount(1)
        self.connect(self.ui.traceTable, SIGNAL("cellClicked(int, int)"),
                     self.cellClicked)
        self.stack_info = {}

        self.font = QFont()
        self.font.setStyleHint(self.font.Monospace)
        self.font.setFamily('Inconsolata')
        self.font.setPointSize(12)

    def cellClicked(self, r, c):
        cellItem = self.ui.traceTable.item(r, 0)
        fileLine = cellItem.whatsThis()
        n = re.search(":", fileLine).end()
        fileName = fileLine[:n - 1]
        lineNum = int(fileLine[n:])

        self.editorManager.newEditor(fileName, None, lineNum)
        editor = self.editorManager.currentEditor

    def clearTraceTable(self, row_num=0):
        self.ui.traceTable.clear()
        self.ui.traceTable.setRowCount(row_num)

    def populateTraceTable(self, stack_info=None, editorManager=None):

        self.stack_info = stack_info
        self.editorManager = editorManager

        if len(stack_info) > 0:
            self.clearTraceTable(len(stack_info[1]))
        else:
            self.clearTraceTable()

        n = 0
        for key in stack_info:
            m = 0
            for item in stack_info[key]:
                if key == 1:
                    newitem = QTableWidgetItem()
                    newitem.setFont(self.font)
                    newitem.setText(item)
                    vh = self.ui.traceTable.verticalHeader()
                    vh.setDefaultSectionSize(18)
                    self.ui.traceTable.setItem(m, n, newitem)
                elif key == 2:
                    newitem = self.ui.traceTable.item(m, 0)
                    newitem.setWhatsThis(item)
                else:
                    pass
                m += 1
            n += 1
        self.ui.traceTable.show()
Esempio n. 2
0
    def __init__(self, parent=None, f=0):
        QWidget.__init__(self, parent)

        self.ui = Ui_TrickplayBacktrace()
        self.ui.setupUi(self)
        self.ui.traceTable.setSortingEnabled(False)
        self.ui.traceTable.setColumnCount(1)
        self.connect(self.ui.traceTable, SIGNAL("cellClicked(int, int)"),
                     self.cellClicked)
        self.stack_info = {}

        self.font = QFont()
        self.font.setStyleHint(self.font.Monospace)
        self.font.setFamily('Inconsolata')
        self.font.setPointSize(12)
Esempio n. 3
0
    def __init__(self, parent = None, f = 0):
        QWidget.__init__(self, parent)
        
        self.ui = Ui_TrickplayBacktrace()
        self.ui.setupUi(self)
        self.ui.traceTable.setSortingEnabled(False)
        self.ui.traceTable.setColumnCount(1)
        self.connect(self.ui.traceTable, SIGNAL("cellClicked(int, int)"), self.cellClicked)
        self.stack_info = {}

        self.font = QFont()
        self.font.setStyleHint(self.font.Monospace)
        self.font.setFamily('Inconsolata')
        self.font.setPointSize(12)
Esempio n. 4
0
class TrickplayBacktrace(QWidget):
    
    def __init__(self, parent = None, f = 0):
        QWidget.__init__(self, parent)
        
        self.ui = Ui_TrickplayBacktrace()
        self.ui.setupUi(self)
        self.ui.traceTable.setSortingEnabled(False)
        self.ui.traceTable.setColumnCount(1)
        self.connect(self.ui.traceTable, SIGNAL("cellClicked(int, int)"), self.cellClicked)
        self.stack_info = {}

        self.font = QFont()
        self.font.setStyleHint(self.font.Monospace)
        self.font.setFamily('Inconsolata')
        self.font.setPointSize(12)


    def cellClicked(self, r, c):
		cellItem= self.ui.traceTable.item(r, 0) 
		fileLine = cellItem.whatsThis()
		n = re.search(":", fileLine).end()
		fileName = fileLine[:n-1]
		lineNum = int(fileLine[n:])

		self.editorManager.newEditor(fileName, None, lineNum)
		editor = self.editorManager.currentEditor 
		
    def clearTraceTable(self, row_num=0):
		self.ui.traceTable.clear()
		self.ui.traceTable.setRowCount(row_num)
		
    def populateTraceTable(self, stack_info=None, editorManager=None):

		self.stack_info = stack_info
		self.editorManager = editorManager

		if len(stack_info) > 0 :
			self.clearTraceTable(len(stack_info[1]))
		else :
			self.clearTraceTable()

		n = 0
		for key in stack_info:
			m = 0
			for item in stack_info[key]:
				if key == 1:
					newitem = QTableWidgetItem()
					newitem.setFont(self.font)
					newitem.setText(item)
					vh = self.ui.traceTable.verticalHeader()
					vh.setDefaultSectionSize(18)
					self.ui.traceTable.setItem(m, n, newitem)
				elif key == 2:
					newitem= self.ui.traceTable.item(m,0)
					newitem.setWhatsThis(item)
				else:
					pass
				m += 1
			n += 1
		self.ui.traceTable.show()