diff options
Diffstat (limited to 'src/Main')
-rw-r--r-- | src/Main/Forms/AboutDialog.cpp | 10 | ||||
-rw-r--r-- | src/Main/Forms/PreferencesDialog.cpp | 53 | ||||
-rw-r--r-- | src/Main/Forms/PreferencesDialog.h | 45 | ||||
-rw-r--r-- | src/Main/Forms/VolumeCreationWizard.cpp | 25 | ||||
-rw-r--r-- | src/Main/Forms/WaitDialog.h | 4 | ||||
-rw-r--r-- | src/Main/GraphicUserInterface.cpp | 53 | ||||
-rwxr-xr-x | src/Main/Main.make | 18 | ||||
-rw-r--r-- | src/Main/StringFormatter.h | 5 | ||||
-rw-r--r-- | src/Main/TextUserInterface.cpp | 41 | ||||
-rw-r--r-- | src/Main/TextUserInterface.h | 2 | ||||
-rw-r--r-- | src/Main/UserInterface.cpp | 17 |
11 files changed, 152 insertions, 121 deletions
diff --git a/src/Main/Forms/AboutDialog.cpp b/src/Main/Forms/AboutDialog.cpp index e3768361..01c579d5 100644 --- a/src/Main/Forms/AboutDialog.cpp +++ b/src/Main/Forms/AboutDialog.cpp @@ -27,7 +27,11 @@ namespace VeraCrypt versionStaticTextFont.SetWeight (wxFONTWEIGHT_BOLD); VersionStaticText->SetFont (versionStaticTextFont); - VersionStaticText->SetLabel (Application::GetName() + L" " + StringConverter::ToWide (Version::String())); + wstring versionStr = StringConverter::ToWide (Version::String()); +#ifdef VC_MACOSX_FUSET + versionStr += L" (FUSE-T build)"; +#endif + VersionStaticText->SetLabel (Application::GetName() + L" " + versionStr); CopyrightStaticText->SetLabel (TC_STR_RELEASED_BY); WebsiteHyperlink->SetLabel (L"www.idrix.fr"); @@ -57,7 +61,7 @@ namespace VeraCrypt L"Paulo Barreto, Brian Gladman, Wei Dai, Peter Gutmann, and many others.\n\n" L"Portions of this software:\n" - L"Copyright \xA9 2013-2023 IDRIX. All rights reserved.\n" + L"Copyright \xA9 2013-2024 IDRIX. All rights reserved.\n" L"Copyright \xA9 2003-2012 TrueCrypt Developers Association. All Rights Reserved.\n" L"Copyright \xA9 1998-2000 Paul Le Roux. All Rights Reserved.\n" L"Copyright \xA9 1998-2008 Brian Gladman. All Rights Reserved.\n" @@ -70,7 +74,7 @@ namespace VeraCrypt L"Copyright \xA9 1999-2023 Igor Pavlov\n\n" L"\nThis software as a whole:\n" - L"Copyright \xA9 2013-2023 IDRIX. All rights reserved.\n\n" + L"Copyright \xA9 2013-2024 IDRIX. All rights reserved.\n\n" L"This software uses wxWidgets library, which is copyright \xA9 1998-2011 Julian Smart, Robert Roebling et al.\n\n" diff --git a/src/Main/Forms/PreferencesDialog.cpp b/src/Main/Forms/PreferencesDialog.cpp index c4d5140f..afc2871f 100644 --- a/src/Main/Forms/PreferencesDialog.cpp +++ b/src/Main/Forms/PreferencesDialog.cpp @@ -82,6 +82,51 @@ namespace VeraCrypt LanguageListBox->Append("System default"); LanguageListBox->Append("English"); + langEntries = { + {"system", L"System default"}, + {"ar", L"العربية"}, + {"be", L"Беларуская"}, + {"bg", L"Български"}, + {"ca", L"Català"}, + {"co", L"Corsu"}, + {"cs", L"Čeština"}, + {"da", L"Dansk"}, + {"de", L"Deutsch"}, + {"el", L"Ελληνικά"}, + {"en", L"English"}, + {"es", L"Español"}, + {"et", L"Eesti"}, + {"eu", L"Euskara"}, + {"fa", L"فارسي"}, + {"fi", L"Suomi"}, + {"fr", L"Français"}, + {"he", L"עברית"}, + {"hu", L"Magyar"}, + {"id", L"Bahasa Indonesia"}, + {"it", L"Italiano"}, + {"ja", L"日本語"}, + {"ka", L"ქართული"}, + {"ko", L"한국어"}, + {"lv", L"Latviešu"}, + {"nl", L"Nederlands"}, + {"nn", L"Norsk Nynorsk"}, + {"pl", L"Polski"}, + {"ro", L"Română"}, + {"ru", L"Русский"}, + {"pt-br", L"Português-Brasil"}, + {"sk", L"Slovenčina"}, + {"sl", L"Slovenščina"}, + {"sv", L"Svenska"}, + {"th", L"ภาษาไทย"}, + {"tr", L"Türkçe"}, + {"uk", L"Українська"}, + {"uz", L"Ўзбекча"}, + {"vi", L"Tiếng Việt"}, + {"zh-cn", L"简体中文"}, + {"zh-hk", L"繁體中文(香港)"}, + {"zh-tw", L"繁體中文"} + }; + if (wxDir::Exists(languagesFolder.GetName())) { size_t langCount; langCount = wxDir::GetAllFiles(languagesFolder.GetName(), &langArray, wxEmptyString, wxDIR_FILES); @@ -435,11 +480,11 @@ namespace VeraCrypt if (LanguageListBox->GetSelection() != wxNOT_FOUND) { wxString langToFind = LanguageListBox->GetString(LanguageListBox->GetSelection()); - for (const auto &each: langEntries) { - if (each.second == langToFind) { - Preferences.Language = each.first; + for (map<wxString, std::wstring>::const_iterator each = langEntries.begin(); each != langEntries.end(); ++each) { + if (each->second == langToFind) { + Preferences.Language = each->first; #ifdef DEBUG - cout << "Lang set to: " << each.first << endl; + cout << "Lang set to: " << each->first << endl; #endif } } diff --git a/src/Main/Forms/PreferencesDialog.h b/src/Main/Forms/PreferencesDialog.h index 50e8489e..5e7f7e71 100644 --- a/src/Main/Forms/PreferencesDialog.h +++ b/src/Main/Forms/PreferencesDialog.h @@ -60,50 +60,7 @@ namespace VeraCrypt UserPreferences Preferences; bool RestoreValidatorBell; HotkeyList UnregisteredHotkeys; - map<wxString, wstring> langEntries = { - {"system", L"System default"}, - {"ar", L"العربية"}, - {"be", L"Беларуская"}, - {"bg", L"Български"}, - {"ca", L"Català"}, - {"co", L"Corsu"}, - {"cs", L"Čeština"}, - {"da", L"Dansk"}, - {"de", L"Deutsch"}, - {"el", L"Ελληνικά"}, - {"en", L"English"}, - {"es", L"Español"}, - {"et", L"Eesti"}, - {"eu", L"Euskara"}, - {"fa", L"فارسي"}, - {"fi", L"Suomi"}, - {"fr", L"Français"}, - {"he", L"עברית"}, - {"hu", L"Magyar"}, - {"id", L"Bahasa Indonesia"}, - {"it", L"Italiano"}, - {"ja", L"日本語"}, - {"ka", L"ქართული"}, - {"ko", L"한국어"}, - {"lv", L"Latviešu"}, - {"nl", L"Nederlands"}, - {"nn", L"Norsk Nynorsk"}, - {"pl", L"Polski"}, - {"ro", L"Română"}, - {"ru", L"Русский"}, - {"pt-br", L"Português-Brasil"}, - {"sk", L"Slovenčina"}, - {"sl", L"Slovenščina"}, - {"sv", L"Svenska"}, - {"th", L"ภาษาไทย"}, - {"tr", L"Türkçe"}, - {"uk", L"Українська"}, - {"uz", L"Ўзбекча"}, - {"vi", L"Tiếng Việt"}, - {"zh-cn", L"简体中文"}, - {"zh-hk", L"繁體中文(香港)"}, - {"zh-tw", L"繁體中文"} - }; + map<wxString, wstring> langEntries; }; } diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp index 3f09e39f..311738ca 100644 --- a/src/Main/Forms/VolumeCreationWizard.cpp +++ b/src/Main/Forms/VolumeCreationWizard.cpp @@ -37,6 +37,19 @@ namespace VeraCrypt { + class OpenOuterVolumeFunctor : public Functor + { + public: + OpenOuterVolumeFunctor (const DirectoryPath &outerVolumeMountPoint) : OuterVolumeMountPoint (outerVolumeMountPoint) { } + + virtual void operator() () + { + Gui->OpenExplorerWindow (OuterVolumeMountPoint); + } + + DirectoryPath OuterVolumeMountPoint; + }; + #ifdef TC_MACOSX bool VolumeCreationWizard::ProcessEvent(wxEvent& event) @@ -338,18 +351,6 @@ namespace VeraCrypt return new InfoWizardPage (GetPageParent()); } - struct OpenOuterVolumeFunctor : public Functor - { - OpenOuterVolumeFunctor (const DirectoryPath &outerVolumeMountPoint) : OuterVolumeMountPoint (outerVolumeMountPoint) { } - - virtual void operator() () - { - Gui->OpenExplorerWindow (OuterVolumeMountPoint); - } - - DirectoryPath OuterVolumeMountPoint; - }; - InfoWizardPage *page = new InfoWizardPage (GetPageParent(), LangString["LINUX_OPEN_OUTER_VOL"], shared_ptr <Functor> (new OpenOuterVolumeFunctor (MountedOuterVolume->MountPoint))); diff --git a/src/Main/Forms/WaitDialog.h b/src/Main/Forms/WaitDialog.h index 89de8718..53f5048b 100644 --- a/src/Main/Forms/WaitDialog.h +++ b/src/Main/Forms/WaitDialog.h @@ -80,7 +80,7 @@ namespace VeraCrypt m_bThreadRunning = true; } - int GetCharWidth (wxWindow *window) const + static int ComputeCharWidth (wxWindow *window) { int width; int height; @@ -179,7 +179,7 @@ namespace VeraCrypt { wxPasswordEntryDialog dialog (this, wxString::Format (LangString["ENTER_TOKEN_PASSWORD"], e.GetString()), LangString["IDD_TOKEN_PASSWORD"]); - dialog.SetSize (wxSize (GetCharWidth (&dialog) * 50, -1)); + dialog.SetSize (wxSize (ComputeCharWidth (&dialog) * 50, -1)); if (dialog.ShowModal() != wxID_OK) m_queue.Post(wxT("")); diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp index af2db217..0fd756a3 100644 --- a/src/Main/GraphicUserInterface.cpp +++ b/src/Main/GraphicUserInterface.cpp @@ -37,6 +37,33 @@ namespace VeraCrypt { + class AdminPasswordRequestHandler : public GetStringFunctor + { + public: + virtual void operator() (string &passwordStr) + { + + wxString sValue; + if (Gui->GetWaitDialog()) + { + Gui->GetWaitDialog()->RequestAdminPassword(sValue); + if (sValue.IsEmpty()) + throw UserAbort (SRC_POS); + } + else + { + wxPasswordEntryDialog dialog (Gui->GetActiveWindow(), LangString["LINUX_ADMIN_PW_QUERY"], LangString["LINUX_ADMIN_PW_QUERY_TITLE"]); + if (dialog.ShowModal() != wxID_OK) + throw UserAbort (SRC_POS); + sValue = dialog.GetValue(); + } + wstring wPassword (sValue); // A copy of the password is created here by wxWidgets, which cannot be erased + finally_do_arg (wstring *, &wPassword, { StringConverter::Erase (*finally_arg); }); + + StringConverter::ToSingle (wPassword, passwordStr); + } + }; + #ifdef TC_MACOSX int GraphicUserInterface::g_customIdCmdV = 0; int GraphicUserInterface::g_customIdCmdA = 0; @@ -452,32 +479,6 @@ namespace VeraCrypt shared_ptr <GetStringFunctor> GraphicUserInterface::GetAdminPasswordRequestHandler () { - struct AdminPasswordRequestHandler : public GetStringFunctor - { - virtual void operator() (string &passwordStr) - { - - wxString sValue; - if (Gui->GetWaitDialog()) - { - Gui->GetWaitDialog()->RequestAdminPassword(sValue); - if (sValue.IsEmpty()) - throw UserAbort (SRC_POS); - } - else - { - wxPasswordEntryDialog dialog (Gui->GetActiveWindow(), LangString["LINUX_ADMIN_PW_QUERY"], LangString["LINUX_ADMIN_PW_QUERY_TITLE"]); - if (dialog.ShowModal() != wxID_OK) - throw UserAbort (SRC_POS); - sValue = dialog.GetValue(); - } - wstring wPassword (sValue); // A copy of the password is created here by wxWidgets, which cannot be erased - finally_do_arg (wstring *, &wPassword, { StringConverter::Erase (*finally_arg); }); - - StringConverter::ToSingle (wPassword, passwordStr); - } - }; - return shared_ptr <GetStringFunctor> (new AdminPasswordRequestHandler); } diff --git a/src/Main/Main.make b/src/Main/Main.make index 9f907aef..b77d4936 100755 --- a/src/Main/Main.make +++ b/src/Main/Main.make @@ -102,7 +102,7 @@ endif #------ FUSE configuration ------ -FUSE_LIBS = $(shell $(PKG_CONFIG) fuse --libs) +FUSE_LIBS = $(shell $(PKG_CONFIG) $(VC_FUSE_PACKAGE) --libs) #------ Executable ------ @@ -129,11 +129,19 @@ endif ifeq "$(origin NOSSE2)" "command line" INTERNAL_INSTALLER_NAME := veracrypt_install_$(INSTALLER_TYPE)_$(CPU_ARCH)_legacy.sh +ifeq ($(and $(filter gui,$(INSTALLER_TYPE)),$(filter 2,$(GTK_VERSION))),1) +INSTALLER_NAME := veracrypt-$(TC_VERSION)-setup-gtk2-gui-$(CPU_ARCH)-legacy +else INSTALLER_NAME := veracrypt-$(TC_VERSION)-setup-$(INSTALLER_TYPE)-$(CPU_ARCH)-legacy +endif else INTERNAL_INSTALLER_NAME := veracrypt_install_$(INSTALLER_TYPE)_$(CPU_ARCH).sh +ifeq ($(and $(filter gui,$(INSTALLER_TYPE)),$(filter 2,$(GTK_VERSION))),1) +INSTALLER_NAME := veracrypt-$(TC_VERSION)-setup-gtk2-gui-$(CPU_ARCH) +else INSTALLER_NAME := veracrypt-$(TC_VERSION)-setup-$(INSTALLER_TYPE)-$(CPU_ARCH) endif +endif endif #----------------------------------- @@ -152,7 +160,11 @@ PACKAGE_NAME := $(APPNAME)_$(TC_VERSION)_$(SYSTEMNAME)_$(PLATFORM_ARCH).tar.gz endif INTERNAL_INSTALLER_NAME := veracrypt_install_f$(SYSTEMNAME)_$(INSTALLER_TYPE)_$(CPU_ARCH).sh +ifeq ($(and $(filter gui,$(INSTALLER_TYPE)),$(filter 2,$(GTK_VERSION))),1) +INSTALLER_NAME := veracrypt-$(TC_VERSION)-$(SYSTEMNAME)-setup-gtk2-gui-$(CPU_ARCH) +else INSTALLER_NAME := veracrypt-$(TC_VERSION)-$(SYSTEMNAME)-setup-$(INSTALLER_TYPE)-$(CPU_ARCH) +endif endif #----------------------------------- @@ -223,7 +235,11 @@ ifdef VC_LEGACY_BUILD productsign --sign "Developer ID Installer: IDRIX (Z933746L2S)" --timestamp "$(BASE_DIR)/Setup/MacOSX/VeraCrypt Legacy $(TC_VERSION).pkg" $(BASE_DIR)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg rm -f $(APPNAME)_Legacy_$(TC_VERSION).dmg else +ifeq "$(VC_OSX_FUSET)" "1" + /usr/local/bin/packagesbuild $(BASE_DIR)/Setup/MacOSX/veracrypt_fuse-t.pkgproj +else /usr/local/bin/packagesbuild $(BASE_DIR)/Setup/MacOSX/veracrypt.pkgproj +endif ifneq ("$(LOCAL_DEVELOPMENT_BUILD)","true") productsign --sign "Developer ID Installer: IDRIX (Z933746L2S)" --timestamp "$(BASE_DIR)/Setup/MacOSX/VeraCrypt $(TC_VERSION).pkg" $(BASE_DIR)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg else diff --git a/src/Main/StringFormatter.h b/src/Main/StringFormatter.h index 97c39ae2..d7f64dd0 100644 --- a/src/Main/StringFormatter.h +++ b/src/Main/StringFormatter.h @@ -52,7 +52,10 @@ namespace VeraCrypt StringFormatter (const wxString &format, StringFormatterArg arg0 = StringFormatterArg(), StringFormatterArg arg1 = StringFormatterArg(), StringFormatterArg arg2 = StringFormatterArg(), StringFormatterArg arg3 = StringFormatterArg(), StringFormatterArg arg4 = StringFormatterArg(), StringFormatterArg arg5 = StringFormatterArg(), StringFormatterArg arg6 = StringFormatterArg(), StringFormatterArg arg7 = StringFormatterArg(), StringFormatterArg arg8 = StringFormatterArg(), StringFormatterArg arg9 = StringFormatterArg()); virtual ~StringFormatter (); - explicit operator wstring () const { return wstring (FormattedString); } +#if (__cplusplus >= 201103L) + explicit +#endif + operator wstring () const { return wstring (FormattedString); } operator wxString () const { return FormattedString; } operator StringFormatterArg () const { return FormattedString; } diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp index 3346ee3e..46559dfa 100644 --- a/src/Main/TextUserInterface.cpp +++ b/src/Main/TextUserInterface.cpp @@ -30,6 +30,27 @@ namespace VeraCrypt { + class AdminPasswordRequestHandler : public GetStringFunctor + { + public: + AdminPasswordRequestHandler (TextUserInterface *userInterface) : UI (userInterface) { } + virtual void operator() (string &passwordStr) + { + UI->ShowString (_("Enter your user password or administrator password: ")); + + TextUserInterface::SetTerminalEcho (false); + finally_do ({ TextUserInterface::SetTerminalEcho (true); }); + + wstring wPassword (UI->ReadInputStreamLine()); + finally_do_arg (wstring *, &wPassword, { StringConverter::Erase (*finally_arg); }); + + UI->ShowString (L"\n"); + + StringConverter::ToSingle (wPassword, passwordStr); + } + TextUserInterface *UI; + }; + TextUserInterface::TextUserInterface () { #ifdef TC_UNIX @@ -1095,26 +1116,6 @@ namespace VeraCrypt shared_ptr <GetStringFunctor> TextUserInterface::GetAdminPasswordRequestHandler () { - struct AdminPasswordRequestHandler : public GetStringFunctor - { - AdminPasswordRequestHandler (TextUserInterface *userInterface) : UI (userInterface) { } - virtual void operator() (string &passwordStr) - { - UI->ShowString (_("Enter your user password or administrator password: ")); - - TextUserInterface::SetTerminalEcho (false); - finally_do ({ TextUserInterface::SetTerminalEcho (true); }); - - wstring wPassword (UI->ReadInputStreamLine()); - finally_do_arg (wstring *, &wPassword, { StringConverter::Erase (*finally_arg); }); - - UI->ShowString (L"\n"); - - StringConverter::ToSingle (wPassword, passwordStr); - } - TextUserInterface *UI; - }; - return shared_ptr <GetStringFunctor> (new AdminPasswordRequestHandler (this)); } diff --git a/src/Main/TextUserInterface.h b/src/Main/TextUserInterface.h index becb1d59..44494f32 100644 --- a/src/Main/TextUserInterface.h +++ b/src/Main/TextUserInterface.h @@ -19,9 +19,11 @@ namespace VeraCrypt { + class AdminPasswordRequestHandler; class TextUserInterface : public UserInterface { public: + friend class AdminPasswordRequestHandler; TextUserInterface (); virtual ~TextUserInterface (); diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp index 09b1fcdd..0f11ec0b 100644 --- a/src/Main/UserInterface.cpp +++ b/src/Main/UserInterface.cpp @@ -32,6 +32,15 @@ namespace VeraCrypt { + class AdminPasswordRequestHandler : public GetStringFunctor + { + public: + virtual void operator() (string &str) + { + throw ElevationFailed (SRC_POS, "sudo", 1, ""); + } + }; + UserInterface::UserInterface () { } @@ -558,14 +567,6 @@ namespace VeraCrypt } else { - struct AdminPasswordRequestHandler : public GetStringFunctor - { - virtual void operator() (string &str) - { - throw ElevationFailed (SRC_POS, "sudo", 1, ""); - } - }; - Core->SetAdminPasswordCallback (shared_ptr <GetStringFunctor> (new AdminPasswordRequestHandler)); } |