VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/MountOptionsDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms/MountOptionsDialog.cpp')
-rw-r--r--src/Main/Forms/MountOptionsDialog.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/Main/Forms/MountOptionsDialog.cpp b/src/Main/Forms/MountOptionsDialog.cpp
index 85a06d1e..32b7ae57 100644
--- a/src/Main/Forms/MountOptionsDialog.cpp
+++ b/src/Main/Forms/MountOptionsDialog.cpp
@@ -3,9 +3,9 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
- and all other portions of this file are Copyright (c) 2013-2017 IDRIX
+ and all other portions of this file are Copyright (c) 2013-2025 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages.
*/
@@ -33,16 +33,29 @@ namespace VeraCrypt
#ifdef __WXGTK__ // GTK apparently needs wxRESIZE_BORDER to support dynamic resizing
, wxDefaultPosition, wxSize (-1,-1), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
#endif
), Options (options)
+#ifdef TC_UNIX
+ , m_showRedBorder(false)
+#endif
{
if (!title.empty())
this->SetTitle (title);
else if (options.Path && !options.Path->IsEmpty())
this->SetTitle (StringFormatter (LangString["ENTER_PASSWORD_FOR"], wstring (*options.Path)));
else
this->SetTitle (LangString["ENTER_TC_VOL_PASSWORD"]);
+#ifdef TC_UNIX
+ if (Gui->InsecureMountAllowed())
+ {
+ this->SetTitle (LangString["INSECURE_MODE"] + L" - " + this->GetTitle());
+ m_showRedBorder = true;
+ Bind(wxEVT_PAINT, &MountOptionsDialog::OnPaint, this);
+ Bind(wxEVT_SIZE, &MountOptionsDialog::OnSize, this);
+ }
+#endif
+
if (disableMountOptions)
OptionsButton->Show (false);
@@ -229,5 +242,28 @@ namespace VeraCrypt
Fit();
Layout();
MainSizer->Fit( this );
}
+
+#ifdef TC_UNIX
+ void MountOptionsDialog::OnPaint(wxPaintEvent& event)
+ {
+ wxPaintDC dc(this);
+ if (m_showRedBorder)
+ {
+ wxSize size = GetClientSize();
+ wxPen pen(*wxRED, 3); // 3 pixels width
+ dc.SetPen(pen);
+ dc.SetBrush(*wxTRANSPARENT_BRUSH);
+ dc.DrawRectangle(0, 0, size.GetWidth(), size.GetHeight());
+ }
+ event.Skip();
+ }
+
+ void MountOptionsDialog::OnSize(wxSizeEvent& event)
+ {
+ event.Skip();
+ if (m_showRedBorder)
+ Refresh();
+ }
+#endif
}