From c19e0f0bd440762e318dab12a0223d341a58d00b Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 24 Jun 2005 16:46:45 +0000 Subject: [PATCH] add an INFORMATION event from connection to gui --- src/common/connection.py | 16 ++++++++-------- src/gajim.py | 11 ++++++++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 138ac44d4..c0587ba4c 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -111,14 +111,14 @@ class Connection: """Connection class""" def __init__(self, name): # dict of function to be called for each event - self.handlers = {'ROSTER': [], 'WARNING': [], 'ERROR': [], 'STATUS': [], - 'NOTIFY': [], 'MSG': [], 'MSGERROR': [], 'MSGSENT': [] , - 'SUBSCRIBED': [], 'UNSUBSCRIBED': [], 'SUBSCRIBE': [], - 'AGENT_INFO': [], 'REGISTER_AGENT_INFO': [], 'AGENT_INFO_ITEMS': [], - 'AGENT_INFO_INFO': [], 'QUIT': [], 'ACC_OK': [], 'MYVCARD': [], - 'OS_INFO': [], 'VCARD': [], 'GC_MSG': [], 'GC_SUBJECT': [], - 'GC_CONFIG': [], 'BAD_PASSPHRASE': [], 'ROSTER_INFO': [], - 'ERROR_ANSWER': [], 'BOOKMARKS': [],} + self.handlers = {'ROSTER': [], 'WARNING': [], 'ERROR': [], + 'INFORMATION': [], 'STATUS': [], 'NOTIFY': [], 'MSG': [], + 'MSGERROR': [], 'MSGSENT': [] , 'SUBSCRIBED': [], 'UNSUBSCRIBED': [], + 'SUBSCRIBE': [], 'AGENT_INFO': [], 'REGISTER_AGENT_INFO': [], + 'AGENT_INFO_ITEMS': [], 'AGENT_INFO_INFO': [], 'QUIT': [], + 'ACC_OK': [], 'MYVCARD': [], 'OS_INFO': [], 'VCARD': [], 'GC_MSG': [], + 'GC_SUBJECT': [], 'GC_CONFIG': [], 'BAD_PASSPHRASE': [], + 'ROSTER_INFO': [], 'ERROR_ANSWER': [], 'BOOKMARKS': [],} self.name = name self.connected = 0 # offline self.connection = None # xmpppy instance diff --git a/src/gajim.py b/src/gajim.py index 534846ab1..d4eff4b43 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -173,15 +173,19 @@ class Interface: #('ROSTER', account, array) self.roster.mklists(data, account) self.roster.draw_roster() - + def handle_event_warning(self, unused, data): #('WARNING', account, (title_text, section_text)) dialogs.WarningDialog(data[0], data[1]).get_response() - + def handle_event_error(self, unused, data): #('ERROR', account, (title_text, section_text)) dialogs.ErrorDialog(data[0], data[1]).get_response() - + + def handle_event_information(self, unused, data): + #('INFORMATION', account, (title_text, section_text)) + dialogs.InformationDialog(data[0], data[1]).get_response() + def handle_event_error_answer(self, account, array): #('ERROR_ANSWER', account, (jid_from. errmsg, errcode)) jid_from = array[0] @@ -722,6 +726,7 @@ class Interface: conn.register_handler('ROSTER', self.handle_event_roster) conn.register_handler('WARNING', self.handle_event_warning) conn.register_handler('ERROR', self.handle_event_error) + conn.register_handler('INFORMATION', self.handle_event_information) conn.register_handler('ERROR_ANSWER', self.handle_event_error_answer) conn.register_handler('STATUS', self.handle_event_status) conn.register_handler('NOTIFY', self.handle_event_notify)