diff --git a/src/history_window.py b/src/history_window.py index 93c695054..f8edd64bf 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -1,4 +1,4 @@ -## plugins/history_window.py +## history_window.py ## ## Gajim Team: ## - Yann Le Boulanger @@ -35,12 +35,10 @@ class History_window: """Class for bowser agent window: to know the agents on the selected server""" def on_history_window_destroy(self, widget): - """close window""" del self.plugin.windows['logs'][self.jid] def on_close_button_clicked(self, widget): - """When Close button is clicked""" - widget.get_toplevel().destroy() + self.window.destroy() def on_earliest_button_clicked(self, widget): start, end = self.history_buffer.get_bounds() @@ -141,12 +139,16 @@ class History_window: _('Status is now: ') + data[0] + ': ' + msg, 'status') - def __init__(self, plugin, jid): + def __init__(self, plugin, account, jid): self.plugin = plugin self.jid = jid self.nb_line = gajim.logger.get_nb_line(jid) xml = gtk.glade.XML(GTKGUI_GLADE, 'history_window', APP) self.window = xml.get_widget('history_window') + list_users = self.plugin.roster.contacts[account][self.jid] + user = list_users[0] + title = 'Conversation History with ' + user.name + self.window.set_title(title) self.history_buffer = xml.get_widget('history_textview').get_buffer() self.earliest_button = xml.get_widget('earliest_button') self.previous_button = xml.get_widget('previous_button') diff --git a/src/roster_window.py b/src/roster_window.py index ce3aac600..c28319adb 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -454,10 +454,10 @@ class Roster_window: dlg.run() def on_history(self, widget, user): - '''When history button is pressed : call log window''' + '''When history button is pressed: call log window''' if not self.plugin.windows['logs'].has_key(user.jid): self.plugin.windows['logs'][user.jid] = history_window.\ - History_window(self.plugin, user.jid) + History_window(self.plugin, self.account, user.jid) def mk_menu_user(self, event, iter): '''Make user's popup menu''' diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index debcfbf6b..d7aabdac0 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -143,7 +143,7 @@ class Tabbed_chat_window(chat.Chat): self.plugin.windows['logs'][jid].present() else: self.plugin.windows['logs'][jid] = history_window.\ - History_window(self.plugin, jid) + History_window(self.plugin, self.account, jid) def remove_tab(self, jid): if time.time() - self.last_message_time[jid] < 2: