From 9e7cd6e590ee39bbaa2dd55f9dfe8394c791a0cc Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Mon, 9 Sep 2024 22:07:37 +0800 Subject: [PATCH] =?utf8?q?=E5=AE=89=E5=85=A8=E6=A8=A1=E5=BC=8F=EF=BC=9A?= =?utf8?q?=E4=BC=98=E5=8C=96=E8=B5=84=E6=BA=90=E6=A0=A1=E9=AA=8C=E6=8F=90?= =?utf8?q?=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../safemodemanager/src/ResourceCheckView.cpp | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/ResourceCheckView.cpp b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/ResourceCheckView.cpp index e359e032b..e3c1947c5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/ResourceCheckView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/ResourceCheckView.cpp @@ -1,9 +1,3 @@ -/*** - * @Date: 2024-09-09 17:47:36 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-09-09 18:56:07 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/ResourceCheckView.cpp - */ #include "safemodemanager/include/ResourceCheckView.h" #include "safemodemanager/include/SafeModeManagerPresenter.h" #include "safemodemanager/include/SafeModeManagerModel.h" @@ -80,7 +74,7 @@ namespace OHOS notelabel->SetViewId("label4"); notelabel->SetStyle(STYLE_TEXT_FONT, 30); - notelabel->SetText("file verification..."); + notelabel->SetText("File verification..."); notelabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); notelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); notelabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); @@ -90,11 +84,11 @@ namespace OHOS } void ResourceCheckView::UpdateView(int date) { - std::string display = "file verification"; + std::string display = "File verification"; if (date == -1) { - notelabel->SetText("file verification is error..."); + notelabel->SetText("File verification is error..."); return; } else if (date >= 0 && date <= 60) @@ -109,12 +103,12 @@ namespace OHOS } else if (date == 61) { - notelabel->SetText("file verification is ok..."); + notelabel->SetText("File verification is ok..."); return; } else { - notelabel->SetText("file verification is unkown..."); + notelabel->SetText("File verification is unkown..."); return; } @@ -123,34 +117,32 @@ namespace OHOS } void ResourceCheckView::UpdateView() { - printf("开始显示校验结果\r\n"); - // 进行文件读取 + printf("Start showing verification results.\r\n"); if (SafeModeManagerModel::GetInstance()->ReadCheckFile()) { - // 读取数组 + // Read the array std::vector filenames = SafeModeManagerModel::GetInstance()->GetCheckDifferentialFiles(); - // 清空 notelabel 的文本 + // Clear the text of notelabel std::string allFilenames; - #if 0 - // 更新 notelabel 的文本为文件名列表 +#if 0 for (const auto &filename : filenames) { - allFilenames += filename + "\n"; // 逐行添加文件名 + allFilenames += filename + "\n"; // Add filenames line by line } printf("allFilenames %s\r\n", allFilenames.c_str()); - notelabel->SetText(allFilenames.c_str()); // 一次性设置文本 - #endif + notelabel->SetText(allFilenames.c_str()); // Set the text at once +#endif int num = SafeModeManagerModel::GetInstance()->GetCheckFileCount(); - allFilenames = "本次校验结果校验成功:校验文件:"+ std::to_string(num) ; - notelabel->SetText(allFilenames.c_str()); // 一次性设置文本 - printf("file verification num is %d\r\n", num); + allFilenames = "This verification result is successful. Number of verified files: " + std::to_string(num); + notelabel->SetText(allFilenames.c_str()); // Set the text at once + printf("Number of verified files is %d\r\n", num); } else { - notelabel->SetText("file verification is same"); - printf("校验结果校验失败\r\n"); + notelabel->SetText("File verification is the same."); + printf("Verification result is failure.\r\n"); } - printf("校验结果校验完成\r\n"); + printf("Verification result is completed.\r\n"); } -} \ No newline at end of file +} -- 2.17.1