From 6a254778e2bcfe7df0b40bf8a0db37159a706315 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 4 Jan 2015 23:51:43 +0100 Subject: Linux/MacOSX: Add wait dialog to the benchmark computation. Correct handling of wait dialog call when changing password and creating volumes. --- src/Main/Forms/BenchmarkDialog.cpp | 45 +++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'src/Main/Forms/BenchmarkDialog.cpp') 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 results; + list results; + + wxBusyCursor busy; + Buffer buffer ((size_t) Gui->GetSelectedData (BufferSizeChoice)); + + BenchmarkThreadRoutine routine(this, results, buffer); + Gui->ExecuteWaitThreadRoutine (this, &routine); + + BenchmarkListCtrl->DeleteAllItems(); - wxBusyCursor busy; - Buffer buffer ((size_t) Gui->GetSelectedData (BufferSizeChoice)); + foreach (const BenchmarkResult &result, results) + { + vector 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& results, Buffer& buffer) + { + try + { EncryptionAlgorithmList encryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms(); foreach (shared_ptr ea, encryptionAlgorithms) { @@ -135,19 +157,6 @@ namespace VeraCrypt } } - BenchmarkListCtrl->DeleteAllItems(); - - foreach (const BenchmarkResult &result, results) - { - vector 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) { -- cgit v1.2.3