force the infos = {} when we call Account_modificaion_window

print special words in status messages
This commit is contained in:
Yann Leboulanger 2005-03-10 23:21:30 +00:00
parent f38048904c
commit 3b4a2f748a
2 changed files with 24 additions and 9 deletions

View file

@ -1274,7 +1274,7 @@ class Account_modification_window:
password_entry.set_text('')
#infos must be a dictionnary
def __init__(self, plugin, infos = {}):
def __init__(self, plugin, infos):
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'account_modification_window', APP)
self.window = self.xml.get_widget('account_modification_window')
self.plugin = plugin
@ -1327,7 +1327,7 @@ class Accounts_window:
"""When new button is clicked : open an account information window"""
if not self.plugin.windows.has_key('account_modification_window'):
self.plugin.windows['account_modification_window'] = \
Account_modification_window(self.plugin)
Account_modification_window(self.plugin, {})
def on_delete_button_clicked(self, widget):
"""When delete button is clicked :

View file

@ -692,7 +692,7 @@ class tabbed_chat_window:
#we launch the correct application
self.plugin.launch_browser_mailer(kind, word)
def print_special_text(self, text, jid, contact = ''):
def print_special_text(self, text, jid, contact):
conversation_textview = self.xmls[jid].get_widget('conversation_textview')
conversation_buffer = conversation_textview.get_buffer()
@ -734,6 +734,10 @@ class tabbed_chat_window:
print tag
end_iter = conversation_buffer.get_end_iter()
if tag in ['bold', 'italic', 'underline'] and contact == 'status':
conversation_buffer.insert_with_tags_by_name(end_iter, text,\
'status', tag)
else:
conversation_buffer.insert_with_tags_by_name(end_iter, text, tag)
def print_conversation(self, text, jid, contact = '', tim = None):
@ -772,8 +776,11 @@ class tabbed_chat_window:
else:
ttext = '<' + name + '> '
otext = text + '\n'
#if it's a status we print special words
if tag != 'status':
conversation_buffer.insert_with_tags_by_name(end_iter, ttext, tag)
else:
otext = ttext
start = 0
end = 0
@ -791,12 +798,20 @@ class tabbed_chat_window:
if start != 0:
text_before_special_text = otext[index:start]
end_iter = conversation_buffer.get_end_iter()
if tag == 'status':
conversation_buffer.insert_with_tags_by_name(end_iter, \
text_before_special_text, tag)
else:
conversation_buffer.insert(end_iter, text_before_special_text)
self.print_special_text(special_text, jid, contact)
index = end # update index
#add the rest in the index and after
end_iter = conversation_buffer.get_end_iter()
if tag == 'status':
conversation_buffer.insert_with_tags_by_name(end_iter, \
otext[index:], tag)
else:
conversation_buffer.insert(end_iter, otext[index:])
#scroll to the end of the textview
@ -2840,7 +2855,7 @@ class roster_window:
if len(self.plugin.accounts) == 0:
self.plugin.windows['accounts_window'] = Accounts_window(self.plugin)
self.plugin.windows['account_modification_window'] = \
Account_modification_window(self.plugin)
Account_modification_window(self.plugin, {})
class systrayDummy:
"""Class when we don't want icon in the systray"""