From c79768cd2802fd00a9db83b8fe47ea3bd53ef06e Mon Sep 17 00:00:00 2001 From: Travis Shirk Date: Thu, 12 Jan 2006 02:36:06 +0000 Subject: [PATCH] Action->History (plus other menu) bug fixes. Closes #1376 --- src/chat_control.py | 22 ++++++++++++---------- src/groupchat_control.py | 12 ++++++------ src/gtkgui.glade | 32 ++++++++++++++++---------------- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index e054fe820..e119c0f4c 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -22,6 +22,7 @@ import gobject import gtkgui_helpers import message_control import dialogs +import history_window from common import gajim from common import helpers @@ -448,13 +449,19 @@ class ChatControlBase(MessageControl): del self.print_time_timeout_id return False - def on_history_menuitem_clicked(self, widget = None, jid = None): + def _on_history_menuitem_activate(self, widget = None, jid = None): + if not jid: + jid = self.contact.jid '''When history menuitem is pressed: call history window''' if gajim.interface.instances['logs'].has_key(jid): gajim.interface.instances['logs'][jid].window.present() else: - gajim.interface.instances['logs'][jid] = history_window.HistoryWindow( - jid, self.account) + gajim.interface.instances['logs'][jid] = \ + history_window.HistoryWindow(jid, self.account) + + def _on_compact_view_menuitem_activate(self, widget): + isactive = widget.get_active() + self.set_compact_view(isactive) def set_control_active(self, state): if state: @@ -1400,10 +1407,6 @@ class ChatControl(ChatControlBase): cursor = gtk.gdk.Cursor(gtk.gdk.LEFT_PTR) self.bigger_avatar_window.window.set_cursor(cursor) - def _on_compact_view_menuitem_activate(self, widget): - isactive = widget.get_active() - self.set_compact_view(isactive) - def _on_send_file_menuitem_activate(self, widget): gajim.interface.instances['file_transfers'].show_file_send_request( self.account, self.contact) @@ -1411,10 +1414,9 @@ class ChatControl(ChatControlBase): def _on_add_to_roster_menuitem_activate(self, widget): dialogs.AddNewContactWindow(self.account, self.contact.jid) - def _on_contact_information_menuitem_clicked(self, widget): + def _on_contact_information_menuitem_activate(self, widget): gajim.interface.roster.on_info(widget, self.contact, self.account) - def on_toggle_gpg_menuitem_activate(self, widget): - jid = self.get_active_jid() + def _on_toggle_gpg_menuitem_activate(self, widget): tb = self.xml.get_widget('gpg_togglebutton') tb.set_active(not tb.get_active()) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 7cce60ff3..f4f4fd8e3 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -1071,7 +1071,7 @@ class GroupchatControl(ChatControlBase): nb += len(gajim.awaiting_events[self.account][fjid]) return nb - def on_change_subject_menuitem_activate(self, widget): + def _on_change_subject_menuitem_activate(self, widget): instance = dialogs.InputDialog(_('Changing Subject'), _('Please specify the new subject:'), self.subject) response = instance.get_response() @@ -1080,15 +1080,15 @@ class GroupchatControl(ChatControlBase): subject = instance.input_entry.get_text().decode('utf-8') gajim.connections[self.account].send_gc_subject(self.room_jid, subject) - def on_change_nick_menuitem_activate(self, widget): + def _on_change_nick_menuitem_activate(self, widget): title = _('Changing Nickname') prompt = _('Please specify the new nickname you want to use:') self.show_change_nick_input_dialog(title, prompt, self.nick) - def on_configure_room_menuitem_activate(self, widget): + def _on_configure_room_menuitem_activate(self, widget): gajim.connections[self.account].request_gc_config(self.room_jid) - def on_bookmark_room_menuitem_activate(self, widget): + def _on_bookmark_room_menuitem_activate(self, widget): bm = { 'name': self.name, 'jid': self.room_jid, @@ -1510,9 +1510,9 @@ class GroupchatControl(ChatControlBase): gajim.interface.instances[self.account]['infos'][c2.jid] = \ vcard.VcardWindow(c2, self.account, False) - def on_history(self, widget, ck): + def on_history(self, widget, nick): jid = gajim.construct_fjid(self.room_jid, nick) - self.on_history_menuitem_clicked(jid = jid) + self._on_history_menuitem_activate(widget = widget, jid = jid) def on_add_to_roster(self, widget, jid): dialogs.AddNewContactWindow(self.account, jid) diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 4cc7702db..a7553c2e1 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -14678,10 +14678,10 @@ Banner Click to see past conversation in this room _History True - + - + True gtk-justify-fill 1 @@ -14698,10 +14698,10 @@ Banner Configure _Room True - + - + True gtk-preferences 1 @@ -14718,10 +14718,10 @@ Banner Change _Subject True - + - + True gtk-edit 1 @@ -14738,10 +14738,10 @@ Banner Change _Nickname True - + - + True gtk-redo 1 @@ -14758,10 +14758,10 @@ Banner _Bookmark This Room True - + - + True gtk-add 1 @@ -14779,7 +14779,7 @@ Banner _Compact View Alt+C True False - + @@ -14792,10 +14792,10 @@ Banner Click to see past conversations with this contact _History True - + - + True gtk-justify-fill 1 @@ -14813,7 +14813,7 @@ Banner True gtk-dialog-info True - + @@ -14825,7 +14825,7 @@ Banner - + True gtk-file 1 @@ -14866,7 +14866,7 @@ Banner - + True gtk-add 1