VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/GraphicUserInterface.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-03 20:09:26 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-04 13:47:35 +0100
commit11013ce71e40c9e4659935bfcdb3f6e0e6d7929b (patch)
tree628ff15c7f42369b9b80d5d61ff0585ca76ac7a9 /src/Main/GraphicUserInterface.cpp
parenta185b540bd0b2491227c1c42976d8e687c8ccfd3 (diff)
downloadVeraCrypt-11013ce71e40c9e4659935bfcdb3f6e0e6d7929b.tar.gz
VeraCrypt-11013ce71e40c9e4659935bfcdb3f6e0e6d7929b.zip
Linux/macOSX: handle project URLs using the new values
Diffstat (limited to 'src/Main/GraphicUserInterface.cpp')
-rw-r--r--src/Main/GraphicUserInterface.cpp145
1 files changed, 107 insertions, 38 deletions
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp
index 952f04a9..b135bc55 100644
--- a/src/Main/GraphicUserInterface.cpp
+++ b/src/Main/GraphicUserInterface.cpp
@@ -974,112 +974,181 @@ namespace VeraCrypt
if (GetPreferences().WipeCacheOnAutoDismount)
{
Core->WipePasswordCache();
SecurityToken::CloseAllSessions();
}
}
void GraphicUserInterface::OpenDocument (wxWindow *parent, const wxFileName &document)
{
if (!document.FileExists())
throw ParameterIncorrect (SRC_POS);
#ifdef TC_WINDOWS
if (int (ShellExecute (GetTopWindow() ? static_cast <HWND> (GetTopWindow()->GetHandle()) : nullptr, L"open",
document.GetFullPath().c_str(), nullptr, nullptr, SW_SHOWNORMAL)) >= 32)
return;
#else
wxMimeTypesManager mimeMgr;
wxFileType *fileType = mimeMgr.GetFileTypeFromExtension (document.GetExt());
if (fileType)
{
try
{
if (wxExecute (fileType->GetOpenCommand (document.GetFullPath())) != 0)
return;
}
catch (TimeOut&) { }
}
#endif
}
wxString GraphicUserInterface::GetHomepageLinkURL (const wxString &linkId, bool secure, const wxString &extraVars) const
{
- wxString url = wxString (StringConverter::ToWide (secure ? TC_APPLINK_SECURE : TC_APPLINK)); /* + L"&dest=" + linkId;
- wxString os, osVersion, architecture;
-
-#ifdef TC_WINDOWS
-
- os = L"Windows";
-
-#elif defined (TC_UNIX)
- struct utsname unameData;
- if (uname (&unameData) != -1)
+ wxString url = wxString (StringConverter::ToWide (secure ? TC_APPLINK_SECURE : TC_APPLINK));
+
+ if (linkId == L"donate")
{
- os = StringConverter::ToWide (unameData.sysname);
- osVersion = StringConverter::ToWide (unameData.release);
- architecture = StringConverter::ToWide (unameData.machine);
-
- if (os == L"Darwin")
- os = L"MacOSX";
+ url = L"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5BCXVMTTNJDCY";
}
- else
- os = L"Unknown";
-#else
- os = L"Unknown";
-#endif
-
- os.Replace (L" ", L"-");
- url += L"&os=";
- url += os;
-
- osVersion.Replace (L" ", L"-");
- url += L"&osver=";
- url += osVersion;
-
- architecture.Replace (L" ", L"-");
- url += L"&arch=";
- url += architecture;
-
- if (!extraVars.empty())
+ else if (linkId == L"main")
+ {
+ url = wxString (StringConverter::ToWide (TC_HOMEPAGE));
+ }
+ else if (linkId == L"localizations")
{
- url += L"&";
- url += extraVars;
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Language%20Packs";
}
- */
+ else if (linkId == L"beginnerstutorial" || linkId == L"tutorial")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Beginner%27s%20Tutorial";
+ }
+ else if (linkId == L"releasenotes" || linkId == L"history")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Release%20Notes";
+ }
+ else if (linkId == L"hwacceleration")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Hardware%20Acceleration";
+ }
+ else if (linkId == L"parallelization")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Parallelization";
+ }
+ else if (linkId == L"help")
+ {
+ url = L"https://veracrypt.codeplex.com/documentation";
+ }
+ else if (linkId == L"keyfiles")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Keyfiles";
+ }
+ else if (linkId == L"introcontainer")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Creating%20New%20Volumes";
+ }
+ else if (linkId == L"introsysenc")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=System%20Encryption";
+ }
+ else if (linkId == L"hiddensysenc")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=VeraCrypt%20Hidden%20Operating%20System";
+ }
+ else if (linkId == L"sysencprogressinfo")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=System%20Encryption";
+ }
+ else if (linkId == L"hiddenvolume")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Hidden%20Volume";
+ }
+ else if (linkId == L"aes")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=AES";
+ }
+ else if (linkId == L"serpent")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Serpent";
+ }
+ else if (linkId == L"twofish")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Twofish";
+ }
+ else if (linkId == L"cascades")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Cascades";
+ }
+ else if (linkId == L"hashalgorithms")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Hash%20Algorithms";
+ }
+ else if (linkId == L"isoburning")
+ {
+ url = L"https://cdburnerxp.se/en/home";
+ }
+ else if (linkId == L"sysfavorites")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=System%20Favorite%20Volumes";
+ }
+ else if (linkId == L"favorites")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Favorite%20Volumes";
+ }
+ else if (linkId == L"hiddenvolprotection")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Protection%20of%20Hidden%20Volumes";
+ }
+ else if (linkId == L"faq")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=FAQ";
+ }
+ else if (linkId == L"downloads")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Downloads";
+ }
+ else if (linkId == L"news")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=News";
+ }
+ else if (linkId == L"contact")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Contact";
+ }
+
return url;
}
void GraphicUserInterface::OpenHomepageLink (wxWindow *parent, const wxString &linkId, const wxString &extraVars)
{
wxString url;
BeginInteractiveBusyState (parent);
wxLaunchDefaultBrowser (GetHomepageLinkURL (linkId, false, extraVars), wxBROWSER_NEW_WINDOW);
Thread::Sleep (200);
EndInteractiveBusyState (parent);
}
void GraphicUserInterface::OpenOnlineHelp (wxWindow *parent)
{
OpenHomepageLink (parent, L"help");
}
void GraphicUserInterface::OpenUserGuide (wxWindow *parent)
{
try
{
wxString docPath = wstring (Application::GetExecutableDirectory());
#ifdef TC_RESOURCE_DIR
docPath = StringConverter::ToWide (string (TC_TO_STRING (TC_RESOURCE_DIR)) + "/doc/VeraCrypt User Guide.pdf");
#elif defined (TC_WINDOWS)
docPath += L"\\VeraCrypt User Guide.pdf";
#elif defined (TC_MACOSX)
docPath += L"/../Resources/VeraCrypt User Guide.pdf";
#elif defined (TC_UNIX)
docPath = L"/usr/share/veracrypt/doc/VeraCrypt User Guide.pdf";
#else
# error TC_RESOURCE_DIR undefined
#endif