diff options
author | saturneric <[email protected]> | 2024-01-16 16:54:18 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-16 16:54:18 +0000 |
commit | 394e28ec525077f07ae578161220b3cfafb65591 (patch) | |
tree | 4577dac5ebb3adf93b7e80cb7c23d27fc84eb982 /src/ui/main_window/MainWindowGpgOperaFunction.cpp | |
parent | refactor: remove libgettext from project (diff) | |
download | GpgFrontend-394e28ec525077f07ae578161220b3cfafb65591.tar.gz GpgFrontend-394e28ec525077f07ae578161220b3cfafb65591.zip |
fix: slove some issues and update translations
Diffstat (limited to 'src/ui/main_window/MainWindowGpgOperaFunction.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowGpgOperaFunction.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/ui/main_window/MainWindowGpgOperaFunction.cpp b/src/ui/main_window/MainWindowGpgOperaFunction.cpp index c9e09bf2..e6e6e016 100644 --- a/src/ui/main_window/MainWindowGpgOperaFunction.cpp +++ b/src/ui/main_window/MainWindowGpgOperaFunction.cpp @@ -68,7 +68,9 @@ void MainWindow::SlotEncrypt() { if (data_obj == nullptr || !data_obj->Check<GpgEncryptResult, GFBuffer>()) { - throw std::runtime_error("data object doesn't pass checking"); + QMessageBox::critical(this, tr("Error"), + tr("Unknown error occurred")); + return; } auto result = ExtractParams<GpgEncryptResult>(data_obj, 0); @@ -113,7 +115,9 @@ void MainWindow::SlotEncrypt() { if (data_obj == nullptr || !data_obj->Check<GpgEncryptResult, GFBuffer>()) { - throw std::runtime_error("data object doesn't pass checking"); + QMessageBox::critical(this, tr("Error"), + tr("Unknown error occurred")); + return; } auto result = ExtractParams<GpgEncryptResult>(data_obj, 0); @@ -167,7 +171,9 @@ void MainWindow::SlotSign() { if (data_obj == nullptr || !data_obj->Check<GpgSignResult, GFBuffer>()) { - throw std::runtime_error("data object doesn't pass checking"); + QMessageBox::critical(this, tr("Error"), + tr("Unknown error occurred")); + return; } auto sign_result = ExtractParams<GpgSignResult>(data_obj, 0); auto sign_out_buffer = ExtractParams<GFBuffer>(data_obj, 1); @@ -198,7 +204,9 @@ void MainWindow::SlotDecrypt() { if (data_obj == nullptr || !data_obj->Check<GpgDecryptResult, GFBuffer>()) { - throw std::runtime_error("data object doesn't pass checking"); + QMessageBox::critical(this, tr("Error"), + tr("Unknown error occurred")); + return; } auto decrypt_result = ExtractParams<GpgDecryptResult>(data_obj, 0); @@ -231,7 +239,9 @@ void MainWindow::SlotVerify() { hd(); if (data_obj == nullptr || !data_obj->Check<GpgVerifyResult>()) { - throw std::runtime_error("data object doesn't pass checking"); + QMessageBox::critical(this, tr("Error"), + tr("Unknown error occurred")); + return; } auto verify_result = ExtractParams<GpgVerifyResult>(data_obj, 0); @@ -305,7 +315,9 @@ void MainWindow::SlotEncryptSign() { if (data_obj == nullptr || !data_obj ->Check<GpgEncryptResult, GpgSignResult, GFBuffer>()) { - throw std::runtime_error("data object doesn't pass checking"); + QMessageBox::critical(this, tr("Error"), + tr("Unknown error occurred")); + return; } auto encrypt_result = ExtractParams<GpgEncryptResult>(data_obj, 0); @@ -349,7 +361,9 @@ void MainWindow::SlotDecryptVerify() { if (data_obj == nullptr || !data_obj ->Check<GpgDecryptResult, GpgVerifyResult, GFBuffer>()) { - throw std::runtime_error("data object doesn't pass checking"); + QMessageBox::critical(this, tr("Error"), + tr("Unknown error occurred")); + return; } auto decrypt_result = ExtractParams<GpgDecryptResult>(data_obj, 0); |