summaryrefslogtreecommitdiff
path: root/app-office/gtg/files/fix-help-open.patch
blob: a66d8e95bdd983e8e9805f8311a4cc2e1b974609 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From f8f4cbf0beda0e82388748c916c6152996b12a8e Mon Sep 17 00:00:00 2001
From: Mart Raudsepp <leio@gentoo.org>
Date: Sat, 20 Jun 2020 01:06:04 +0300
Subject: [PATCH] Fix opening of the help files

webbrowser python module just opens things in the browser for me, which
doesn't understand what a "help:gtg" is and routes it back to external
program dialog if lucky.
Use Gtk.show_uri instead, which will properly open it in help handler (yelp).

I believe we should be using Gtk.show_uri instead of webbrowser in other
places as well, but that's something for a different release.
---
 GTG/gtk/application.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/GTG/gtk/application.py b/GTG/gtk/application.py
index 39a8a5b3..e8091973 100644
--- a/GTG/gtk/application.py
+++ b/GTG/gtk/application.py
@@ -28,7 +28,6 @@ from GTG.gtk.browser.main_window import MainWindow
 from GTG.gtk.editor.editor import TaskEditor
 from GTG.gtk.preferences import Preferences
 from GTG.gtk.plugins import PluginsDialog
-from webbrowser import open as openurl
 from GTG.core import clipboard
 from GTG.core.plugins.engine import PluginEngine
 from GTG.core.plugins.api import PluginAPI
@@ -251,7 +250,10 @@ class Application(Gtk.Application):
     def open_help(self, action, param):
         """Open help callback."""
 
-        openurl("help:gtg")
+        try:
+            Gtk.show_uri(None, "help:gtg", Gdk.CURRENT_TIME)
+        except GLib.Error:
+            log.error('Could not open help')
 
     def open_backends_manager(self, action, param):
         """Callback to open the backends manager dialog."""
-- 
2.20.1