yann have a look

This commit is contained in:
Nikos Kouremenos 2005-03-16 20:48:56 +00:00
parent 7f5822ea92
commit 608d3542d0
7 changed files with 26 additions and 16 deletions

View file

@ -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

View file

@ -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:

View file

@ -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 = ''):

View file

@ -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()

View file

@ -7053,8 +7053,6 @@ Custom</property>
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">True</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>
<widget class="GtkVBox" id="gc_vbox">

View file

@ -1,8 +1,8 @@
## plugins/gtkgui.py
##
## Gajim Team:
## - Yann Le Boulanger <asterix@lagaule.org>
## - Vincent Hanquez <tab@snarc.org>
## - Yann Le Boulanger <asterix@lagaule.org>
## - Vincent Hanquez <tab@snarc.org>
## - Nikos Kouremenos <kourem@gmail.com>
## - Alex Podaras <bigpod@gmail.com>
##

View file

@ -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: