From 608d3542d0e063e4e5e8534db35be81c79b146c8 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 16 Mar 2005 20:48:56 +0000 Subject: [PATCH] yann have a look --- plugins/gtkgui/Makefile | 2 +- plugins/gtkgui/chat.py | 11 +++++------ plugins/gtkgui/dialogs.py | 8 +++++--- plugins/gtkgui/groupchat_window.py | 11 +++++++++++ plugins/gtkgui/gtkgui.glade | 2 -- plugins/gtkgui/gtkgui.py | 4 ++-- plugins/gtkgui/roster_window.py | 4 ++-- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/plugins/gtkgui/Makefile b/plugins/gtkgui/Makefile index 0bf06f78f..064620877 100644 --- a/plugins/gtkgui/Makefile +++ b/plugins/gtkgui/Makefile @@ -1,5 +1,5 @@ # Set the C flags to include the GTK+ and Python libraries -CFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0` -I/usr/include/python2.3/ -I. +CFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0` -I/usr/include/python2.4/ -I. LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0` # Build the shared object diff --git a/plugins/gtkgui/chat.py b/plugins/gtkgui/chat.py index 80997f470..8794534ab 100644 --- a/plugins/gtkgui/chat.py +++ b/plugins/gtkgui/chat.py @@ -56,6 +56,7 @@ class Chat: self.names = {} # what is printed in the tab : user.name for example self.childs = {} self.window = self.xml.get_widget(widget_name) + self.widget_name = widget_name def update_tags(self): for jid in self.tagIn: @@ -91,12 +92,10 @@ class Chat: start = "* " chat = self.names[jid] if len(self.xmls) > 1: # if more than one tabs in the same window - chat = 'Chat' - #FIXME: doesn't work -# if isinstance(self.window, Tabbed_chat_window): -# chat = 'Chat' -# elif isinstance(self.window, Groupchat_window): -# chat = 'Groupchat' + if self.widget_name == 'tabbed_chat_window': + chat = 'Chat' + elif self.widget_name == 'groupchat_window': + chat = 'Groupchat' if len(self.plugin.accounts.keys()) >= 2: # if we have 2 or more accounts title = start + chat + ' (account: ' + self.account + ')' else: diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py index 731af410c..4c3544168 100644 --- a/plugins/gtkgui/dialogs.py +++ b/plugins/gtkgui/dialogs.py @@ -324,7 +324,7 @@ class Change_status_message_dialog: message_comboboxentry.append_text(val) self.xml.signal_autoconnect(self) -class add_contact_window: +class Add_contact_window: """Class for add_contact_window""" def on_cancel_button_clicked(self, widget): """When Cancel button is clicked""" @@ -520,7 +520,7 @@ class subscription_request_window: self.plugin.send('AUTH', self.account, self.jid) widget.get_toplevel().destroy() if not self.plugin.roster.contacts[self.account].has_key(self.jid): - add_contact_window(self.plugin, self.account, self.jid) + Add_contact_window(self.plugin, self.account, self.jid) def on_deny_button_clicked(self, widget): """refuse the request""" @@ -537,7 +537,7 @@ class subscription_request_window: xml.get_widget('message_textview').get_buffer().set_text(text) xml.signal_autoconnect(self) -class join_groupchat_window: +class Join_groupchat_window: def on_join_groupchat_window_destroy(self, widget): """close window""" del self.plugin.windows['join_gc'] # remove us from open windows @@ -557,6 +557,8 @@ class join_groupchat_window: #TODO: verify entries self.plugin.send('GC_JOIN', self.account, (nickname, room, server, \ password)) + + #FIXME: call active_tab() widget.get_toplevel().destroy() def __init__(self, plugin, account, server='', room = ''): diff --git a/plugins/gtkgui/groupchat_window.py b/plugins/gtkgui/groupchat_window.py index 84a518825..bf0d077a5 100644 --- a/plugins/gtkgui/groupchat_window.py +++ b/plugins/gtkgui/groupchat_window.py @@ -44,6 +44,7 @@ class Groupchat_window(Chat): self.nicks = {} self.list_treeview = {} self.subjects = {} + self.account = account self.new_group(room_jid, nick) self.show_title() self.xml.signal_connect('on_groupchat_window_destroy', \ @@ -80,6 +81,16 @@ class Groupchat_window(Chat): def on_chat_notebook_key_press_event(self, widget, event): Chat.on_chat_notebook_key_press_event(self, widget, event) + + def on_chat_notebook_switch_page(self, notebook, page, page_num): + new_child = notebook.get_nth_page(page_num) + new_jid = '' + for jid in self.xmls: + if self.childs[jid] == new_child: + new_jid = jid + break + self.set_subject(self, new_jid, subject) + Chat.on_chat_notebook_switch_page(notebook, page, page_num) def get_role_iter(self, room_jid, role): model = self.list_treeview[room_jid].get_model() diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade index 2538c136f..ea7fae9a5 100644 --- a/plugins/gtkgui/gtkgui.glade +++ b/plugins/gtkgui/gtkgui.glade @@ -7053,8 +7053,6 @@ Custom GTK_POS_TOP True False - - diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index cc699eeaf..b3f9e97ec 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -1,8 +1,8 @@ ## plugins/gtkgui.py ## ## Gajim Team: -## - Yann Le Boulanger -## - Vincent Hanquez +## - Yann Le Boulanger +## - Vincent Hanquez ## - Nikos Kouremenos ## - Alex Podaras ## diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index 3fb525912..afde1916b 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -888,12 +888,12 @@ class roster_window: def on_add_contact(self, widget, account): """When add user is selected : call the add_contact_window class""" - add_contact_window(self.plugin, account) + Add_contact_window(self.plugin, account) def on_join_gc_activate(self, widget, account): """When Join Groupchat is selected : call the join_gc class""" - join_groupchat_window(self.plugin, account) + Join_groupchat_window(self.plugin, account) def on_new_message_menuitem_activate(self, widget, account): """When new message menuitem is activated: