File: enable-local-help.patch

package info (click to toggle)
keepass2 2.57%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,520 kB
  • sloc: cs: 120,930; xml: 6,271; cpp: 322; sh: 53; makefile: 42
file content (77 lines) | stat: -rw-r--r-- 2,362 bytes parent folder | download | duplicates (3)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
From: Julian Taylor <jtaylor.debian@googlemail.com>
Date: Sat, 27 Oct 2018 13:36:23 +0200
Subject: enable local help

disable windows chm viewer and use x-www-browser to view docs
located as html files in "/usr/share/doc/keepass2/Chm/help/"
Forwarded: not-needed
---
 KeePass/App/AppHelp.cs | 32 +++++++++-----------------------
 1 file changed, 9 insertions(+), 23 deletions(-)

diff --git a/KeePass/App/AppHelp.cs b/KeePass/App/AppHelp.cs
index fed9703..0573897 100644
--- a/KeePass/App/AppHelp.cs
+++ b/KeePass/App/AppHelp.cs
@@ -69,7 +69,7 @@ namespace KeePass.App
 				{
 					string strFile = AppHelp.LocalHelpFile;
 					if(!string.IsNullOrEmpty(strFile))
-						return File.Exists(strFile);
+						return Directory.Exists("/usr/share/doc/keepass2/Chm/help/");
 				}
 				catch(Exception) { Debug.Assert(false); }
 
@@ -100,7 +100,7 @@ namespace KeePass.App
 		/// with the '#' character.</param>
 		public static void ShowHelp(string strTopic, string strSection)
 		{
-			AppHelp.ShowHelp(strTopic, strSection, false);
+			AppHelp.ShowHelp(strTopic, strSection, true);
 		}
 
 		/// <summary>
@@ -131,36 +131,22 @@ namespace KeePass.App
 			string strFile = AppHelp.LocalHelpFile;
 			if(string.IsNullOrEmpty(strFile)) { Debug.Assert(false); return; }
 
-			// Unblock CHM file for proper display of help contents
-			WinUtil.RemoveZoneIdentifier(strFile);
-
-			string strCmd = "\"ms-its:" + strFile;
+			string strCmd = "file:///usr/share/doc/keepass2/Chm/help/";
 			if(!string.IsNullOrEmpty(strTopic))
 			{
-				strCmd += "::/help/" + strTopic + ".html";
+				strCmd += strTopic + ".html";
 
 				if(!string.IsNullOrEmpty(strSection))
 					strCmd += "#" + strSection;
 			}
-			strCmd += "\"";
-
-			if(ShowHelpLocalKcv(strCmd)) return;
-
-			string strDisp = strCmd;
-			try
+			else
 			{
-				if(NativeLib.IsUnix())
-					NativeLib.StartProcess(strCmd.Trim('\"'));
-				else // Windows
-				{
-					strDisp = "HH.exe " + strDisp;
-					NativeLib.StartProcess(WinUtil.LocateSystemApp(
-						"hh.exe"), strCmd);
-				}
+				strCmd += "../index.html";
 			}
-			catch(Exception ex)
+			try { Process.Start("xdg-open", strCmd); }
+			catch(Exception exStart)
 			{
-				MessageService.ShowWarning(strDisp, ex);
+				MessageService.ShowWarning("xdg-open " + strCmd, exStart);
 			}
 		}