show the correct cursor and block only right click on conversation textview
This commit is contained in:
parent
8717bb11ad
commit
bbbeba0b48
|
@ -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
|
||||
|
|
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue