Use GtkShortcutsWindow to display keyboard shortcuts.
This commit is contained in:
parent
a779066a61
commit
6f6a8d3f39
|
@ -0,0 +1,285 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkShortcutsWindow" id="shortcuts_window">
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<property name="section-name">chat</property>
|
||||
<property name="title" translatable="yes">Chat Shortcuts</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Message composition</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Return</property>
|
||||
<property name="title" translatable="yes">Send the message</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><shift>Return <ctrl>Return</property>
|
||||
<property name="title" translatable="yes">Create a new line</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>m</property>
|
||||
<property name="title" translatable="yes">Select an emoticon</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Tab</property>
|
||||
<property name="title" translatable="yes">Complete a command or a nick</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Up</property>
|
||||
<property name="title" translatable="yes">Previous sent message</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Down</property>
|
||||
<property name="title" translatable="yes">Next sent messages</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><alt>Up</property>
|
||||
<property name="title" translatable="yes">Quote previous message</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><alt>Down</property>
|
||||
<property name="title" translatable="yes">Quote next message</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>u</property>
|
||||
<property name="title" translatable="yes">Clear message entry</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Appearance</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>c</property>
|
||||
<property name="title" translatable="yes">Toggle full / compact view</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Recent history</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><shift>Page_Up</property>
|
||||
<property name="title" translatable="yes">Scroll up</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><shift>Page_Down</property>
|
||||
<property name="title" translatable="yes">Sroll down</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>l</property>
|
||||
<property name="title" translatable="yes">Clear</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Tabs</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Left <ctrl>Page_Up</property>
|
||||
<property name="title" translatable="yes">Switch to the previous tab</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><alt>Right <ctrl>Page_Down</property>
|
||||
<property name="title" translatable="yes">Switch to the next tab</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><Alt>1...9</property>
|
||||
<property name="title" translatable="yes">Switch to the first - ninth tab</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>Tab</property>
|
||||
<property name="title" translatable="yes">Switch to the previous unread tab</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>Tab</property>
|
||||
<property name="title" translatable="yes">Switch to the next unread tab</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Escape <ctrl>w <ctrl>F4</property>
|
||||
<property name="title" translatable="yes">Close chat</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="visible">1</property>
|
||||
<property name="section-name">roster</property>
|
||||
<property name="title" translatable="yes">Roster Shortcuts</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">General</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>a</property>
|
||||
<property name="title" translatable="yes">Accounts</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>p</property>
|
||||
<property name="title" translatable="yes">Preferences</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>t</property>
|
||||
<property name="title" translatable="yes">File transfers</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>n</property>
|
||||
<property name="title" translatable="yes">Start a new chat</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>j</property>
|
||||
<property name="title" translatable="yes">Join a group chat</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>s</property>
|
||||
<property name="title" translatable="yes">Set the status message</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>q</property>
|
||||
<property name="title" translatable="yes">Quit Gajim</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Appearance</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>o</property>
|
||||
<property name="title" translatable="yes">Show offline contacts</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>y</property>
|
||||
<property name="title" translatable="yes">Show only active contacts</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>k</property>
|
||||
<property name="title" translatable="yes">Enable roster filtering</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="visible">1</property>
|
||||
<property name="title" translatable="yes">Contacts</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>i</property>
|
||||
<property name="title" translatable="yes">Contact information</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">F2</property>
|
||||
<property name="title" translatable="yes">Rename contact</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator">Delete</property>
|
||||
<property name="title" translatable="yes">Delete contact</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
|
@ -56,6 +56,7 @@ import tooltips
|
|||
import message_control
|
||||
import adhoc_commands
|
||||
import features_window
|
||||
import shortcuts_window
|
||||
import plugins
|
||||
import plugins.gui
|
||||
|
||||
|
@ -3852,8 +3853,7 @@ class RosterWindow:
|
|||
'http://trac.gajim.org/wiki/GajimFaq')
|
||||
|
||||
def on_keyboard_shortcuts_menuitem_activate(self, widget):
|
||||
helpers.launch_browser_mailer('url',
|
||||
'http://trac.gajim.org/wiki/KeyboardShortcuts')
|
||||
shortcuts_window.show(self.window)
|
||||
|
||||
def on_features_menuitem_activate(self, widget):
|
||||
features_window.FeaturesWindow()
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
# -*- coding:utf-8 -*-
|
||||
## src/shortcuts_window.py
|
||||
##
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## Gajim is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## Gajim is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import gtkgui_helpers
|
||||
|
||||
|
||||
class ShortcutsWindow:
|
||||
def __init__(self):
|
||||
self.window = None
|
||||
|
||||
def show(self, parent=None):
|
||||
if self.window is None:
|
||||
builder = gtkgui_helpers.get_gtk_builder('shortcuts_window.ui')
|
||||
self.window = builder.get_object('shortcuts_window')
|
||||
self.window.connect('destroy', self._on_window_destroy)
|
||||
self.window.set_transient_for(parent)
|
||||
self.window.show_all()
|
||||
self.window.present()
|
||||
|
||||
def _on_window_destroy(self, widget):
|
||||
self.window = None
|
||||
|
||||
show = ShortcutsWindow().show
|
Loading…
Reference in New Issue