diff --git a/Core/core.py b/Core/core.py index 311124282..9a1c3d03e 100644 --- a/Core/core.py +++ b/Core/core.py @@ -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]] = '' diff --git a/plugins/gtkgui/chat.py b/plugins/gtkgui/chat.py index 310e8c840..b3b588216 100644 --- a/plugins/gtkgui/chat.py +++ b/plugins/gtkgui/chat.py @@ -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() diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade index d49de2ff6..2538c136f 100644 --- a/plugins/gtkgui/gtkgui.glade +++ b/plugins/gtkgui/gtkgui.glade @@ -7824,7 +7824,7 @@ Custom 303 225 True - Status Message for + GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False @@ -9030,6 +9030,12 @@ send a chat message to + + + True + + + True @@ -9058,7 +9064,7 @@ send a chat message to True - + True gtk-new 1 diff --git a/plugins/gtkgui/history_window.py b/plugins/gtkgui/history_window.py index 8524e8bca..50861db38 100644 --- a/plugins/gtkgui/history_window.py +++ b/plugins/gtkgui/history_window.py @@ -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 diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index 318134701..3fb525912 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -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,12 +555,13 @@ 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() menu.reposition() @@ -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) diff --git a/plugins/gtkgui/tabbed_chat_window.py b/plugins/gtkgui/tabbed_chat_window.py index 712d3663e..1ce4514d7 100644 --- a/plugins/gtkgui/tabbed_chat_window.py +++ b/plugins/gtkgui/tabbed_chat_window.py @@ -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"""