VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2024-06-30 01:22:05 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2024-06-30 01:22:05 +0200
commit96974169199d347172fc5d4a2924f092d602b3de (patch)
tree627633460b7e830d7a4dcb58de37733d84742e46 /src/Main/Forms
parent1e7d6948c991e8c0153fdbf06d82844595c138f8 (diff)
downloadVeraCrypt-96974169199d347172fc5d4a2924f092d602b3de.tar.gz
VeraCrypt-96974169199d347172fc5d4a2924f092d602b3de.zip
Linux: Make the C++ code compatible with old compilers (g++ 4.4.7 on CentOS 6)
Diffstat (limited to 'src/Main/Forms')
-rw-r--r--src/Main/Forms/PreferencesDialog.cpp53
-rw-r--r--src/Main/Forms/PreferencesDialog.h45
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp25
3 files changed, 63 insertions, 60 deletions
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)));