From: 罗正yun <1732036298@qq.com> Date: Mon, 22 Jan 2024 09:07:11 +0000 (+0800) Subject: 设置中增加关机和重启 X-Git-Tag: release_V1.2.70_20241020_135402~1346 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=f1f9ef90ff551cace1d28532fd6eb49fd1398fca;p=mirrors%2FFD230.git 设置中增加关机和重启 --- 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 000000000..daeb8abb1 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/settings/SETTINGS_POWER_CONTROL.bin differ