code for merging and spliting chat windows (this code does not work, if anyone has an idea ... )

This commit is contained in:
Yann Leboulanger 2005-03-15 21:06:59 +00:00
parent a1f7e8751c
commit 1246126276

View file

@ -172,35 +172,58 @@ class preferences_window:
def on_use_tabbed_chat_window_checkbutton_toggled(self, widget): def on_use_tabbed_chat_window_checkbutton_toggled(self, widget):
"""On Use Tabbed Chat Window Checkbutton Toggled""" """On Use Tabbed Chat Window Checkbutton Toggled"""
buf1 = {}
buf2 = {}
jids = {}
if widget.get_active(): if widget.get_active():
buf1 = {} #FIXME Does not work
buf2 = {}
jids = {}
#save buffers and close windows #save buffers and close windows
for acct in self.plugin.accounts: # for acct in self.plugin.accounts:
buf1[acct] = {} # buf1[acct] = {}
buf2[acct] = {} # buf2[acct] = {}
jids[acct] = self.plugin.windows[acct]['chats'].keys() # jids[acct] = self.plugin.windows[acct]['chats'].keys()
for jid in jids[acct]: # for jid in jids[acct]:
buf1[acct][jid] = self.plugin.windows[acct]['chats'][jid].\ # buf1[acct][jid] = self.plugin.windows[acct]['chats'][jid].\
xmls[jid].get_widget('conversation_textview').get_buffer() # xmls[jid].get_widget('conversation_textview').get_buffer()
buf2[acct][jid] = self.plugin.windows[acct]['chats'][jid].\ # buf2[acct][jid] = self.plugin.windows[acct]['chats'][jid].\
xmls[jid].get_widget('message_textview').get_buffer() # xmls[jid].get_widget('message_textview').get_buffer()
self.plugin.windows[acct]['chats'][jid].window.destroy() # self.plugin.windows[acct]['chats'][jid].window.destroy()
self.plugin.config['usetabbedchat'] = 1 self.plugin.config['usetabbedchat'] = 1
#open new tabbed chat windows #open new tabbed chat windows
for acct in self.plugin.accounts: # for acct in self.plugin.accounts:
for jid in jids[acct]: # for jid in jids[acct]:
user = self.plugin.roster.contacts[acct][jid][0] # user = self.plugin.roster.contacts[acct][jid][0]
self.plugin.roster.new_chat(user, acct) # self.plugin.roster.new_chat(user, acct)
self.plugin.windows[acct]['chats'][jid].xmls[jid].\ # self.plugin.windows[acct]['chats'][jid].xmls[jid].\
get_widget('conversation_textview').set_buffer(\ # get_widget('conversation_textview').set_buffer(\
buf1[acct][jid]) # buf1[acct][jid])
self.plugin.windows[acct]['chats'][jid].xmls[jid].\ # self.plugin.windows[acct]['chats'][jid].xmls[jid].\
get_widget('message_textview').set_buffer(buf2[acct][jid]) # get_widget('message_textview').set_buffer(buf2[acct][jid])
else: else:
#save buffers and close tabbed chat windows
# for acct in self.plugin.accounts:
# buf1[acct] = {}
# buf2[acct] = {}
# jids[acct] = self.plugin.windows[acct]['chats'].keys()
# if 'tabbed' in jids[acct]:
# jids[acct].remove('tabbed')
# for jid in jids[acct]:
# buf1[acct][jid] = self.plugin.windows[acct]['chats'][jid].\
# xmls[jid].get_widget('conversation_textview').get_buffer()
# buf2[acct][jid] = self.plugin.windows[acct]['chats'][jid].\
# xmls[jid].get_widget('message_textview').get_buffer()
# self.plugin.windows[acct]['chats']['tabbed'].window.destroy()
self.plugin.config['usetabbedchat'] = 0 self.plugin.config['usetabbedchat'] = 0
#TODO: split the tabbed chat window #open new tabbed chat windows
# for acct in self.plugin.accounts:
# for jid in jids[acct]:
# user = self.plugin.roster.contacts[acct][jid][0]
# self.plugin.roster.new_chat(user, acct)
# self.plugin.windows[acct]['chats'][jid].xmls[jid].\
# get_widget('conversation_textview').set_buffer(\
# buf1[acct][jid])
# self.plugin.windows[acct]['chats'][jid].xmls[jid].\
# get_widget('message_textview').set_buffer(buf2[acct][jid])
def update_text_tags(self): def update_text_tags(self):
"""Update Opened Chat Windows""" """Update Opened Chat Windows"""