Ejemplo n.º 1
0
    def __init__( self, parent = None ):
        BrowserModelBase.__init__( self, [ QVariant( "Name" ),
                                           QVariant( "File name" ),
                                           QVariant( "Line" ) ], parent )

        self.globalData.project.projectChanged.connect( self.__onProjectChanged )
        return
Ejemplo n.º 2
0
 def __init__( self, parent = None ):
     BrowserModelBase.__init__( self, [ QVariant( "Name" ),
                                        QVariant( "File name" ),
                                        QVariant( "Line" ) ], parent )
     self.setTooltips( Settings().functionsTooltips )
     self.globalData.project.projectChanged.connect( self.__onProjectChanged )
     return
Ejemplo n.º 3
0
    def __init__(self, parent):
        self.__mainWindow = parent
        BrowserModelBase.__init__(self, QVariant("Name"), self.__mainWindow)
        self.setTooltips(Settings().projectTooltips)
        self.populateModel()

        GlobalData().project.projectChanged.connect(self.__onProjectChanged)
        return
Ejemplo n.º 4
0
    def __init__(self, parent=None):
        BrowserModelBase.__init__(
            self, [QVariant("Name"),
                   QVariant("File name"),
                   QVariant("Line")], parent)

        self.globalData.project.projectChanged.connect(self.__onProjectChanged)
        return
Ejemplo n.º 5
0
    def __init__( self, parent ):
        self.__mainWindow = parent
        BrowserModelBase.__init__( self, QVariant( "Name" ), self.__mainWindow )
        self.setTooltips( Settings().projectTooltips )
        self.populateModel()

        GlobalData().project.projectChanged.connect( self.__onProjectChanged )
        return
Ejemplo n.º 6
0
    def __init__( self, parent = None ):

        BrowserModelBase.__init__( self, QVariant( "Name" ), parent )
        self.setTooltips( Settings().projectTooltips )

        self.projectTopLevelDirs = []
        self.populateModel()

        GlobalData().project.projectChanged.connect( self.__onProjectChanged )
        return
Ejemplo n.º 7
0
    def data( self, index, role ):
        " Extention to modify the background and tooltips for the project browser "
        if not index.isValid():
            return QVariant()

        item = index.internalPointer()
        if item.vcsStatus:
            indicator = self.__mainWindow.vcsManager.getStatusIndicator( item.vcsStatus )
            if role == Qt.TextColorRole:
                if indicator and indicator.foregroundColor:
                    return QVariant( indicator.foregroundColor )
            elif role == Qt.BackgroundColorRole:
                if indicator and indicator.backgroundColor:
                    return QVariant( indicator.backgroundColor )
            elif role == Qt.ToolTipRole:
                docstringPart = None
                if self.showTooltips and item.toolTip != "":
                    docstringPart = item.toolTip

                vcsPart = None
                if indicator:
                    if item.vcsStatus.message:
                        vcsPart = item.vcsStatus.message
                    else:
                        vcsPart = indicator.defaultTooltip

                if docstringPart and vcsPart:
                    return QVariant( docstringPart + "\n\nVCS status: " + vcsPart )
                if docstringPart:
                    return QVariant( docstringPart )
                if vcsPart:
                    return QVariant( "VCS status: " + vcsPart )
                return QVariant()

        return BrowserModelBase.data( self, index, role )
Ejemplo n.º 8
0
    def data(self, index, role):
        " Extention to modify the background and tooltips for the project browser "
        if not index.isValid():
            return QVariant()

        item = index.internalPointer()
        if item.vcsStatus:
            indicator = self.__mainWindow.vcsManager.getStatusIndicator(
                item.vcsStatus)
            if role == Qt.TextColorRole:
                if indicator and indicator.foregroundColor:
                    return QVariant(indicator.foregroundColor)
            elif role == Qt.BackgroundColorRole:
                if indicator and indicator.backgroundColor:
                    return QVariant(indicator.backgroundColor)
            elif role == Qt.ToolTipRole:
                docstringPart = None
                if self.showTooltips and item.toolTip != "":
                    docstringPart = item.toolTip

                vcsPart = None
                if indicator:
                    if item.vcsStatus.message:
                        vcsPart = item.vcsStatus.message
                    else:
                        vcsPart = indicator.defaultTooltip

                if docstringPart and vcsPart:
                    return QVariant(docstringPart + "\n\nVCS status: " +
                                    vcsPart)
                if docstringPart:
                    return QVariant(docstringPart)
                if vcsPart:
                    return QVariant("VCS status: " + vcsPart)
                return QVariant()

        return BrowserModelBase.data(self, index, role)
Ejemplo n.º 9
0
 def __init__( self, shortName, info, parent = None ):
     BrowserModelBase.__init__( self, QVariant( shortName ), parent )
     self.populateModel( info )
     self.setTooltips( Settings().outlineTooltips )
     return
Ejemplo n.º 10
0
 def __init__(self, shortName, info, parent=None):
     BrowserModelBase.__init__(self, QVariant(shortName), parent)
     self.populateModel(info)
     self.setTooltips(Settings().outlineTooltips)
     return