Added bookmarks for *EVERY* button in chat window and GC window.

This commit is contained in:
js 2008-05-09 09:34:38 +00:00
parent 115006fa14
commit b04250cf9f
4 changed files with 35 additions and 8 deletions

View File

@ -187,7 +187,7 @@
<widget class="GtkButton" id="send_file_button">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">Send a file</property>
<property name="tooltip" translatable="yes">Send a file (Ctrl-F)</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
@ -209,7 +209,7 @@
<widget class="GtkButton" id="convert_to_gc_button">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">Invite contacts to the conversation</property>
<property name="tooltip" translatable="yes">Invite contacts to the conversation (Ctrl-G)</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">False</property>
<property name="response_id">0</property>
@ -611,7 +611,7 @@
<widget class="GtkButton" id="change_nick_button">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">Change your nickname</property>
<property name="tooltip" translatable="yes">Change your nickname (Ctrl-N)</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="response_id">0</property>
<child>
@ -633,7 +633,7 @@
<widget class="GtkButton" id="change_subject_button">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">Change the room's subject</property>
<property name="tooltip" translatable="yes">Change the room's subject (Ctrl-T)</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="response_id">0</property>
<child>
@ -655,7 +655,7 @@
<widget class="GtkButton" id="bookmark_button">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">Bookmark this room</property>
<property name="tooltip" translatable="yes">Bookmark this room (Ctrl-B)</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="response_id">0</property>
<child>

View File

@ -1705,6 +1705,10 @@ class ChatControl(ChatControlBase):
convert_to_gc_menuitem.set_image(muc_icon)
ag = gtk.accel_groups_from_object(self.parent_win.window)[0]
send_file_menuitem.add_accelerator('activate', ag, gtk.keysyms.f, gtk.gdk.CONTROL_MASK,
gtk.ACCEL_VISIBLE)
convert_to_gc_menuitem.add_accelerator('activate', ag, gtk.keysyms.g, gtk.gdk.CONTROL_MASK,
gtk.ACCEL_VISIBLE)
history_menuitem.add_accelerator('activate', ag, gtk.keysyms.h, gtk.gdk.CONTROL_MASK,
gtk.ACCEL_VISIBLE)
information_menuitem.add_accelerator('activate', ag, gtk.keysyms.i,

View File

@ -561,6 +561,12 @@ class GroupchatControl(ChatControlBase):
def prepare_context_menu(self):
'''sets sensitivity state for configure_room'''
ag = gtk.accel_groups_from_object(self.parent_win.window)[0]
self.change_nick_menuitem.add_accelerator('activate', ag, gtk.keysyms.n,
gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
self.change_subject_menuitem.add_accelerator('activate', ag, gtk.keysyms.t,
gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
self.bookmark_room_menuitem.add_accelerator('activate', ag, gtk.keysyms.b,
gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
self.history_menuitem.add_accelerator('activate', ag, gtk.keysyms.h,
gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
if self.contact.jid in gajim.config.get_per('accounts', self.account,

View File

@ -86,9 +86,11 @@ class MessageWindow(object):
id = self.window.connect('focus-in-event', self._on_window_focus)
self.handlers[id] = self.window
keys=['<Control>h', '<Control>i', '<Control><Shift>Tab',
'<Control>Tab', '<Control>F4', '<Control>w',
'<Alt>Right', '<Alt>Left', '<Alt>c', 'Escape'] +\
keys=['<Control>f', '<Control>g', '<Control>h', '<Control>i',
'<Control>n', '<Control>t', '<Control>b',
'<Control><Shift>Tab', '<Control>Tab',
'<Control>F4', '<Control>w', '<Alt>Right',
'<Alt>Left', '<Alt>c', 'Escape'] +\
['<Alt>'+str(i) for i in xrange(10)]
accel_group = gtk.AccelGroup()
for key in keys:
@ -290,8 +292,23 @@ class MessageWindow(object):
if keyval == gtk.keysyms.h:
control._on_history_menuitem_activate()
elif control.type_id == message_control.TYPE_CHAT and \
keyval == gtk.keysyms.f:
control._on_send_file_menuitem_activate(None)
elif control.type_id == message_control.TYPE_CHAT and \
keyval == gtk.keysyms.g:
control._on_convert_to_gc_menuitem_activate(None)
elif control.type_id == message_control.TYPE_CHAT and \
keyval == gtk.keysyms.i:
control._on_contact_information_menuitem_activate(None)
elif control.type_id == message_control.TYPE_GC and \
keyval == gtk.keysyms.n:
control._on_change_nick_menuitem_activate(None)
elif control.type_id == message_control.TYPE_GC and \
keyval == gtk.keysyms.t:
control._on_change_subject_menuitem_activate(None)
elif control.type_id == message_control.TYPE_GC and \
keyval == gtk.keysyms.b:
control._on_bookmark_room_menuitem_activate(None)
# Tab switch bindings
elif keyval == gtk.keysyms.ISO_Left_Tab: # CTRL + SHIFT + TAB
self.move_to_next_unread_tab(False)