1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Linux/MacOSX: Add wait dialog to the benchmark computation. Correct handling of wait dialog call when changing password and creating volumes.

This commit is contained in:
Mounir IDRASSI
2015-01-04 23:51:43 +01:00
parent 41607d126a
commit 6a254778e2
4 changed files with 42 additions and 22 deletions

View File

@@ -59,14 +59,36 @@ namespace VeraCrypt
}
void BenchmarkDialog::OnBenchmarkButtonClick (wxCommandEvent& event)
{
list <BenchmarkResult> results;
wxBusyCursor busy;
Buffer buffer ((size_t) Gui->GetSelectedData <size_t> (BufferSizeChoice));
BenchmarkThreadRoutine routine(this, results, buffer);
Gui->ExecuteWaitThreadRoutine (this, &routine);
BenchmarkListCtrl->DeleteAllItems();
foreach (const BenchmarkResult &result, results)
{
vector <wstring> fields (BenchmarkListCtrl->GetColumnCount());
fields[ColumnAlgorithm] = result.AlgorithmName;
fields[ColumnEncryption] = Gui->SpeedToString (result.EncryptionSpeed);
fields[ColumnDecryption] = Gui->SpeedToString (result.DecryptionSpeed);
fields[ColumnMean] = Gui->SpeedToString (result.MeanSpeed);
Gui->AppendToListCtrl (BenchmarkListCtrl, fields);
}
BenchmarkListCtrl->SetColumnWidth(0, wxLIST_AUTOSIZE);
}
void BenchmarkDialog::DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer)
{
try
{
list <BenchmarkResult> results;
wxBusyCursor busy;
Buffer buffer ((size_t) Gui->GetSelectedData <size_t> (BufferSizeChoice));
EncryptionAlgorithmList encryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms();
foreach (shared_ptr <EncryptionAlgorithm> ea, encryptionAlgorithms)
{
@@ -135,19 +157,6 @@ namespace VeraCrypt
}
}
BenchmarkListCtrl->DeleteAllItems();
foreach (const BenchmarkResult &result, results)
{
vector <wstring> fields (BenchmarkListCtrl->GetColumnCount());
fields[ColumnAlgorithm] = result.AlgorithmName;
fields[ColumnEncryption] = Gui->SpeedToString (result.EncryptionSpeed);
fields[ColumnDecryption] = Gui->SpeedToString (result.DecryptionSpeed);
fields[ColumnMean] = Gui->SpeedToString (result.MeanSpeed);
Gui->AppendToListCtrl (BenchmarkListCtrl, fields);
}
}
catch (exception &e)
{