diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py index 07b5726ed..40da5a836 100644 --- a/plugins/gtkgui/config.py +++ b/plugins/gtkgui/config.py @@ -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 diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index 1ca2f8d2c..a46d11873 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -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():