yann have a look
This commit is contained in:
parent
7f5822ea92
commit
608d3542d0
7 changed files with 26 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Set the C flags to include the GTK+ and Python libraries
|
# 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`
|
LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0`
|
||||||
|
|
||||||
# Build the shared object
|
# Build the shared object
|
||||||
|
|
|
@ -56,6 +56,7 @@ class Chat:
|
||||||
self.names = {} # what is printed in the tab : user.name for example
|
self.names = {} # what is printed in the tab : user.name for example
|
||||||
self.childs = {}
|
self.childs = {}
|
||||||
self.window = self.xml.get_widget(widget_name)
|
self.window = self.xml.get_widget(widget_name)
|
||||||
|
self.widget_name = widget_name
|
||||||
|
|
||||||
def update_tags(self):
|
def update_tags(self):
|
||||||
for jid in self.tagIn:
|
for jid in self.tagIn:
|
||||||
|
@ -91,12 +92,10 @@ class Chat:
|
||||||
start = "* "
|
start = "* "
|
||||||
chat = self.names[jid]
|
chat = self.names[jid]
|
||||||
if len(self.xmls) > 1: # if more than one tabs in the same window
|
if len(self.xmls) > 1: # if more than one tabs in the same window
|
||||||
|
if self.widget_name == 'tabbed_chat_window':
|
||||||
chat = 'Chat'
|
chat = 'Chat'
|
||||||
#FIXME: doesn't work
|
elif self.widget_name == 'groupchat_window':
|
||||||
# if isinstance(self.window, Tabbed_chat_window):
|
chat = 'Groupchat'
|
||||||
# chat = 'Chat'
|
|
||||||
# elif isinstance(self.window, Groupchat_window):
|
|
||||||
# chat = 'Groupchat'
|
|
||||||
if len(self.plugin.accounts.keys()) >= 2: # if we have 2 or more accounts
|
if len(self.plugin.accounts.keys()) >= 2: # if we have 2 or more accounts
|
||||||
title = start + chat + ' (account: ' + self.account + ')'
|
title = start + chat + ' (account: ' + self.account + ')'
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -324,7 +324,7 @@ class Change_status_message_dialog:
|
||||||
message_comboboxentry.append_text(val)
|
message_comboboxentry.append_text(val)
|
||||||
self.xml.signal_autoconnect(self)
|
self.xml.signal_autoconnect(self)
|
||||||
|
|
||||||
class add_contact_window:
|
class Add_contact_window:
|
||||||
"""Class for add_contact_window"""
|
"""Class for add_contact_window"""
|
||||||
def on_cancel_button_clicked(self, widget):
|
def on_cancel_button_clicked(self, widget):
|
||||||
"""When Cancel button is clicked"""
|
"""When Cancel button is clicked"""
|
||||||
|
@ -520,7 +520,7 @@ class subscription_request_window:
|
||||||
self.plugin.send('AUTH', self.account, self.jid)
|
self.plugin.send('AUTH', self.account, self.jid)
|
||||||
widget.get_toplevel().destroy()
|
widget.get_toplevel().destroy()
|
||||||
if not self.plugin.roster.contacts[self.account].has_key(self.jid):
|
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):
|
def on_deny_button_clicked(self, widget):
|
||||||
"""refuse the request"""
|
"""refuse the request"""
|
||||||
|
@ -537,7 +537,7 @@ class subscription_request_window:
|
||||||
xml.get_widget('message_textview').get_buffer().set_text(text)
|
xml.get_widget('message_textview').get_buffer().set_text(text)
|
||||||
xml.signal_autoconnect(self)
|
xml.signal_autoconnect(self)
|
||||||
|
|
||||||
class join_groupchat_window:
|
class Join_groupchat_window:
|
||||||
def on_join_groupchat_window_destroy(self, widget):
|
def on_join_groupchat_window_destroy(self, widget):
|
||||||
"""close window"""
|
"""close window"""
|
||||||
del self.plugin.windows['join_gc'] # remove us from open windows
|
del self.plugin.windows['join_gc'] # remove us from open windows
|
||||||
|
@ -557,6 +557,8 @@ class join_groupchat_window:
|
||||||
#TODO: verify entries
|
#TODO: verify entries
|
||||||
self.plugin.send('GC_JOIN', self.account, (nickname, room, server, \
|
self.plugin.send('GC_JOIN', self.account, (nickname, room, server, \
|
||||||
password))
|
password))
|
||||||
|
|
||||||
|
#FIXME: call active_tab()
|
||||||
widget.get_toplevel().destroy()
|
widget.get_toplevel().destroy()
|
||||||
|
|
||||||
def __init__(self, plugin, account, server='', room = ''):
|
def __init__(self, plugin, account, server='', room = ''):
|
||||||
|
|
|
@ -44,6 +44,7 @@ class Groupchat_window(Chat):
|
||||||
self.nicks = {}
|
self.nicks = {}
|
||||||
self.list_treeview = {}
|
self.list_treeview = {}
|
||||||
self.subjects = {}
|
self.subjects = {}
|
||||||
|
self.account = account
|
||||||
self.new_group(room_jid, nick)
|
self.new_group(room_jid, nick)
|
||||||
self.show_title()
|
self.show_title()
|
||||||
self.xml.signal_connect('on_groupchat_window_destroy', \
|
self.xml.signal_connect('on_groupchat_window_destroy', \
|
||||||
|
@ -81,6 +82,16 @@ class Groupchat_window(Chat):
|
||||||
def on_chat_notebook_key_press_event(self, widget, event):
|
def on_chat_notebook_key_press_event(self, widget, event):
|
||||||
Chat.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):
|
def get_role_iter(self, room_jid, role):
|
||||||
model = self.list_treeview[room_jid].get_model()
|
model = self.list_treeview[room_jid].get_model()
|
||||||
fin = False
|
fin = False
|
||||||
|
|
|
@ -7053,8 +7053,6 @@ Custom</property>
|
||||||
<property name="tab_pos">GTK_POS_TOP</property>
|
<property name="tab_pos">GTK_POS_TOP</property>
|
||||||
<property name="scrollable">True</property>
|
<property name="scrollable">True</property>
|
||||||
<property name="enable_popup">False</property>
|
<property name="enable_popup">False</property>
|
||||||
<signal name="switch_page" handler="on_chat_notebook_switch_page" last_modification_time="Sat, 05 Mar 2005 10:57:01 GMT"/>
|
|
||||||
<signal name="key_press_event" handler="on_chat_notebook_key_press_event" last_modification_time="Sat, 12 Mar 2005 21:19:23 GMT"/>
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkVBox" id="gc_vbox">
|
<widget class="GtkVBox" id="gc_vbox">
|
||||||
|
|
|
@ -888,12 +888,12 @@ class roster_window:
|
||||||
def on_add_contact(self, widget, account):
|
def on_add_contact(self, widget, account):
|
||||||
"""When add user is selected :
|
"""When add user is selected :
|
||||||
call the add_contact_window class"""
|
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):
|
def on_join_gc_activate(self, widget, account):
|
||||||
"""When Join Groupchat is selected :
|
"""When Join Groupchat is selected :
|
||||||
call the join_gc class"""
|
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):
|
def on_new_message_menuitem_activate(self, widget, account):
|
||||||
"""When new message menuitem is activated:
|
"""When new message menuitem is activated:
|
||||||
|
|
Loading…
Add table
Reference in a new issue