VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumeCreationWizard.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-19 08:46:27 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-19 11:29:45 +0200
commit515895342820a9d0a35391ec4d316c3782a75768 (patch)
treeb3c64668eba1bd654914acd42e986d6f90d80462 /src/Main/Forms/VolumeCreationWizard.cpp
parent63818bcaa44b9ce0b59ac2c56afdee1f5e1976ba (diff)
downloadVeraCrypt-515895342820a9d0a35391ec4d316c3782a75768.tar.gz
VeraCrypt-515895342820a9d0a35391ec4d316c3782a75768.zip
User Interface enhancements for PIM
Diffstat (limited to 'src/Main/Forms/VolumeCreationWizard.cpp')
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp
index 8382127a..440155c7 100644
--- a/src/Main/Forms/VolumeCreationWizard.cpp
+++ b/src/Main/Forms/VolumeCreationWizard.cpp
@@ -42,6 +42,7 @@ namespace VeraCrypt
SelectedFilesystemType (VolumeCreationOptions::FilesystemType::FAT),
SelectedVolumeHostType (VolumeHostType::File),
SelectedVolumeType (VolumeType::Normal),
+ Pim (0),
SectorSize (0),
VolumeSize (0)
{
@@ -85,6 +86,7 @@ namespace VeraCrypt
OuterVolume = false;
LargeFilesSupport = false;
QuickFormatEnabled = false;
+ Pim = 0;
SingleChoiceWizardPage <VolumeHostType::Enum> *page = new SingleChoiceWizardPage <VolumeHostType::Enum> (GetPageParent(), wxEmptyString, true);
page->SetMinSize (wxSize (Gui->GetCharWidth (this) * 58, Gui->GetCharHeight (this) * 18 + 5));
@@ -186,6 +188,8 @@ namespace VeraCrypt
case Step::VolumePassword:
{
VolumePasswordWizardPage *page = new VolumePasswordWizardPage (GetPageParent(), Password, Keyfiles);
+ page->EnableUsePim (); // force displaying "Use PIM"
+ page->SetPimSelected (Pim > 0);
if (OuterVolume)
page->SetPageTitle (LangString["PASSWORD_HIDVOL_HOST_TITLE"]);
@@ -210,6 +214,7 @@ namespace VeraCrypt
page->SetPageTitle (LangString["PIM_TITLE"]);
page->SetPageText (LangString["PIM_HELP"]);
+ page->SetVolumePim (Pim);
return page;
}
@@ -339,6 +344,7 @@ namespace VeraCrypt
ClearHistory();
OuterVolume = false;
LargeFilesSupport = false;
+ Pim = 0;
InfoWizardPage *page = new InfoWizardPage (GetPageParent());
page->SetPageTitle (LangString["HIDVOL_PRE_CIPHER_TITLE"]);
@@ -747,8 +753,33 @@ namespace VeraCrypt
}
}
}
+
+ if (page->IsPimSelected ())
+ return Step::VolumePim;
+ else
+ {
+ // Clear PIM
+ Pim = 0;
+
+ // Skip PIM
+ if (forward && OuterVolume)
+ {
+ // Use FAT to prevent problems with free space
+ QuickFormatEnabled = false;
+ SelectedFilesystemType = VolumeCreationOptions::FilesystemType::FAT;
+ return Step::CreationProgress;
+ }
- return Step::VolumePim;
+ if (VolumeSize > 4 * BYTES_PER_GB)
+ {
+ if (VolumeSize <= TC_MAX_FAT_SECTOR_COUNT * SectorSize)
+ return Step::LargeFilesSupport;
+ else
+ SelectedFilesystemType = VolumeCreationOptions::FilesystemType::GetPlatformNative();
+ }
+
+ return Step::FormatOptions;
+ }
}
case Step::VolumePim: