diff --git a/data/glade/vcard_information_window.glade b/data/glade/vcard_information_window.glade index 79d0aa135391566919a0c98a0105f50481e9856a..34b6da092ebefaddd103b70bfdec0af06192eb75 100644 --- a/data/glade/vcard_information_window.glade +++ b/data/glade/vcard_information_window.glade @@ -2553,6 +2553,21 @@ <property name="fill">True</property> </packing> </child> + + <child> + <widget class="GtkProgressBar" id="progressbar"> + <property name="visible">True</property> + <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> + <property name="fraction">0</property> + <property name="pulse_step">0.10000000149</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> </child> </widget> diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 8b249fc60de554ac72f3ca5a9ab6bac739727f7b..c29cf539a122de5ea5172186990a239f2b8ee0ca 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1134,6 +1134,12 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco) raise common.xmpp.NodeProcessed def _ErrorCB(self, con, iq_obj): + gajim.log.debug('ErrorCB') + if iq_obj.getQueryNS() == common.xmpp.NS_VERSION: + who = helpers.get_full_jid_from_iq(iq_obj) + jid_stripped, resource = gajim.get_room_and_nick_from_fjid(who) + self.dispatch('OS_INFO', (jid_stripped, resource, '', '')) + return errmsg = iq_obj.getErrorMsg() errcode = iq_obj.getErrorCode() jid_from = helpers.get_full_jid_from_iq(iq_obj) diff --git a/src/gajim.py b/src/gajim.py index 4a602a397c827c196fa33950e5a4493988cacac4..609fafd13efcf8f3b292e2e1a27e35a5b52ce4fc 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -850,6 +850,7 @@ class Interface: self.remote_ctrl.raise_signal('LastStatusTime', (account, array)) def handle_event_os_info(self, account, array): + #'OS_INFO' (account, (jid, resource, client_info, os_info)) win = None if self.instances[account]['infos'].has_key(array[0]): win = self.instances[account]['infos'][array[0]] diff --git a/src/vcard.py b/src/vcard.py index ee36e1e3306c7021b3493fc99d1fa541fffd53e9..bdee6b1db9e0152d66977b83d3caba6cee3c7fbe 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -61,6 +61,7 @@ class VcardWindow: # the contact variable is the jid if vcard is true self.xml = gtkgui_helpers.get_glade('vcard_information_window.glade') self.window = self.xml.get_widget('vcard_information_window') + self.progressbar = self.xml.get_widget('progressbar') self.contact = contact self.account = account @@ -68,13 +69,23 @@ class VcardWindow: self.avatar_mime_type = None self.avatar_encoded = None + self.vcard_arrived = False + self.os_info_arrived = False + self.update_progressbar_timeout_id = gobject.timeout_add(100, + self.update_progressbar) self.fill_jabber_page() self.xml.signal_autoconnect(self) self.window.show_all() + def update_progressbar(self): + self.progressbar.pulse() + return True # loop forever + def on_vcard_information_window_destroy(self, widget): + if self.update_progressbar_timeout_id is not None: + gobject.source_remove(self.update_progressbar_timeout_id) del gajim.interface.instances[self.account]['infos'][self.contact.jid] def on_vcard_information_window_key_press_event(self, widget, event): @@ -154,6 +165,15 @@ class VcardWindow: vcard[i], 0) else: self.set_value(i + '_label', vcard[i]) + self.vcard_arrived = True + self.test_remove_progressbar() + + def test_remove_progressbar(self): + if self.update_progressbar_timeout_id is not None and \ + self.vcard_arrived and self.os_info_arrived: + gobject.source_remove(self.update_progressbar_timeout_id) + self.progressbar.hide() + self.update_progressbar_timeout_id = None def set_last_status_time(self): self.fill_status_label() @@ -182,6 +202,8 @@ class VcardWindow: os = Q_('?OS:Unknown') self.xml.get_widget('client_name_version_label').set_text(client) self.xml.get_widget('os_label').set_text(os) + self.os_info_arrived = True + self.test_remove_progressbar() def fill_status_label(self): if self.xml.get_widget('information_notebook').get_n_pages() < 4: