Action->History (plus other menu) bug fixes. Closes #1376

This commit is contained in:
Travis Shirk 2006-01-12 02:36:06 +00:00
parent 55ac103ffb
commit c79768cd28
3 changed files with 34 additions and 32 deletions

View File

@ -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())

View File

@ -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)

View File

@ -14678,10 +14678,10 @@ Banner</property>
<property name="tooltip" translatable="yes">Click to see past conversation in this room</property>
<property name="label" translatable="yes">_History</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_history_menuitem_clicked" last_modification_time="Thu, 04 Aug 2005 13:57:24 GMT"/>
<signal name="activate" handler="_on_history_menuitem_activate" last_modification_time="Thu, 12 Jan 2006 02:41:11 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1053">
<widget class="GtkImage" id="image1359">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>
@ -14698,10 +14698,10 @@ Banner</property>
<widget class="GtkImageMenuItem" id="configure_room_menuitem">
<property name="label" translatable="yes">Configure _Room</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_configure_room_menuitem_activate" last_modification_time="Mon, 13 Jun 2005 11:04:55 GMT"/>
<signal name="activate" handler="_on_configure_room_menuitem_activate" last_modification_time="Thu, 12 Jan 2006 02:41:11 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1054">
<widget class="GtkImage" id="image1360">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@ -14718,10 +14718,10 @@ Banner</property>
<widget class="GtkImageMenuItem" id="change_subject_menuitem">
<property name="label" translatable="yes">Change _Subject</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_change_subject_menuitem_activate" last_modification_time="Mon, 13 Jun 2005 11:05:10 GMT"/>
<signal name="activate" handler="_on_change_subject_menuitem_activate" last_modification_time="Thu, 12 Jan 2006 02:41:11 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1055">
<widget class="GtkImage" id="image1361">
<property name="visible">True</property>
<property name="stock">gtk-edit</property>
<property name="icon_size">1</property>
@ -14738,10 +14738,10 @@ Banner</property>
<widget class="GtkImageMenuItem" id="change_nick_menuitem">
<property name="label" translatable="yes">Change _Nickname</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_change_nick_menuitem_activate" last_modification_time="Sat, 18 Jun 2005 20:23:46 GMT"/>
<signal name="activate" handler="_on_change_nick_menuitem_activate" last_modification_time="Thu, 12 Jan 2006 02:41:11 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1056">
<widget class="GtkImage" id="image1362">
<property name="visible">True</property>
<property name="stock">gtk-redo</property>
<property name="icon_size">1</property>
@ -14758,10 +14758,10 @@ Banner</property>
<widget class="GtkImageMenuItem" id="bookmark_room_menuitem">
<property name="label" translatable="yes">_Bookmark This Room</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_bookmark_room_menuitem_activate" last_modification_time="Mon, 13 Jun 2005 12:43:29 GMT"/>
<signal name="activate" handler="_on_bookmark_room_menuitem_activate" last_modification_time="Thu, 12 Jan 2006 02:41:11 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1057">
<widget class="GtkImage" id="image1363">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@ -14779,7 +14779,7 @@ Banner</property>
<property name="label" translatable="yes">_Compact View Alt+C</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="on_compact_view_menuitem_activate" last_modification_time="Thu, 30 Jun 2005 13:07:23 GMT"/>
<signal name="activate" handler="_on_compact_view_menuitem_activate" last_modification_time="Thu, 12 Jan 2006 02:41:11 GMT"/>
</widget>
</child>
</widget>
@ -14792,10 +14792,10 @@ Banner</property>
<property name="tooltip" translatable="yes">Click to see past conversations with this contact</property>
<property name="label" translatable="yes">_History</property>
<property name="use_underline">True</property>
<signal name="activate" handler="_on_history_menuitem_clicked" last_modification_time="Tue, 03 Jan 2006 04:27:11 GMT"/>
<signal name="activate" handler="_on_history_menuitem_activate" last_modification_time="Thu, 12 Jan 2006 02:40:18 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1241">
<widget class="GtkImage" id="image1366">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>
@ -14813,7 +14813,7 @@ Banner</property>
<property name="visible">True</property>
<property name="label">gtk-dialog-info</property>
<property name="use_stock">True</property>
<signal name="activate" handler="_on_contact_information_menuitem_clicked" last_modification_time="Tue, 03 Jan 2006 04:27:04 GMT"/>
<signal name="activate" handler="_on_contact_information_menuitem_activate" last_modification_time="Thu, 12 Jan 2006 02:40:18 GMT"/>
</widget>
</child>
@ -14825,7 +14825,7 @@ Banner</property>
<signal name="activate" handler="_on_send_file_menuitem_activate" last_modification_time="Tue, 03 Jan 2006 04:26:55 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1242">
<widget class="GtkImage" id="image1367">
<property name="visible">True</property>
<property name="stock">gtk-file</property>
<property name="icon_size">1</property>
@ -14866,7 +14866,7 @@ Banner</property>
<signal name="activate" handler="_on_add_to_roster_menuitem_activate" last_modification_time="Tue, 03 Jan 2006 04:26:37 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1243">
<widget class="GtkImage" id="image1368">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>