diff options
author | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2004-02-27 00:03:36 +0000 |
---|---|---|
committer | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2004-02-27 00:03:36 +0000 |
commit | 9b40ad769070c6bc7af8faa30396d1d22ffcc64d (patch) | |
tree | 14a2c78262d8eb5fa4ac0eae2fd3be0fa5eac8d2 /bin/commander/provideritem.py | |
parent | 9dc7d05ee816c70ab021c55e68d668ef8b48cc9f (diff) | |
download | bitbake-9b40ad769070c6bc7af8faa30396d1d22ffcc64d.tar.gz |
update
Diffstat (limited to 'bin/commander/provideritem.py')
-rw-r--r-- | bin/commander/provideritem.py | 64 |
1 files changed, 50 insertions, 14 deletions
diff --git a/bin/commander/provideritem.py b/bin/commander/provideritem.py index df5b16866..31dc5cc43 100644 --- a/bin/commander/provideritem.py +++ b/bin/commander/provideritem.py @@ -5,20 +5,35 @@ from qt import * from appinfo import * from packages import Packages -class ProviderItem( QListViewItem ): +class ProviderItem( QListViewItem ): #QCheckListItem columns = { "PROVIDES": 0, - "CATEGORY": 3, - "SECTION": 4, - "PRIORITY": 5, - "MAINTAINER": 6, - "SRC_URI": 7, - "HOMEPAGE": 8, - "DEPENDS": 9, - "RDEPENDS": 10, - "SHORTNAME": 11 } + "CHECK": 1, + "unpack":2, "patch":3, "configure":4, "compile":5, "stage":6, "install":7, + "STATUS": 8, + "CATEGORY": 9, + "SECTION": 10, + "PRIORITY": 11, + "MAINTAINER": 12, + "SRC_URI": 13, + "HOMEPAGE": 14, + "DEPENDS": 15, + "RDEPENDS": 16, + "SHORTNAME": 17 } + icons = {} + def __init__( self, parent, provider ): + + if not ProviderItem.icons: + ProviderItem.icons = { "unpack" : QPixmap( imageDir + "do_unpack.png" ), + "patch" : QPixmap( imageDir + "do_patch.png" ), + "configure" : QPixmap( imageDir + "do_configure.png" ), + "compile" : QPixmap( imageDir + "do_compile.png" ), + "stage" : QPixmap( imageDir + "do_stage.png" ), + "install" : QPixmap( imageDir + "do_install.png" ) } + + self.parent = parent self.p = Packages.instance() self.fullname = provider @@ -35,22 +50,40 @@ class ProviderItem( QListViewItem ): vparent.setPixmap( 0, QPixmap( imageDir + "virtual.png" ) ) QListViewItem.__init__( self, vparent, provider ) + #QCheckListItem.__init__( self, vparent, provider, QCheckListItem.CheckBox ) else: QListViewItem.__init__( self, parent, provider ) + #QCheckListItem.__init__( self, parent, provider, QCheckListItem.CheckBox ) self.decorate() self.setPixmap( 0, QPixmap( imageDir + "package.png" ) ) - - + + self.setCheckStatus( False ) + def virtualValue( self ): #print self.p.data(self.fullname, "PROVIDES" ) providers = self.p.data(self.fullname, "PROVIDES" ).split() for p in providers: if p.split( '/' )[0] == "virtual": return p + def setCheckStatus( self, checked ): + self.checked = checked + if self.checked: + self.setPixmap( 1, QPixmap( imageDir + "checked.png" ) ) + else: + self.setPixmap( 1, QPixmap( imageDir + "unchecked.png" ) ) + + def setBuildStatus( self, **args ): + for el in args: + if el in ProviderItem.columns: + self.setPixmap( ProviderItem.columns[el], ( QPixmap(), ProviderItem.icons[el] )[ args[el] ] ) + if "status" in args: + self.setText( ProviderItem.columns["STATUS"], args["status"] ) + def decorate( self ): - if not self.fullname.startswith( "virtual" ): - self.st( "PROVIDES", self.fullname.split('/')[-1] ) + if self.fullname.startswith( "virtual" ): + return + self.st( "PROVIDES", self.fullname.split('/')[-1] ) self.st( "CATEGORY", self.p.data(self.fullname, "CATEGORY") ) self.st( "SECTION", self.p.data(self.fullname, "SECTION") ) self.st( "PRIORITY", self.p.data(self.fullname, "PRIORITY") ) @@ -63,6 +96,9 @@ class ProviderItem( QListViewItem ): def st( self, column, value ): self.setText( ProviderItem.columns[column], value ) + + def toggleCheck( self ): + self.setCheckStatus( not self.checked ) #------------------------------------------------------------------------# # main |