From 058562b92e6b3f0cb0e7900cb239dfd8c0bb74d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Tue, 24 Jan 2017 16:39:09 +0100 Subject: [PATCH] Backward compatible keyboard shortcuts information. Use GtkShortcutsWindow if supported, otherwise just point the user to the wiki page with keyboard shortcuts. --- src/shortcuts_window.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/shortcuts_window.py b/src/shortcuts_window.py index ea07dbc91..dd0bb1f14 100644 --- a/src/shortcuts_window.py +++ b/src/shortcuts_window.py @@ -16,8 +16,13 @@ ## along with Gajim. If not, see . ## +from gi.repository import Gtk + import gtkgui_helpers +from common import helpers + +__all__ = ['show'] class ShortcutsWindow: def __init__(self): @@ -35,4 +40,11 @@ class ShortcutsWindow: def _on_window_destroy(self, widget): self.window = None -show = ShortcutsWindow().show +def show_shortcuts_webpage(self, parent=None): + helpers.launch_browser_mailer('url', + 'https://dev.gajim.org/gajim/gajim/wikis/help/keyboardshortcuts') + +if (3, 19) <= (Gtk.get_major_version(), Gtk.get_minor_version()): + show = ShortcutsWindow().show +else: + show = show_shortcuts_webpage