fixes allover

This commit is contained in:
Nikos Kouremenos 2005-03-16 17:08:38 +00:00
parent fd836e2a6d
commit 75fb6ac1f7
6 changed files with 35 additions and 28 deletions

View File

@ -458,7 +458,7 @@ class GajimCore:
elif typ == 'error':
errmsg = prs.getError()
errcode = prs.getErrorCode()
if errcode == '400': #Bad Request : JID Malformed or Private message when not allowed
if errcode == '400': #Bad Request: JID Malformed or Private message when not allowed
pass
elif errcode == '401': #No Password Provided
pass
@ -560,13 +560,13 @@ class GajimCore:
except common.xmlstream.socket.error, e:
log.debug("Couldn't connect to %s %s" % (hostname, e))
self.hub.sendPlugin('STATUS', account, 'offline')
self.hub.sendPlugin('ERROR', None, _("Couldn't connect to %s : %s") \
self.hub.sendPlugin('ERROR', None, _("Couldn't connect to %s: %s") \
% (hostname, e))
return 0
except common.xmlstream.error, e:
log.debug("Couldn't connect to %s %s" % (hostname, e))
self.hub.sendPlugin('STATUS', account, 'offline')
self.hub.sendPlugin('ERROR', None, _("Couldn't connect to %s : %s") \
self.hub.sendPlugin('ERROR', None, _("Couldn't connect to %s: %s") \
% (hostname, e))
return 0
# except:
@ -852,7 +852,7 @@ class GajimCore:
c.setRegInfo( 'username', ev[2][1])
c.setRegInfo( 'password', ev[2][2])
if not c.sendRegInfo():
self.hub.sendPlugin('ERROR', None, _('Error : ')+c.lastErr)
self.hub.sendPlugin('ERROR', None, _('Error: ')+c.lastErr)
else:
self.connected[ev[2][3]] = 0
self.passwords[ev[2][3]] = ''

View File

@ -74,7 +74,7 @@ class Chat:
del self.print_time_timeout_id[jid]
else:
for jid in self.xmls:
if not self.print_time_timeout_id.has_key(jid):
if not self.print_time_timeout_id.has_key(pjid):
self.print_time_timeout(jid)
self.print_time_timeout_id[jid] = gobject.timeout_add(300000, \
self.print_time_timeout, jid)
@ -91,11 +91,15 @@ class Chat:
start = "* "
chat = self.names[jid]
if len(self.xmls) > 1: # if more than one tabs in the same window
chat = 'Chat'
if isinstance(self.window, Tabbed_chat_window):
chat = 'Chat'
elif isinstance(self.window, 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:
title = start + chat
self.window.set_title(title)
def redraw_tab(self, jid):
@ -270,9 +274,6 @@ class Chat:
current = self.notebook.get_current_page()
if current > 0:
self.notebook.set_current_page(current-1)
# else:
# self.notebook.set_current_page(\
# self.notebook.get_n_pages()-1)
elif event.state & gtk.gdk.SHIFT_MASK:
conversation_textview = self.xmls[jid].\
get_widget('conversation_textview')
@ -285,9 +286,8 @@ class Chat:
current = self.notebook.get_current_page()
if current < (self.notebook.get_n_pages()-1):
self.notebook.set_current_page(current+1)
# else:
# self.notebook.set_current_page(0)
elif event.state & gtk.gdk.SHIFT_MASK:
print 'yes'
conversation_textview = self.xmls[jid].\
get_widget('conversation_textview')
rect = conversation_textview.get_visible_rect()

View File

@ -7824,7 +7824,7 @@ Custom</property>
<property name="width_request">303</property>
<property name="height_request">225</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Status Message for</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
@ -9030,6 +9030,12 @@ send a chat message to</property>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator4">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="offline_menuitem">
<property name="visible">True</property>
@ -9058,7 +9064,7 @@ send a chat message to</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image472">
<widget class="GtkImage" id="image473">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>

View File

@ -32,7 +32,7 @@ gtk.glade.textdomain(APP)
GTKGUI_GLADE='plugins/gtkgui/gtkgui.glade'
class history_window:
"""Class for bowser agent window :
"""Class for bowser agent window:
to know the agents on the selected server"""
def on_history_window_destroy(self, widget):
"""close window"""
@ -129,7 +129,7 @@ class history_window:
msg = ':'.join(infos[3][1:])
msg = msg.replace('\\n', '\n')
self.history_buffer.insert_with_tags_by_name(start_iter, \
_('Status is now : ') + infos[3][0]+' : ' + msg, 'status')
_('Status is now: ') + infos[3][0]+': ' + msg, 'status')
def set_nb_line(self, nb_line):
self.nb_line = nb_line

View File

@ -260,7 +260,7 @@ class roster_window:
for account in self.plugin.accounts.keys():
item = gtk.MenuItem(_('using ') + account + _(' account'))
sub_menu.append(item)
item.connect("activate", self.on_join_gc, account)
item.connect("activate", self.on_join_gc_activate, account)
sub_menu.show_all()
#new message
sub_menu = gtk.Menu()
@ -282,7 +282,7 @@ class roster_window:
#join_gc
if not self.join_gc_handler_id:
self.join_gc_handler_id = join_gc_menuitem.connect(\
'activate', self.on_join_gc, self.plugin.accounts.keys()[0])
'activate', self.on_join_gc_activate, self.plugin.accounts.keys()[0])
if not self.new_message_menuitem_handler_id:
self.new_message_menuitem_handler_id = new_message_menuitem.connect(\
'activate', self.on_new_message_menuitem_activate, self.plugin.accounts.keys()[0])
@ -555,11 +555,12 @@ class roster_window:
item = gtk.MenuItem(_("_Add contact"))
menu.append(item)
item.connect("activate", self.on_add_contact, account)
item = gtk.MenuItem(_('Join _groupchat'))
menu.append(item)
item.connect("activate", self.on_join_gc_activate, account)
item = gtk.MenuItem(_('_New message'))
menu.append(item)
item.connect("activate", self.on_new_message_menuitem_activate, account)
if self.plugin.connected[account] < 2:
item.set_sensitive(False)
menu.popup(None, None, None, event.button, event.time)
menu.show_all()
@ -804,7 +805,7 @@ class roster_window:
if self.plugin.config['usetabbedchat']:
if not self.plugin.windows[account]['chats'].has_key('tabbed'):
self.plugin.windows[account]['chats']['tabbed'] = \
tabbed_chat_window(user, self.plugin, account)
Tabbed_chat_window(user, self.plugin, account)
else:
self.plugin.windows[account]['chats']['tabbed'].new_user(user)
@ -814,7 +815,7 @@ class roster_window:
else:
self.plugin.windows[account]['chats'][user.jid] = \
tabbed_chat_window(user, self.plugin, account)
Tabbed_chat_window(user, self.plugin, account)
def new_group(self, jid, nick, account):
if self.plugin.config['usetabbedchat']:
@ -889,7 +890,7 @@ class roster_window:
call the add_contact_window class"""
add_contact_window(self.plugin, account)
def on_join_gc(self, widget, 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)

View File

@ -38,7 +38,7 @@ gtk.glade.textdomain(APP)
GTKGUI_GLADE='plugins/gtkgui/gtkgui.glade'
class tabbed_chat_window(Chat):
class Tabbed_chat_window(Chat):
"""Class for tabbed chat window"""
def __init__(self, user, plugin, account):
Chat.__init__(self, plugin, account, 'tabbed_chat_window')
@ -150,10 +150,10 @@ class tabbed_chat_window(Chat):
and printed in the conversation"""
if event.keyval == gtk.keysyms.Return:
if (event.state & gtk.gdk.SHIFT_MASK):
return 0
return False
if self.plugin.connected[self.account] < 2: #we are not connected
Error_dialog(_('You are not connected, so you cannot send a message'))
return 1
return True
message_buffer = widget.get_buffer()
start_iter = message_buffer.get_start_iter()
end_iter = message_buffer.get_end_iter()
@ -166,8 +166,8 @@ class tabbed_chat_window(Chat):
self.plugin.send('MSG', self.account, (jid, message, keyID))
message_buffer.set_text('', -1)
self.print_conversation(message, jid, jid)
return 1
return 0
return True
return False
def on_contact_button_clicked(self, widget):
"""When button contact is clicked"""