Exemple #1
0
    def __onProjectChanged( self, what ):
        " Triggered when a project is changed "
        if what != CodimensionProject.CompleteProject:
            return

        self.clear()
        model = self.bpointsList.model().sourceModel()
        project = GlobalData().project
        if project.isLoaded():
            bpoints = project.breakpoints
        else:
            bpoints = Settings().breakpoints

        for bp in bpoints:
            newBpoint = Breakpoint()
            try:
                if not newBpoint.deserialize( bp ):
                    # Non valid
                    continue
            except:
                continue
            # Need to check if it still points to a breakable line
            line = newBpoint.getLineNumber()
            fileName = newBpoint.getAbsoluteFileName()
            breakableLines = getBreakpointLines( fileName, None, True )
            if breakableLines is not None and line in breakableLines:
                model.addBreakpoint( newBpoint )
            else:
                logging.warning( "Breakpoint at " + fileName + ":" +
                                 str( line ) + " does not point to a breakable "
                                 "line anymore (the file is invalid or was "
                                 "modified outside of the "
                                 "IDE etc.). The breakpoint is deleted." )
        return
Exemple #2
0
    def getBreakpoint(self, id): 
        if id == ~0:
            bp = Breakpoint(self)
            bp.setUserType()
            return bp
	else:
            return self.__breakpointTable.get(id)
Exemple #3
0
    def __onProjectChanged(self, what):
        " Triggered when a project is changed "
        if what != CodimensionProject.CompleteProject:
            return

        self.clear()
        model = self.bpointsList.model().sourceModel()
        project = GlobalData().project
        if project.isLoaded():
            bpoints = project.breakpoints
        else:
            bpoints = Settings().breakpoints

        for bp in bpoints:
            newBpoint = Breakpoint()
            try:
                if not newBpoint.deserialize(bp):
                    # Non valid
                    continue
            except:
                continue
            # Need to check if it still points to a breakable line
            line = newBpoint.getLineNumber()
            fileName = newBpoint.getAbsoluteFileName()
            breakableLines = getBreakpointLines(fileName, None, True)
            if breakableLines is not None and line in breakableLines:
                model.addBreakpoint(newBpoint)
            else:
                logging.warning("Breakpoint at " + fileName + ":" + str(line) +
                                " does not point to a breakable "
                                "line anymore (the file is invalid or was "
                                "modified outside of the "
                                "IDE etc.). The breakpoint is deleted.")
        return
Exemple #4
0
    def getBreakpoint(self, id): 
        if id == ~0:
            bp = Breakpoint(self)
            bp.setUserType()
            return bp
	else:
            return self.__breakpointTable.get(id)
Exemple #5
0
 def addBreakpointAtFunction(self, function):
     bp = Breakpoint(self)
     bp.setFunction(function)
     bp.enable()
     self.__breakpoints.append(bp)
     self.__breakpointTable[bp.getId()] = bp
     return bp.getId()
Exemple #6
0
 def addBreakpointAtPosition(self, position):
     bp = Breakpoint(self)
     bp.setPosition(position)
     bp.enable()
     self.__breakpoints.append(bp)
     self.__breakpointTable[bp.getId()] = bp
     return bp.getId()
Exemple #7
0
 def addBreakpointAtFunction(self, function):
     bp = Breakpoint(self)
     bp.setFunction(function)
     bp.enable()
     self.__breakpoints.append(bp)
     self.__breakpointTable[bp.getId()] = bp
     return bp.getId()
Exemple #8
0
 def addBreakpointAtPosition(self, position):
     bp = Breakpoint(self)
     bp.setPosition(position)
     bp.enable()
     self.__breakpoints.append(bp)
     self.__breakpointTable[bp.getId()] = bp
     return bp.getId()
Exemple #9
0
 def getData( self ):
     " Provides a new instance of a breakpoint "
     newBPoint = Breakpoint( self.__origBpoint.getAbsoluteFileName(),
                             self.__origBpoint.getLineNumber(),
                             self.__conditionValue.lineEdit().text().strip(),
                             self.__tempCheckbox.isChecked(),
                             self.__enabled.isChecked(),
                             self.__ignoreValue.value() )
     return newBPoint