VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/MainFrame.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-28 17:01:39 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-28 17:03:38 +0100
commitba1e9c8f4d6d65a5d5a73f1721bf2b03e42aa50e (patch)
treec78b35836248155ef8f2c2e6e98e93495b6b3ec1 /src/Main/Forms/MainFrame.cpp
parent6e73a8a393e2cee5fb76d201d89dda542b6c4a97 (diff)
downloadVeraCrypt-ba1e9c8f4d6d65a5d5a73f1721bf2b03e42aa50e.tar.gz
VeraCrypt-ba1e9c8f4d6d65a5d5a73f1721bf2b03e42aa50e.zip
Linux/MacOSX: A configuration option for default hash and default TrueCrypt mode used for mounting volumes (Menu Settings -> Default Mount Parameters). Implement priority of command line arguments over default values.
Diffstat (limited to 'src/Main/Forms/MainFrame.cpp')
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/MainFrame.cpp37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/Main/Forms/MainFrame.cpp b/src/Main/Forms/MainFrame.cpp
index 08184005..41c6ae7d 100644..100755
--- a/src/Main/Forms/MainFrame.cpp
+++ b/src/Main/Forms/MainFrame.cpp
@@ -625,6 +625,14 @@ namespace VeraCrypt
try
{
MountOptions mountOptions (GetPreferences().DefaultMountOptions);
+ if (CmdLine->ArgTrueCryptMode)
+ {
+ mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
+ }
+ if (CmdLine->ArgHash)
+ {
+ mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, mountOptions.TrueCryptMode);
+ }
if (SlotListCtrl->GetSelectedItemCount() == 1)
mountOptions.SlotNumber = SelectedSlotNumber;
@@ -642,6 +650,14 @@ namespace VeraCrypt
try
{
MountOptions mountOptions (GetPreferences().DefaultMountOptions);
+ if (CmdLine->ArgTrueCryptMode)
+ {
+ mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
+ }
+ if (CmdLine->ArgHash)
+ {
+ mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, mountOptions.TrueCryptMode);
+ }
Gui->MountAllFavoriteVolumes (mountOptions);
}
catch (exception &e)
@@ -664,10 +680,13 @@ namespace VeraCrypt
MountOptions mountOptions (GetPreferences().DefaultMountOptions);
mountOptions.SlotNumber = SelectedSlotNumber;
mountOptions.Path = GetSelectedVolumePath();
- mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
+ if (CmdLine->ArgTrueCryptMode)
+ {
+ mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
+ }
if (CmdLine->ArgHash)
{
- mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, CmdLine->ArgTrueCryptMode);
+ mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, mountOptions.TrueCryptMode);
}
try
@@ -837,6 +856,13 @@ namespace VeraCrypt
dialog.ShowModal();
}
+ void MainFrame::OnDefaultMountParametersMenuItemSelected(wxCommandEvent& event)
+ {
+ PreferencesDialog dialog (this);
+ dialog.SelectPage (dialog.DefaultMountOptionsPage);
+ dialog.ShowModal();
+ }
+
void MainFrame::OnDeviceChange (const DirectoryPath &mountPoint)
{
// Check if any host device has been removed and force dismount of volumes accordingly
@@ -886,10 +912,13 @@ namespace VeraCrypt
SetVolumePath (favorite.Path);
MountOptions mountOptions (GetPreferences().DefaultMountOptions);
- mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
+ if (CmdLine->ArgTrueCryptMode)
+ {
+ mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
+ }
if (CmdLine->ArgHash)
{
- mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, CmdLine->ArgTrueCryptMode);
+ mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, mountOptions.TrueCryptMode);
}
favorite.ToMountOptions (mountOptions);