diff --git a/src/common/gajim.py b/src/common/gajim.py index f330ddf28292f5cde10e4b8d5ae2ed2e81ec9a21..376a081fa31a6f75efd53460ee8f367379249493 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -84,6 +84,7 @@ def get_contact_instances_from_jid(account, jid): return contacts_instances def get_first_contact_instance_from_jid(account, jid): + print 'jIIIIIIIIIIIIIIIIIIID', jid if jid in contacts[account]: contact = contacts[account][jid][0] else: # it's fake jid diff --git a/src/history_window.py b/src/history_window.py index b62184c10600ea88a9b1bef6fae92f312822da28..855522875fa20289c75175681816b28685dd5748 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -48,8 +48,8 @@ class HistoryWindow: self.forward_button.set_sensitive(True) self.latest_button.set_sensitive(True) end = 50 - if end > self.nb_line: - end = self.nb_line + if end > self.no_of_lines: + end = self.no_of_lines nb, lines = gajim.logger.read(self.jid, 0, end) self.set_buttons_sensitivity(nb) for line in lines: @@ -67,8 +67,8 @@ class HistoryWindow: if begin < 0: begin = 0 end = begin + 50 - if end > self.nb_line: - end = self.nb_line + if end > self.no_of_lines: + end = self.no_of_lines nb, lines = gajim.logger.read(self.jid, begin, end) self.set_buttons_sensitivity(nb) for line in lines: @@ -83,11 +83,11 @@ class HistoryWindow: self.forward_button.set_sensitive(True) self.latest_button.set_sensitive(True) begin = self.num_begin + 50 - if begin > self.nb_line: - begin = self.nb_line + if begin > self.no_of_lines: + begin = self.no_of_lines end = begin + 50 - if end > self.nb_line: - end = self.nb_line + if end > self.no_of_lines: + end = self.no_of_lines nb, lines = gajim.logger.read(self.jid, begin, end) self.set_buttons_sensitivity(nb) for line in lines: @@ -101,10 +101,10 @@ class HistoryWindow: self.previous_button.set_sensitive(True) self.forward_button.set_sensitive(False) self.latest_button.set_sensitive(False) - begin = self.nb_line - 50 + begin = self.no_of_lines - 50 if begin < 0: begin = 0 - nb, lines = gajim.logger.read(self.jid, begin, self.nb_line) + nb, lines = gajim.logger.read(self.jid, begin, self.no_of_lines) self.set_buttons_sensitivity(nb) for line in lines: self.new_line(line[0], line[1], line[2:]) @@ -114,7 +114,7 @@ class HistoryWindow: if nb == 50: self.earliest_button.set_sensitive(False) self.previous_button.set_sensitive(False) - if nb == self.nb_line: + if nb == self.no_of_lines: self.forward_button.set_sensitive(False) self.latest_button.set_sensitive(False) @@ -152,7 +152,7 @@ class HistoryWindow: tag_name = 'outgoing' else: status_msg = ':'.join(data[1:]) - msg = _('Status is now: ') + data[0] + ': ' + status_msg + msg = _('Status is now: %s: %s') % (data[0], status_msg) tag_msg = 'status' if name: @@ -169,15 +169,14 @@ class HistoryWindow: self.plugin = plugin self.jid = jid self.account = account - self.nb_line = gajim.logger.get_nb_line(jid) + self.no_of_lines = gajim.logger.get_no_of_lines(jid) xml = gtk.glade.XML(GTKGUI_GLADE, 'history_window', APP) self.window = xml.get_widget('history_window') if account and gajim.contacts[account].has_key(jid): - contacts_list = gajim.contacts[account][self.jid] - user = contacts_list[0] - title = 'Conversation History with ' + user.name + contact = gajim.get_first_contact_instance_from_jid(account, jid) + title = _('Conversation History with %s') % contact.name else: - title = 'Conversation History with ' + jid + title = _('Conversation History with %s') % jid self.window.set_title(title) self.history_buffer = xml.get_widget('history_textview').get_buffer() self.earliest_button = xml.get_widget('earliest_button') @@ -199,9 +198,9 @@ class HistoryWindow: tag.set_property('foreground', color) begin = 0 - if self.nb_line > 50: - begin = self.nb_line - 50 - nb, lines = gajim.logger.read(self.jid, begin, self.nb_line) + if self.no_of_lines > 50: + begin = self.no_of_lines - 50 + nb, lines = gajim.logger.read(self.jid, begin, self.no_of_lines) self.set_buttons_sensitivity(nb) for line in lines: self.new_line(line[0], line[1], line[2:]) diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index 5fefb7308ef4e6f630e2f60d9cba7b970b042682..19ac1a820a110ab3b64b04cbf2bc0b7a82ea8bdd 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -654,7 +654,7 @@ class TabbedChatWindow(chat.Chat): pos = 0 #position, while reading from history size = 0 #how many lines we alreay retreived lines = [] #we'll need to reverse the lines from history - count = gajim.logger.get_nb_line(jid) + count = gajim.logger.get_no_of_lines(jid) if gajim.awaiting_messages[self.account].has_key(jid):