change callback, widget and variable names for join groupchat window in glade and in the code

This commit is contained in:
Yann Leboulanger 2005-03-02 12:32:44 +00:00
parent 57ae71d5ff
commit 6d6b9796f0
4 changed files with 34 additions and 32 deletions

View File

@ -1269,7 +1269,7 @@ class agent_browser_window:
room = services[0]
service = services[1]
if not self.plugin.windows.has_key('join_gc'):
self.plugin.windows['join_gc'] = join_gc(self.plugin, self.account, service, room)
self.plugin.windows['join_gc'] = join_groupchat_window(self.plugin, self.account, service, room)
def on_register_button_clicked(self, widget):
"""When we want to register an agent :

View File

@ -522,42 +522,42 @@ class subscription_request_Window:
xml.get_widget('message_textview').get_buffer().set_text(text)
xml.signal_autoconnect(self)
class join_gc:
def delete_event(self, widget):
class join_groupchat_window:
def on_join_groupchat_window_destroy(self, widget):
"""close window"""
del self.plugin.windows['join_gc']
def on_close(self, widget):
def on_close_button_clicked(self, widget):
"""When Cancel button is clicked"""
widget.get_toplevel().destroy()
def on_join(self, widget):
def on_join_button_clicked(self, widget):
"""When Join button is clicked"""
nick = self.xml.get_widget('entry_nick').get_text()
room = self.xml.get_widget('entry_room').get_text()
server = self.xml.get_widget('entry_server').get_text()
passw = self.xml.get_widget('entry_pass').get_text()
nickname = self.xml.get_widget('nickname_entry').get_text()
room = self.xml.get_widget('room_entry').get_text()
server = self.xml.get_widget('server_entry').get_text()
password = self.xml.get_widget('passwrd_entry').get_text()
jid = '%s@%s' % (room, server)
self.plugin.windows[self.account]['gc'][jid] = gtkgui.gc(jid, nick, \
self.plugin.windows[self.account]['gc'][jid] = gtkgui.gc(jid, nickname,\
self.plugin, self.account)
#TODO: verify entries
self.plugin.send('GC_JOIN', self.account, (nick, room, server, passw))
self.plugin.send('GC_JOIN', self.account, (nickname, room, server, \
password))
widget.get_toplevel().destroy()
def __init__(self, plugin, account, server='', room = ''):
if not plugin.connected[account]:
warning_dialog(_("You must be connected to join a group chat on this serveur"))
warning_dialog(_('You must be connected to join a group chat on this serveur'))
return
self.plugin = plugin
self.account = account
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'Join_gc', APP)
self.window = self.xml.get_widget('Join_gc')
self.xml.get_widget('entry_server').set_text(server)
self.xml.get_widget('entry_room').set_text(room)
self.xml.get_widget('entry_nick').set_text(self.plugin.nicks[self.account])
self.xml.signal_connect('gtk_widget_destroy', self.delete_event)
self.xml.signal_connect('on_cancel_clicked', self.on_close)
self.xml.signal_connect('on_join_clicked', self.on_join)
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'join_groupchat_window', APP)
self.window = self.xml.get_widget('join_groupchat_window')
self.xml.get_widget('server_entry').set_text(server)
self.xml.get_widget('room_entry').set_text(room)
self.xml.get_widget('nickname_entry').\
set_text(self.plugin.nicks[self.account])
self.xml.signal_autoconnect(self)
class new_message_window: #FIXME: NOT READY
def delete_event(self, widget):

View File

@ -7398,7 +7398,7 @@ Custom</property>
</child>
</widget>
<widget class="GtkWindow" id="Join_gc">
<widget class="GtkWindow" id="join_groupchat_window">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Join Groupchat</property>
@ -7412,7 +7412,7 @@ Custom</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="destroy" handler="gtk_widget_destroy" last_modification_time="Tue, 03 Aug 2004 22:05:29 GMT"/>
<signal name="destroy" handler="on_join_groupchat_window_destroy" last_modification_time="Wed, 02 Mar 2005 12:20:14 GMT"/>
<child>
<widget class="GtkVBox" id="vbox28">
@ -7527,7 +7527,7 @@ Custom</property>
</child>
<child>
<widget class="GtkEntry" id="entry_nick">
<widget class="GtkEntry" id="nickname_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
@ -7548,7 +7548,7 @@ Custom</property>
</child>
<child>
<widget class="GtkEntry" id="entry_room">
<widget class="GtkEntry" id="room_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
@ -7569,7 +7569,7 @@ Custom</property>
</child>
<child>
<widget class="GtkEntry" id="entry_server">
<widget class="GtkEntry" id="server_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
@ -7590,7 +7590,7 @@ Custom</property>
</child>
<child>
<widget class="GtkEntry" id="entry_pass">
<widget class="GtkEntry" id="password_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
@ -7636,7 +7636,7 @@ Custom</property>
<property name="spacing">20</property>
<child>
<widget class="GtkButton" id="button23">
<widget class="GtkButton" id="cancel_utton">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
@ -7644,18 +7644,18 @@ Custom</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_cancel_clicked" last_modification_time="Tue, 03 Aug 2004 22:06:07 GMT"/>
<signal name="clicked" handler="on_cancel_utton_clicked" last_modification_time="Wed, 02 Mar 2005 12:19:37 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button24">
<widget class="GtkButton" id="join_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_join_clicked" last_modification_time="Tue, 03 Aug 2004 22:06:23 GMT"/>
<signal name="clicked" handler="on_join_button_clicked" last_modification_time="Wed, 02 Mar 2005 12:19:22 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment25">

View File

@ -2028,13 +2028,15 @@ class roster_window:
"""When Join Groupchat is selected :
call the join_gc class"""
if not self.plugin.windows.has_key('join_gc'):
self.plugin.windows['join_gc'] = join_gc(self.plugin, account)
self.plugin.windows['join_gc'] = \
join_groupchat_window(self.plugin, account)
def on_new_message_menuitem_activate(self, widget, account):
"""When New Message is activated:
call the new_message_window class"""
if not self.plugin.windows.has_key('new_message'):
self.plugin.windows['new_message'] = new_message_window(self.plugin, account)
self.plugin.windows['new_message'] = \
new_message_window(self.plugin, account)
def on_about_menuitem_activate(self, widget):
"""When about is selected :