VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/MainFrame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms/MainFrame.cpp')
-rw-r--r--src/Main/Forms/MainFrame.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/Main/Forms/MainFrame.cpp b/src/Main/Forms/MainFrame.cpp
index de1c99a4..59329e09 100644
--- a/src/Main/Forms/MainFrame.cpp
+++ b/src/Main/Forms/MainFrame.cpp
@@ -2,11 +2,11 @@
Derived from source code of TrueCrypt 7.1a, which is
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.
*/
@@ -82,10 +82,11 @@ namespace VeraCrypt
InitControls();
InitPreferences();
InitTaskBarIcon();
InitEvents();
InitMessageFilter();
+ InitWindowPrivacy();
if (!GetPreferences().SecurityTokenModule.IsEmpty() && !SecurityToken::IsInitialized())
{
try
{
@@ -468,10 +469,16 @@ namespace VeraCrypt
MainFrameWndProc = (WNDPROC) GetWindowLongPtr (mainFrameHwnd, GWL_WNDPROC);
SetWindowLongPtr (mainFrameHwnd, GWL_WNDPROC, (LONG_PTR) MainFrameWndProcFilter);
#endif
}
+
+ void MainFrame::InitWindowPrivacy ()
+ {
+ Gui->SetContentProtection(!CmdLine->ArgAllowScreencapture);
+ }
+
void MainFrame::InitPreferences ()
{
try
{
LoadPreferences();
@@ -516,11 +523,11 @@ namespace VeraCrypt
Gui->AppendToMenu (*popup, LangString[Gui->IsInBackgroundMode() ? "SHOW_TC" : "HIDE_TC"], this, wxCommandEventHandler (TaskBarIcon::OnShowHideMenuItemSelected));
popup->AppendSeparator();
Gui->AppendToMenu (*popup, LangString["IDM_MOUNT_FAVORITE_VOLUMES"], this, wxCommandEventHandler (TaskBarIcon::OnMountAllFavoritesMenuItemSelected))->Enable (!Busy);
- Gui->AppendToMenu (*popup, LangString["HK_DISMOUNT_ALL"], this, wxCommandEventHandler (TaskBarIcon::OnDismountAllMenuItemSelected))->Enable (!Busy);
+ Gui->AppendToMenu (*popup, LangString["HK_UNMOUNT_ALL"], this, wxCommandEventHandler (TaskBarIcon::OnDismountAllMenuItemSelected))->Enable (!Busy);
// Favorite volumes
if (Gui->GetPreferences().BackgroundTaskMenuMountItemsEnabled && !Frame->FavoriteVolumesMenuMap.empty())
{
popup->AppendSeparator();
@@ -556,11 +563,11 @@ namespace VeraCrypt
{
popup->AppendSeparator();
DismountMap.clear();
foreach (shared_ptr <VolumeInfo> volume, mountedVolumes)
{
- wxString label = LangString["DISMOUNT"] + L" ";
+ wxString label = LangString["UNMOUNT"] + L" ";
if (!volume->MountPoint.IsEmpty())
label += wstring (volume->MountPoint) + L" (" + wstring (volume->Path) + L")";
else
label += wstring (volume->Path);
@@ -999,11 +1006,11 @@ namespace VeraCrypt
size_t newMountedCount = Core->GetMountedVolumes().size();
if (newMountedCount < mountedCount)
{
if (newMountedCount == 0 && GetPreferences().DisplayMessageAfterHotkeyDismount)
- Gui->ShowInfo ("MOUNTED_VOLUMES_DISMOUNTED");
+ Gui->ShowInfo ("MOUNTED_VOLUMES_UNMOUNTED");
else if (GetPreferences().BeepAfterHotkeyMountDismount)
MessageBeep((UINT) -1);
}
}
break;
@@ -1015,11 +1022,11 @@ namespace VeraCrypt
WipeCache();
Gui->DismountAllVolumes (true, true);
if (mounted && GetPreferences().DisplayMessageAfterHotkeyDismount)
- Gui->ShowInfo ("VOLUMES_DISMOUNTED_CACHE_WIPED");
+ Gui->ShowInfo ("VOLUMES_UNMOUNTED_CACHE_WIPED");
else if (mounted && GetPreferences().BeepAfterHotkeyMountDismount)
MessageBeep((UINT) -1);
if (event.GetId() == Hotkey::Id::ForceDismountAllWipeCacheExit)
Close (true);
@@ -1066,10 +1073,21 @@ namespace VeraCrypt
PreferencesDialog dialog (this);
dialog.SelectPage (dialog.HotkeysPage);
dialog.ShowModal();
}
+ void MainFrame::OnLanguageMenuItemSelected (wxCommandEvent& event)
+ {
+#ifdef TC_MACOSX
+ if (Gui->IsInBackgroundMode())
+ Gui->SetBackgroundMode (false);
+#endif
+ PreferencesDialog dialog (this);
+ dialog.SelectPage (dialog.LanguagesPage);
+ dialog.ShowModal();
+ }
+
void MainFrame::OnLegalNoticesMenuItemSelected (wxCommandEvent& event)
{
#ifdef TC_MACOSX
if (Gui->IsInBackgroundMode())
Gui->SetBackgroundMode (false);
@@ -1129,11 +1147,11 @@ namespace VeraCrypt
#endif
wxMenu popup;
if (IsMountedSlotSelected())
{
- Gui->AppendToMenu (popup, LangString["DISMOUNT"], this, wxCommandEventHandler (MainFrame::OnDismountVolumeMenuItemSelected));
+ Gui->AppendToMenu (popup, LangString["UNMOUNT"], this, wxCommandEventHandler (MainFrame::OnDismountVolumeMenuItemSelected));
Gui->AppendToMenu (popup, LangString["OPEN"], this, wxCommandEventHandler (MainFrame::OnOpenVolumeMenuItemSelected));
Gui->AppendToMenu (popup, LangString["LINUX_DESELECT"], this, wxCommandEventHandler (MainFrame::OnClearSlotSelectionMenuItemSelected));
popup.AppendSeparator();
Gui->AppendToMenu (popup, LangString["IDPM_ADD_TO_FAVORITES"], this, wxCommandEventHandler (MainFrame::OnAddToFavoritesMenuItemSelected));
@@ -1424,11 +1442,11 @@ namespace VeraCrypt
}
#if defined(TC_UNIX) && !defined(TC_MACOSX)
try
{
- byte buf[128];
+ uint8 buf[128];
if (read (ShowRequestFifo, buf, sizeof (buf)) > 0 && Gui->IsInBackgroundMode())
Gui->SetBackgroundMode (false);
}
catch (...)
{
@@ -1601,11 +1619,11 @@ namespace VeraCrypt
indicator_item_mountfavorites = gtk_menu_item_new_with_label (LangString["IDM_MOUNT_FAVORITE_VOLUMES"]);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), indicator_item_mountfavorites);
g_signal_connect (indicator_item_mountfavorites, "activate", G_CALLBACK (IndicatorOnMountAllFavoritesMenuItemSelected), this);
- indicator_item_dismountall = gtk_menu_item_new_with_label (LangString["HK_DISMOUNT_ALL"]);
+ indicator_item_dismountall = gtk_menu_item_new_with_label (LangString["HK_UNMOUNT_ALL"]);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), indicator_item_dismountall);
g_signal_connect (indicator_item_dismountall, "activate", G_CALLBACK (IndicatorOnDismountAllMenuItemSelected), this);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_separator_menu_item_new());