コード例 #1
0
ファイル: mycontacts.py プロジェクト: oppianmal/pybook
 def displayEvolutionContact(self,contId,contFullName):
     ''' Displays corresponding Evolution contact field details in the table in 'summaryViewport' '''
     log.debug("displayEvolutionContact(%s,'%s')" % (contId,contFullName))
     if self.currentContact and contId==self.currentContact[0]:
         log.debug("Attempting to show the same contact - moving on")
         return
     self.currentContact=(contId,contFullName)
     cont=self.getContactById(contId)
     # Now follows the display utility logic
     view,table=contactDetails.initContactDetailView(self)
     contactDetails.setupContactNameLabel(self,contFullName)
     image=cont.get_photo(80)    # gtk.gdk.Pixbuf - you can pull out this photo into a GTKImage        
     contactDetails.setupContactThumbnail(self,image)
     # Populate our table with attr-vals from contact.  
     contactDetails.populateEvolutionContactDetailFields(table,cont) 
     view.show_all()     # To now show the table
コード例 #2
0
ファイル: mycontacts.py プロジェクト: oppianmal/pybook
 def displayVCardContact(self,contId,contFullName):
     ''' Displays corresponding vCard contact field details in the table in 'summaryViewport' '''
     log.debug("displayVcardContact(%s,'%s')" % (contId,contFullName))
     if self.currentContact and contId==self.currentContact[0]:
         log.debug("Attempting to show the same contact - moving on")
         return
     self.currentContact=(contId,contFullName)
     cont=self.getContactById(contId)
     vcf=cont.get_vcard_string()
     vcont=vobject.readOne(vcf)   # Use Chandler vobject library to process Evolution vCard 3.0 format
     view,table=contactDetails.initContactDetailView(self)
     contactDetails.setupContactNameLabel(self,contFullName)
     try:
         if USE_VCARD_THUMBNAIL:
             image=contactDetails.vcardThumbnailToGtkImage(vcont.photo.value)
         else:
             image=cont.get_photo(80)    # gtk.gdk.Pixbuf - you can pull out this photo into a GTKImage        
     except:
         image=None
     contactDetails.setupContactThumbnail(self,image) 
     contactDetails.populateVobjectContactDetailFields(table,vcont)
     view.show_all()     # To now show the table