Changeset 7787 for branches/gajim_0.11/src/profile_window.py
- Timestamp:
- 01/06/07 12:00:50 (23 months ago)
- Files:
-
- 1 modified
-
branches/gajim_0.11/src/profile_window.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11/src/profile_window.py
r7510 r7787 240 240 self.remove_statusbar, self.message_id) 241 241 gobject.source_remove(self.update_progressbar_timeout_id) 242 # redraw progressbar after avatar is set so that windows is already 243 # resized. Else progressbar is not correctly redrawn 244 gobject.idle_add(self.progressbar.set_fraction, 0) 242 self.progressbar.hide() 243 self.progressbar.set_fraction(0) 245 244 self.update_progressbar_timeout_id = None 246 245 … … 300 299 return vcard 301 300 302 def on_ publish_button_clicked(self, widget):301 def on_ok_button_clicked(self, widget): 303 302 if self.update_progressbar_timeout_id: 304 303 # Operation in progress … … 319 318 self.message_id = self.statusbar.push(self.context_id, 320 319 _('Sending profile...')) 320 self.progressbar.show() 321 321 self.update_progressbar_timeout_id = gobject.timeout_add(100, 322 322 self.update_progressbar) 323 323 324 324 def vcard_published(self): 325 if self.message_id:326 self.statusbar.remove(self.context_id, self.message_id)327 self.message_id = self.statusbar.push(self.context_id,328 _('Information published'))329 self.remove_statusbar_timeout_id = gobject.timeout_add(3000,330 self.remove_statusbar, self.message_id)331 325 if self.update_progressbar_timeout_id is not None: 332 326 gobject.source_remove(self.update_progressbar_timeout_id) 333 self.progressbar.set_fraction(0)334 327 self.update_progressbar_timeout_id = None 328 self.window.destroy() 335 329 336 330 def vcard_not_published(self): … … 349 343 'try again later.')) 350 344 351 def on_retrieve_button_clicked(self, widget): 352 if self.update_progressbar_timeout_id: 353 # Operation in progress 354 return 355 entries = ['FN', 'NICKNAME', 'BDAY', 'EMAIL_HOME_USERID', 'URL', 356 'TEL_HOME_NUMBER', 'N_FAMILY', 'N_GIVEN', 'N_MIDDLE', 'N_PREFIX', 357 'N_SUFFIX', 'ADR_HOME_STREET', 'ADR_HOME_EXTADR', 'ADR_HOME_LOCALITY', 358 'ADR_HOME_REGION', 'ADR_HOME_PCODE', 'ADR_HOME_CTRY', 'ORG_ORGNAME', 359 'ORG_ORGUNIT', 'TITLE', 'ROLE', 'ADR_WORK_STREET', 'ADR_WORK_EXTADR', 360 'ADR_WORK_LOCALITY', 'ADR_WORK_REGION', 'ADR_WORK_PCODE', 361 'ADR_WORK_CTRY'] 362 if gajim.connections[self.account].connected > 1: 363 # clear all entries 364 for e in entries: 365 self.xml.get_widget(e + '_entry').set_text('') 366 self.xml.get_widget('DESC_textview').get_buffer().set_text('') 367 button = self.xml.get_widget('PHOTO_button') 368 image = button.get_image() 369 image.set_from_pixbuf(None) 370 button.set_label(_('Click to set your avatar')) 371 gajim.connections[self.account].request_vcard(self.jid) 372 else: 373 dialogs.ErrorDialog(_('You are not connected to the server'), 374 _('Without a connection, you can not get your contact information.')) 375 self.message_id = self.statusbar.push(self.context_id, 376 _('Retrieving profile...')) 377 self.update_progressbar_timeout_id = gobject.timeout_add(100, 378 self.update_progressbar) 379 380 def on_close_button_clicked(self, widget): 345 def on_cancel_button_clicked(self, widget): 381 346 self.window.destroy()
