VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/BenchmarkDialog.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-01-04 23:51:43 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-01-04 23:53:35 +0100
commit6a254778e2bcfe7df0b40bf8a0db37159a706315 (patch)
tree95dd89deaf84c8b0c8fd6d9ae651bbe4afc3c7cd /src/Main/Forms/BenchmarkDialog.cpp
parent41607d126a0a045222a5fc2fac5c9e77b40099f7 (diff)
downloadVeraCrypt-6a254778e2bcfe7df0b40bf8a0db37159a706315.tar.gz
VeraCrypt-6a254778e2bcfe7df0b40bf8a0db37159a706315.zip
Linux/MacOSX: Add wait dialog to the benchmark computation. Correct handling of wait dialog call when changing password and creating volumes.
Diffstat (limited to 'src/Main/Forms/BenchmarkDialog.cpp')
-rw-r--r--src/Main/Forms/BenchmarkDialog.cpp45
1 files changed, 27 insertions, 18 deletions
diff --git a/src/Main/Forms/BenchmarkDialog.cpp b/src/Main/Forms/BenchmarkDialog.cpp
index 9d744ed8..faf85046 100644
--- a/src/Main/Forms/BenchmarkDialog.cpp
+++ b/src/Main/Forms/BenchmarkDialog.cpp
@@ -60,13 +60,35 @@ namespace VeraCrypt
void BenchmarkDialog::OnBenchmarkButtonClick (wxCommandEvent& event)
{
- try
- {
- list <BenchmarkResult> results;
+ 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();
- wxBusyCursor busy;
- Buffer buffer ((size_t) Gui->GetSelectedData <size_t> (BufferSizeChoice));
+ 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
+ {
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)
{