| ... |
... |
@@ -56,6 +56,8 @@ class ProfileWindow: |
|
56
|
56
|
|
|
57
|
57
|
self.account = account
|
|
58
|
58
|
self.jid = app.get_jid_from_account(account)
|
|
|
59
|
+ account_label = app.config.get_per('accounts', account, 'account_label')
|
|
|
60
|
+ self.set_value('account_label', account_label)
|
|
59
|
61
|
|
|
60
|
62
|
self.dialog = None
|
|
61
|
63
|
self.avatar_mime_type = None
|
| ... |
... |
@@ -67,9 +69,6 @@ class ProfileWindow: |
|
67
|
69
|
self.update_progressbar)
|
|
68
|
70
|
self.remove_statusbar_timeout_id = None
|
|
69
|
71
|
|
|
70
|
|
- # Create Image for avatar button
|
|
71
|
|
- image = Gtk.Image()
|
|
72
|
|
- self.xml.get_object('PHOTO_button').set_image(image)
|
|
73
|
72
|
self.xml.connect_signals(self)
|
|
74
|
73
|
app.ged.register_event_handler('vcard-published', ged.GUI1,
|
|
75
|
74
|
self._nec_vcard_published)
|
| ... |
... |
@@ -111,13 +110,11 @@ class ProfileWindow: |
|
111
|
110
|
def _clear_photo(self, widget):
|
|
112
|
111
|
# empty the image
|
|
113
|
112
|
button = self.xml.get_object('PHOTO_button')
|
|
114
|
|
- image = button.get_image()
|
|
|
113
|
+ image = self.xml.get_object('PHOTO_image')
|
|
115
|
114
|
image.set_from_pixbuf(None)
|
|
116
|
115
|
button.hide()
|
|
117
|
116
|
text_button = self.xml.get_object('NOPHOTO_button')
|
|
118
|
117
|
text_button.show()
|
|
119
|
|
- remove_avatar = self.xml.get_object('remove_avatar')
|
|
120
|
|
- remove_avatar.hide()
|
|
121
|
118
|
self.avatar_encoded = None
|
|
122
|
119
|
self.avatar_sha = None
|
|
123
|
120
|
self.avatar_mime_type = None
|
| ... |
... |
@@ -134,15 +131,12 @@ class ProfileWindow: |
|
134
|
131
|
surface = app.interface.get_avatar(sha, AvatarSize.VCARD, scale)
|
|
135
|
132
|
|
|
136
|
133
|
button = self.xml.get_object('PHOTO_button')
|
|
137
|
|
- image = button.get_image()
|
|
|
134
|
+ image = self.xml.get_object('PHOTO_image')
|
|
138
|
135
|
image.set_from_surface(surface)
|
|
139
|
136
|
button.show()
|
|
140
|
137
|
text_button = self.xml.get_object('NOPHOTO_button')
|
|
141
|
138
|
text_button.hide()
|
|
142
|
139
|
|
|
143
|
|
- remove_avatar = self.xml.get_object('remove_avatar')
|
|
144
|
|
- remove_avatar.show()
|
|
145
|
|
-
|
|
146
|
140
|
self.avatar_sha = sha
|
|
147
|
141
|
publish = app.interface.get_avatar(sha, publish=True)
|
|
148
|
142
|
self.avatar_encoded = base64.b64encode(publish).decode('utf-8')
|
| ... |
... |
@@ -200,15 +194,13 @@ class ProfileWindow: |
|
200
|
194
|
|
|
201
|
195
|
def set_values(self, vcard_):
|
|
202
|
196
|
button = self.xml.get_object('PHOTO_button')
|
|
203
|
|
- image = button.get_image()
|
|
|
197
|
+ image = self.xml.get_object('PHOTO_image')
|
|
204
|
198
|
text_button = self.xml.get_object('NOPHOTO_button')
|
|
205
|
|
- remove_avatar = self.xml.get_object('remove_avatar')
|
|
206
|
199
|
if not 'PHOTO' in vcard_:
|
|
207
|
200
|
# set default image
|
|
208
|
201
|
image.set_from_pixbuf(None)
|
|
209
|
202
|
button.hide()
|
|
210
|
203
|
text_button.show()
|
|
211
|
|
- remove_avatar.hide()
|
|
212
|
204
|
for i in vcard_.keys():
|
|
213
|
205
|
if i == 'PHOTO':
|
|
214
|
206
|
photo_encoded = vcard_[i]['BINVAL']
|
| ... |
... |
@@ -230,7 +222,6 @@ class ProfileWindow: |
|
230
|
222
|
scale)
|
|
231
|
223
|
image.set_from_surface(surface)
|
|
232
|
224
|
button.show()
|
|
233
|
|
- remove_avatar.show()
|
|
234
|
225
|
text_button.hide()
|
|
235
|
226
|
continue
|
|
236
|
227
|
if i == 'ADR' or i == 'TEL' or i == 'EMAIL':
|
| ... |
... |
@@ -293,7 +284,7 @@ class ProfileWindow: |
|
293
|
284
|
"""
|
|
294
|
285
|
Make the vCard dictionary
|
|
295
|
286
|
"""
|
|
296
|
|
- entries = ['FN', 'NICKNAME', 'BDAY', 'EMAIL_HOME_USERID', 'URL',
|
|
|
287
|
+ entries = ['FN', 'NICKNAME', 'BDAY', 'EMAIL_HOME_USERID', 'JABBERID', 'URL',
|
|
297
|
288
|
'TEL_HOME_NUMBER', 'N_FAMILY', 'N_GIVEN', 'N_MIDDLE', 'N_PREFIX',
|
|
298
|
289
|
'N_SUFFIX', 'ADR_HOME_STREET', 'ADR_HOME_EXTADR', 'ADR_HOME_LOCALITY',
|
|
299
|
290
|
'ADR_HOME_REGION', 'ADR_HOME_PCODE', 'ADR_HOME_CTRY', 'ORG_ORGNAME',
|