commit before massively user --> User

This commit is contained in:
Nikos Kouremenos 2005-03-02 18:38:27 +00:00
parent 37764c01af
commit 832872f547
3 changed files with 40 additions and 45 deletions

View File

@ -454,11 +454,11 @@ class add_contact_window:
agent_combobox.set_active(jid_agents.index(jid_splited[1])+1)
self.xml.signal_autoconnect(self)
class about_window: #FIXME: (nk) pygtk2.6 has a built-in window for that
class about_window: #FIXME REWRITE: (nk) pygtk2.6 has a built-in window for that
"""Class for about window"""
def delete_event(self, widget):
"""close window"""
del self.plugin.windows['about']
del self.plugin.windows['about'] # remove us from open windows
def on_close(self, widget):
"""When Close button is clicked"""
@ -467,13 +467,13 @@ class about_window: #FIXME: (nk) pygtk2.6 has a built-in window for that
def __init__(self, plugin):
xml = gtk.glade.XML(GTKGUI_GLADE, 'about_window', APP)
self.window = xml.get_widget('about_window')
logo_image = xml.get_widget('logo_image')
logo_image.set_from_file('plugins/gtkgui/pixmaps/logo.png')
xml.get_widget('logo_image').set_from_file('plugins/gtkgui/pixmaps/logo.png')
self.plugin = plugin
xml.signal_connect('gtk_widget_destroy', self.delete_event)
xml.signal_connect('on_close_clicked', self.on_close)
self.plugin.windows['about'] = self # add us to open windows
class confirm_dialog:
"""Class for confirmation dialog"""
@ -529,7 +529,7 @@ class subscription_request_window:
class join_groupchat_window:
def on_join_groupchat_window_destroy(self, widget):
"""close window"""
del self.plugin.windows['join_gc']
del self.plugin.windows['join_gc'] # remove us from open windows
def on_close_button_clicked(self, widget):
"""When Cancel button is clicked"""
@ -562,43 +562,41 @@ class join_groupchat_window:
self.xml.get_widget('nickname_entry').\
set_text(self.plugin.nicks[self.account])
self.xml.signal_autoconnect(self)
self.plugin.windows['join_gc'] = self # now add us to open windows
class new_message_window: #FIXME: NOT READY
def delete_event(self, widget):
def on_delete_event(self, widget):
"""close window"""
del self.plugin.windows['join_gc']
del self.plugin.windows['new_msg']
def on_close(self, widget):
def on_cancel_button_clicked(self, widget):
"""When Cancel button is clicked"""
widget.get_toplevel().destroy()
def on_join(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()
jid = '%s@%s' % (room, server)
self.plugin.windows[self.account]['gc'][jid] = gtkgui.gc(jid, nick, \
self.plugin, self.account)
#TODO: verify entries
self.plugin.send('GC_JOIN', self.account, (nick, room, server, passw))
def on_chat_button_clicked(self, widget):
"""When Chat button is clicked"""
print 'chat btn clicked'
userid = self.xml.get_widget('userid_comboboxentry').child.get_text()
#FIXME: if the user doesn't give jid, but name look in the roster
#DO IT WITH AUTOCOMPLETE
#SO USER ID SHOULD BECOME JID and sent to new_chat()
jid = userid
user = gtkgui.user(jid, name .....)
# use User class, new_chat expects that
user().jid = jid
self.plugin.roster.new_chat(jid, self.account)
widget.get_toplevel().destroy()
def __init__(self, plugin, account, server='', room = ''):
#FIXME:
return True
def __init__(self, plugin, account):
if not plugin.connected[account]:
warning_dialog(_("You must be connected to join a group chat on this server"))
warning_dialog(_('You must be connected to send a message to a contact'))
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, 'new_message_window', APP)
self.window = self.xml.get_widget('new_message_window')
self.xml.signal_autoconnect(self)
self.plugin.windows['new_message'] = self # now add us to open windows

View File

@ -8241,6 +8241,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="delete_event" handler="delete_event" last_modification_time="Wed, 02 Mar 2005 16:14:38 GMT"/>
<child>
<widget class="GtkVBox" id="vbox47">
@ -8301,7 +8302,7 @@ send a chat message to</property>
</child>
<child>
<widget class="GtkComboBoxEntry" id="userID_comboboxentry">
<widget class="GtkComboBoxEntry" id="userid_comboboxentry">
<property name="visible">True</property>
</widget>
<packing>
@ -8315,10 +8316,10 @@ send a chat message to</property>
<widget class="GtkHButtonBox" id="hbuttonbox16">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">0</property>
<property name="spacing">5</property>
<child>
<widget class="GtkButton" id="button28">
<widget class="GtkButton" id="cancel_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
@ -8326,6 +8327,7 @@ send a chat message to</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_button_clicked" last_modification_time="Wed, 02 Mar 2005 16:36:13 GMT"/>
</widget>
</child>
@ -8336,6 +8338,7 @@ send a chat message to</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_chat_button_clicked" last_modification_time="Wed, 02 Mar 2005 16:16:54 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment40">

View File

@ -2028,22 +2028,17 @@ class roster_window:
def on_join_gc(self, widget, account):
"""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_groupchat_window(self.plugin, account)
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)
new_message_window(self.plugin, account)
def on_about_menuitem_activate(self, widget):
"""When about is selected :
call the about class"""
if not self.plugin.windows.has_key('about'):
self.plugin.windows['about'] = about_window(self.plugin)
about_window(self.plugin)
def on_accounts_menuitem_activate(self, widget):
"""When accounts is seleted :
@ -2366,7 +2361,6 @@ class roster_window:
self.window.set_title(start + " Gajim")
def __init__(self, plugin):
# FIXME : handle no file ...
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'gajim_window', APP)
self.window = self.xml.get_widget('gajim_window')
self.tree = self.xml.get_widget('roster_treeview')