wok-next view truecrypt/stuff/patches/xdg-open.patch @ rev 20036

Fix truecrypt. Although cryptography is not easy. Use it at your own risk.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Oct 22 19:31:48 2017 +0300 (2017-10-22)
parents
children
line source
1 From ad4af09d884e1727750571f7679e8679b8027a1c Mon Sep 17 00:00:00 2001
2 From: Mounir IDRASSI <mounir.idrassi@idrix.fr>
3 Date: Sun, 8 Feb 2015 13:45:15 +0100
4 Subject: [PATCH] Linux: When not under Gnome/KDE, use xdg-open to open the
5 mounted volume if it is available.
7 ---
8 src/Main/UserInterface.cpp | 18 +++++++++++++++++-
9 1 file changed, 17 insertions(+), 1 deletion(-)
11 diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
12 index 177a4e9..39c4274 100644
13 --- a/src/Main/UserInterface.cpp
14 +++ b/src/Main/UserInterface.cpp
15 @@ -832,7 +832,7 @@ namespace VeraCrypt
16 // MIME handler for directory seems to be unavailable through wxWidgets
17 wxString desktop = GetTraits()->GetDesktopEnvironment();
19 - if (desktop == L"GNOME" || desktop.empty())
20 + if (desktop == L"GNOME")
21 {
22 args.push_back ("--no-default-window");
23 args.push_back ("--no-desktop");
24 @@ -865,6 +865,22 @@ namespace VeraCrypt
25 catch (exception &e) { ShowError (e); }
26 }
27 }
28 + else if (wxFileName::IsFileExecutable (wxT("/usr/bin/xdg-open")))
29 + {
30 + // Fallback on the standard xdg-open command
31 + // which is not always available by default
32 + args.push_back (string (path));
33 + try
34 + {
35 + Process::Execute ("xdg-open", args, 2000);
36 + }
37 + catch (TimeOut&) { }
38 + catch (exception &e) { ShowError (e); }
39 + }
40 + else
41 + {
42 + ShowWarning (wxT("Unable to find a file manager to open the mounted volume"));
43 + }
44 #endif
45 }
47 From 3a9db8d98c1301726bdf26af9698e7cc61a46f71 Mon Sep 17 00:00:00 2001
48 From: Mounir IDRASSI <mounir.idrassi@idrix.fr>
49 Date: Wed, 2 Dec 2015 11:10:30 +0100
50 Subject: [PATCH] Linux: fix Nautilus not detected as file manager on some
51 Gnome based destributions.
53 ---
54 src/Main/UserInterface.cpp | 6 ++++--
55 1 file changed, 4 insertions(+), 2 deletions(-)
57 diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
58 index 73c9914..2be5bc7 100644
59 --- a/src/Main/UserInterface.cpp
60 +++ b/src/Main/UserInterface.cpp
61 @@ -834,8 +834,10 @@ namespace VeraCrypt
62 #else
63 // MIME handler for directory seems to be unavailable through wxWidgets
64 wxString desktop = GetTraits()->GetDesktopEnvironment();
65 + bool xdgOpenPresent = wxFileName::IsFileExecutable (wxT("/usr/bin/xdg-open"));
66 + bool nautilusPresent = wxFileName::IsFileExecutable (wxT("/usr/bin/nautilus"));
68 - if (desktop == L"GNOME")
69 + if (desktop == L"GNOME" || (desktop.empty() && !xdgOpenPresent && nautilusPresent))
70 {
71 args.push_back ("--no-default-window");
72 args.push_back ("--no-desktop");
73 @@ -868,7 +870,7 @@ namespace VeraCrypt
74 catch (exception &e) { ShowError (e); }
75 }
76 }
77 - else if (wxFileName::IsFileExecutable (wxT("/usr/bin/xdg-open")))
78 + else if (xdgOpenPresent)
79 {
80 // Fallback on the standard xdg-open command
81 // which is not always available by default