show the correct cursor and block only right click on conversation textview

This commit is contained in:
Yann Leboulanger 2005-03-10 18:53:55 +00:00
parent 8717bb11ad
commit bbbeba0b48
2 changed files with 28 additions and 4 deletions

View File

@ -173,8 +173,31 @@ class preferences_window:
def on_use_tabbed_chat_window_checkbutton_toggled(self, widget):
"""On Use Tabbed Chat Window Checkbutton Toggled"""
if widget.get_active():
buf1 = {}
buf2 = {}
jids = {}
#save buffers and close windows
for acct in self.plugin.accounts:
buf1[acct] = {}
buf2[acct] = {}
jids[acct] = self.plugin.windows[acct]['chats'].keys()
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'][jid].window.destroy()
self.plugin.config['usetabbedchat'] = 1
#TODO: merge opened chat windows
#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])
else:
self.plugin.config['usetabbedchat'] = 0
#TODO: split the tabbed chat window

View File

@ -609,7 +609,7 @@ class tabbed_chat_window:
x, y = widget.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT, x, y)
tags = widget.get_iter_at_location(x, y).get_tags()
if self.change_cursor:
widget.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(None)
widget.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gtk.gdk.XTERM)
self.change_cursor = None
for tag in tags:
if tag == widget.get_buffer().get_tag_table().lookup('url') or \
@ -620,8 +620,9 @@ class tabbed_chat_window:
return False
def on_conversation_textview_button_press_event(self, widget, event):
# Do not open the standard popup menu
return True
# Do not open the standard popup menu, so we block right button click
if event.button == 3:
return True
def print_time_timeout(self, jid):
if not jid in self.xmls.keys():