comparison frontends/wix/profile.py @ 43:8a438a6ff587

Wix: added avatar in profile - plugin XEP-0054: added getProfileFile bridge method
author Goffi <goffi@goffi.org>
date Mon, 21 Dec 2009 15:11:50 +1100
parents 874de3020e1c
children a5b5fb5fc9fd
comparison
equal deleted inserted replaced
42:874de3020e1c 43:8a438a6ff587
35 self.name_dict = { 'fullname': 'Full Name', 35 self.name_dict = { 'fullname': 'Full Name',
36 'nick' : 'Nickname', 36 'nick' : 'Nickname',
37 'birthday' : 'Birthday', 37 'birthday' : 'Birthday',
38 'phone' : 'Phone #', 38 'phone' : 'Phone #',
39 'website' : 'Website', 39 'website' : 'Website',
40 'email' : 'E-mail' 40 'email' : 'E-mail',
41 'avatar' : 'Avatar'
41 } 42 }
42 self.ctl_list = {} # usefull to access ctrl, key = (name) 43 self.ctl_list = {} # usefull to access ctrl, key = (name)
43 44
44 self.sizer = wx.BoxSizer(wx.VERTICAL) 45 self.sizer = wx.BoxSizer(wx.VERTICAL)
45 self.notebook=wx.Notebook(self, -1) 46 self.notebook=wx.Notebook(self, -1)
67 value = data[field] if data.has_key(field) else '' 68 value = data[field] if data.has_key(field) else ''
68 label=wx.StaticText(generaltab, -1, self.name_dict[field]+": ") 69 label=wx.StaticText(generaltab, -1, self.name_dict[field]+": ")
69 sizer.Add(label) 70 sizer.Add(label)
70 self.ctl_list[field] = wx.TextCtrl(generaltab, -1, value, style = flags) 71 self.ctl_list[field] = wx.TextCtrl(generaltab, -1, value, style = flags)
71 sizer.Add(self.ctl_list[field], 1, flag = wx.EXPAND) 72 sizer.Add(self.ctl_list[field], 1, flag = wx.EXPAND)
73 #Avatar
74 if data.has_key('avatar'):
75 filename = self.host.bridge.getAvatarFile(data['avatar'])
76 label=wx.StaticText(generaltab, -1, self.name_dict['avatar']+": ")
77 sizer.Add(label)
78 img = wx.Image(filename).ConvertToBitmap()
79 self.ctl_list['avatar'] = wx.StaticBitmap(generaltab, -1, img)
80 sizer.Add(self.ctl_list['avatar'], 0)
81
72 82
73 83
74 self.notebook.AddPage(generaltab, "General") 84 self.notebook.AddPage(generaltab, "General")
75 85
76 86