Linux: allow mounting NTFS volumes with ntfs3 (#1695)

* Linux: allow mounting volumes with ntfs3

* Linux: add ntfs3 preference for NTFS mounts

* Linux: wrap ntfs3 preference help text

* Add Linux ntfs3 mount preference

* Remove Russian translation changes from ntfs3 PR

* XML Translations: Add English fallback entries for ntfs3 preference

---------

Co-authored-by: Mounir IDRASSI <mounir.idrassi@amcrypto.jp>
This commit is contained in:
Mammoth
2026-04-29 04:11:22 +03:00
committed by GitHub
parent 1b6f2690db
commit 771acf5951
55 changed files with 223 additions and 4 deletions

View File

@@ -55,6 +55,48 @@ namespace VeraCrypt
MountRemovableCheckBox->SetValidator (wxGenericValidator (&Preferences.DefaultMountOptions.Removable));
FilesystemOptionsTextCtrl->SetValue (Preferences.DefaultMountOptions.FilesystemOptions);
#ifdef TC_LINUX
wxBoxSizer *ntfs3PreferenceSizer = new wxBoxSizer (wxHORIZONTAL);
MountNtfsWithNtfs3CheckBox = new wxCheckBox (FilesystemSizer->GetStaticBox(), wxID_ANY, LangString["LINUX_PREF_MOUNT_NTFS_WITH_NTFS3"]);
MountNtfsWithNtfs3CheckBox->SetToolTip (LangString["LINUX_PREF_MOUNT_NTFS_WITH_NTFS3_HELP"]);
ntfs3PreferenceSizer->Add (MountNtfsWithNtfs3CheckBox, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
wxWindow *ntfs3HelpIcon = new wxWindow (FilesystemSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize (16, 16));
ntfs3HelpIcon->SetMinSize (wxSize (16, 16));
ntfs3HelpIcon->SetToolTip (LangString["LINUX_PREF_MOUNT_NTFS_WITH_NTFS3_HELP"]);
ntfs3HelpIcon->Bind (wxEVT_PAINT, [ntfs3HelpIcon] (wxPaintEvent&)
{
wxPaintDC dc (ntfs3HelpIcon);
wxSize size = ntfs3HelpIcon->GetClientSize();
wxColour backgroundColor = ntfs3HelpIcon->GetBackgroundColour();
wxColour color = ntfs3HelpIcon->GetForegroundColour();
int diameter = (size.GetWidth() < size.GetHeight() ? size.GetWidth() : size.GetHeight()) - 1;
int x = (size.GetWidth() - diameter) / 2;
int y = (size.GetHeight() - diameter) / 2;
wxCoord textWidth, textHeight;
if (ntfs3HelpIcon->GetParent())
backgroundColor = ntfs3HelpIcon->GetParent()->GetBackgroundColour();
if (!backgroundColor.IsOk())
backgroundColor = wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW);
if (!color.IsOk())
color = wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOWTEXT);
dc.SetBackground (wxBrush (backgroundColor));
dc.Clear();
dc.SetPen (wxPen (color, 1));
dc.SetBrush (*wxTRANSPARENT_BRUSH);
dc.SetTextForeground (color);
dc.DrawEllipse (x, y, diameter, diameter);
dc.GetTextExtent (L"?", &textWidth, &textHeight);
dc.DrawText (L"?", (size.GetWidth() - textWidth) / 2, (size.GetHeight() - textHeight) / 2 - 1);
});
ntfs3PreferenceSizer->Add (ntfs3HelpIcon, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
FilesystemSizer->Add (ntfs3PreferenceSizer, 0, wxALL, 5);
MountNtfsWithNtfs3CheckBox->SetValidator (wxGenericValidator (&Preferences.DefaultMountOptions.MountNtfsWithNtfs3));
#endif
int index, prfInitialIndex = 0;
Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]);