VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/UserInterface.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-08 12:45:15 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-08 15:20:37 (GMT)
commitad4af09d884e1727750571f7679e8679b8027a1c (patch)
tree90c054b89db94c35a1091397099e3b620ad65fb2 /src/Main/UserInterface.cpp
parent96b39a5973d354bf759fefc13e551fb75e1c25c7 (diff)
downloadVeraCrypt-ad4af09d884e1727750571f7679e8679b8027a1c.zip
VeraCrypt-ad4af09d884e1727750571f7679e8679b8027a1c.tar.gz
Linux: When not under Gnome/KDE, use xdg-open to open the mounted volume if it is available.
Diffstat (limited to 'src/Main/UserInterface.cpp')
-rw-r--r--src/Main/UserInterface.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
index 177a4e9..39c4274 100644
--- a/src/Main/UserInterface.cpp
+++ b/src/Main/UserInterface.cpp
@@ -832,7 +832,7 @@ namespace VeraCrypt
// MIME handler for directory seems to be unavailable through wxWidgets
wxString desktop = GetTraits()->GetDesktopEnvironment();
- if (desktop == L"GNOME" || desktop.empty())
+ if (desktop == L"GNOME")
{
args.push_back ("--no-default-window");
args.push_back ("--no-desktop");
@@ -865,6 +865,22 @@ namespace VeraCrypt
catch (exception &e) { ShowError (e); }
}
}
+ else if (wxFileName::IsFileExecutable (wxT("/usr/bin/xdg-open")))
+ {
+ // Fallback on the standard xdg-open command
+ // which is not always available by default
+ args.push_back (string (path));
+ try
+ {
+ Process::Execute ("xdg-open", args, 2000);
+ }
+ catch (TimeOut&) { }
+ catch (exception &e) { ShowError (e); }
+ }
+ else
+ {
+ ShowWarning (wxT("Unable to find a file manager to open the mounted volume"));
+ }
#endif
}