From f1f9ef90ff551cace1d28532fd6eb49fd1398fca Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3yun?= <1732036298@qq.com> Date: Mon, 22 Jan 2024 17:07:11 +0800 Subject: [PATCH] =?utf8?q?=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?utf8?q?=E5=85=B3=E6=9C=BA=E5=92=8C=E9=87=8D=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeapp/nativelauncher/include/UiConfig.h | 1 + .../nativeui/settings/include/SettingItem.h | 1 + .../nativeui/settings/include/SettingModel.h | 2 +- .../nativeui/settings/src/SettingModel.cpp | 2 ++ .../user/res/settings/SETTINGS_POWER_CONTROL.bin | Bin 0 -> 2840 bytes 5 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/settings/SETTINGS_POWER_CONTROL.bin diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h index e347034eb..c7c3b75f5 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h @@ -200,6 +200,7 @@ namespace OHOS static constexpr const char *PNG_SETTINGS_SOUND_VIBRATION = APP_RES_PATH "/settings/SETTINGS_SOUND_VIBRATION.bin"; // 声音与震动 static constexpr const char *PNG_SETTINGS_SECONDARY_FUNCTION = APP_RES_PATH "/settings/SETTINGS_QUICK_ACCESS.bin"; // 辅助功能 static constexpr const char *PNG_SETTINGS_SYSTEM = APP_RES_PATH "/settings/SETTINGS_SYSTEM.bin"; // 系统 + static constexpr const char *PNG_SETTINGS_SETTINGS_POWER_CONTROL = APP_RES_PATH "/settings/SETTINGS_POWER_CONTROL.bin"; // 关机和重启 /* ---------------------------------- 通用图片 ---------------------------------- */ static constexpr const char *PNG_CHECKBOX_OFF_IMAGE = APP_RES_PATH "/CHECKBOX_OFF.bin"; // checkbox未选中图片 static constexpr const char *PNG_CHECKBOX_ON_IMAGE = APP_RES_PATH "/CHECKBOX_ON.bin"; // checkbox选中图片 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h index 80d267b84..1e3f4a09f 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h @@ -23,6 +23,7 @@ namespace OHOS SETTING_ITEM_TWO, SETTING_ITEM_THREE, SETTING_ITEM_FOUR, + SETTING_ITEM_FIVE, } SettingIndex; typedef struct diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h index e0026fb02..fc1649b88 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h @@ -33,7 +33,7 @@ namespace OHOS SettingModel(const SettingModel &); SettingModel &operator=(const SettingModel &); virtual ~SettingModel(); - static const uint16_t SETTING_ITEM_LEN = 5; + static const uint16_t SETTING_ITEM_LEN = 6; SettingItem settings[SETTING_ITEM_LEN] = {SETTING_ITEM_ZERO, nullptr, nullptr, false}; std::map settingIdToViewId; bool btConnectStatus{false}; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp index ee54b7294..abe5d7371 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp @@ -27,11 +27,13 @@ namespace OHOS settings[2] = {SETTING_ITEM_TWO, PNG_SETTINGS_SOUND_VIBRATION, "声音与震动", true}; settings[3] = {SETTING_ITEM_THREE, PNG_SETTINGS_SECONDARY_FUNCTION, "辅助功能", true}; settings[4] = {SETTING_ITEM_FOUR, PNG_SETTINGS_SYSTEM, "系统", true}; + settings[5] = {SETTING_ITEM_FIVE, PNG_SETTINGS_SETTINGS_POWER_CONTROL, "关机和重启", true}; settingIdToViewId.insert(std::pair(SETTING_ITEM_ZERO, VIEW_SHUTDOWN_OR_REBOOT)); settingIdToViewId.insert(std::pair(SETTING_ITEM_ONE, VIEW_BLUETOOTH_EARPHONE)); settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_SYSTEM)); settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_SYSTEM)); settingIdToViewId.insert(std::pair(SETTING_ITEM_FOUR, VIEW_SYSTEM)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_FIVE, VIEW_SHUTDOWN_OR_REBOOT)); } const SettingItem *SettingModel::GetSettinglistItems() const diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/settings/SETTINGS_POWER_CONTROL.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/settings/SETTINGS_POWER_CONTROL.bin new file mode 100644 index 0000000000000000000000000000000000000000..daeb8abb1b1832dcc4237ede2317957f52ea14ca GIT binary patch literal 2840 zcmcImYfuwc6h3!1BuhZ@qGFLp2$2RGX?TrH#bh^x5iAM`*4hVxLao?N4G$}nwh6}3 zM6ngHVyhh<;}1GcXT+h_7SW)#4iz61Uv&yYMyl~ulHybxFxwlP`Xm0Jv~qT4XU^Vp zzWwfZ&pr171E9taOH%65oH_81jXz>1?7#Z5`$`cUy}p#@HjoXZAGElXj>?xY+VIwu zuJf7;{}+F%`SJdxQ6L4#9Z5$yCX>ma&&wd0Stgz^R!U-8Oo=6w-0b-x%PzJf4kHxb zvd9x9QVA`@gNO#LEs44fJC8k=%2VMlpw;J55fCJmkS=7${#5z+#xpxYn(qx^CPq?< z;Xo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