From: Caisking <3449750381@qq.com> Date: Thu, 12 Sep 2024 12:21:42 +0000 (+0800) Subject: 安全模式:优化repair界面配置 X-Git-Tag: release_V1.2.70_20241020_135402~485^2~5^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9764645bfabde575bcbae60a86718230a5264063;p=mirrors%2FFD230.git 安全模式:优化repair界面配置 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/include/RepairView.h b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/include/RepairView.h index 4a1aadfa0..24b1718e2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/include/RepairView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/include/RepairView.h @@ -25,7 +25,7 @@ public: void InitLabels(void); void InitButtons(void); void InitBasicdata(void); - void UpdateRepairView(int date); + void UpdateView(int date); private: UIScrollView *scrollView_{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/RepairView.cpp b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/RepairView.cpp index 1f13562d3..20594701a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/RepairView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/RepairView.cpp @@ -67,7 +67,7 @@ void RepairView::InitLabels() { signalLabel_->SetPosition(133, 130); signalLabel_->Resize(200, 60); signalLabel_->SetViewId("signalLabel"); - signalLabel_->SetText("Signal: 26"); + signalLabel_->SetText("Signal: --"); signalLabel_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); signalLabel_->SetAlign(TEXT_ALIGNMENT_CENTER); signalLabel_->SetFont(GILROY_BOLD_FONT, @@ -84,7 +84,7 @@ void RepairView::InitLabels() { operationLabel_->SetPosition(83, 80); operationLabel_->Resize(300, 60); operationLabel_->SetViewId("operationLabel"); - operationLabel_->SetText("Operation: CHN_CT"); + operationLabel_->SetText("Operation: --"); operationLabel_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); operationLabel_->SetAlign(TEXT_ALIGNMENT_CENTER); operationLabel_->SetFont(GILROY_BOLD_FONT, @@ -117,7 +117,7 @@ void RepairView::InitLabels() { versionLabel_->SetPosition(133, 180); versionLabel_->Resize(200, 60); versionLabel_->SetViewId("versionLabel"); - versionLabel_->SetText("Version: 1.1.47"); + versionLabel_->SetText("Version: --"); versionLabel_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); versionLabel_->SetAlign(TEXT_ALIGNMENT_CENTER); versionLabel_->SetFont(GILROY_BOLD_FONT, @@ -196,7 +196,7 @@ UIScrollView *RepairView::RepairViewInit() { downLabel_->SetPosition(26, 366); downLabel_->Resize(200, 60); downLabel_->SetViewId("downLabel"); - downLabel_->SetText("down: 10"); + downLabel_->SetText("down: --"); downLabel_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); downLabel_->SetAlign(TEXT_ALIGNMENT_CENTER); downLabel_->SetFont(GILROY_BOLD_FONT, @@ -212,7 +212,7 @@ UIScrollView *RepairView::RepairViewInit() { totalLabel_->SetPosition(230, 366); totalLabel_->Resize(200, 60); totalLabel_->SetViewId("totalLabel"); - totalLabel_->SetText("total: 100"); + totalLabel_->SetText("total: --"); totalLabel_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); totalLabel_->SetAlign(TEXT_ALIGNMENT_CENTER); totalLabel_->SetFont(GILROY_BOLD_FONT, @@ -221,6 +221,9 @@ UIScrollView *RepairView::RepairViewInit() { totalLabel_->SetVisible(true); } + // 初始化基本数据 + InitBasicdata(); + return scrollView_; } @@ -229,11 +232,14 @@ void RepairView::InitBasicdata() { if (versionLabel_ != nullptr) { } if (downLabel_ != nullptr) { + int totalcount = SafeModeManagerModel::GetInstance()->GetFilenamesCount(); + std::string total = "total: " + std::to_string(totalcount); + totalLabel_->SetText(total.c_str()); } } //更新信号值与下载进度 -void RepairView::UpdateRepairView(int date) { +void RepairView::UpdateView(int date) { if (downingLabel_ == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ResourceCheckView::downingLabel_ is null"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/SafeModeManagerModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/SafeModeManagerModel.cpp index 2cd6d40bb..87d24218a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/SafeModeManagerModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/SafeModeManagerModel.cpp @@ -6,6 +6,7 @@ #include #include +#include "safemodemanager/include/RepairView.h" #include "safemodemanager/include/ResourceCheckView.h" #include "safemodemanager/include/SafeModeManagerModel.h" #include "safemodemanager/include/SafeModeManagerView.h" @@ -173,5 +174,14 @@ bool SafeModeManagerModel::RepairStart() { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Repair"); return true; } - +// 更新文件下载 +void SafeModeManagerModel::UpdateRepairView(int date) { + auto safeModeView = SafeModeManagerView::GetInstance(); + if (safeModeView != nullptr) { + auto RepairView = ResourceCheckView::GetInstance(); + if (safeModeView->GetSafeScrollView(VIEW_RESOURCE_CHECK) != nullptr) { + RepairView->UpdateView(date); + } + } +} } // namespace OHOS \ No newline at end of file