diff --git a/main/apps/app_setup/app_setup.cpp b/main/apps/app_setup/app_setup.cpp index 28c98af5..29c3a794 100644 --- a/main/apps/app_setup/app_setup.cpp +++ b/main/apps/app_setup/app_setup.cpp @@ -55,6 +55,11 @@ void AppSetup::onOpen() _destroy_menu = true; _worker = std::make_unique(); }}, + {"Wi-Fi", + [&]() { + _destroy_menu = true; + _worker = std::make_unique(); + }}, }, }, { @@ -114,7 +119,12 @@ void AppSetup::onRunning() if (_worker) { _worker->update(); if (_worker->isDone()) { + const bool exit_app = _worker->shouldExitApp(); _worker.reset(); + if (exit_app) { + close(); + return; + } _menu_page = std::make_unique(_menu_sections); } } diff --git a/main/apps/app_setup/workers/wifi.cpp b/main/apps/app_setup/workers/wifi.cpp new file mode 100644 index 00000000..5465d10d --- /dev/null +++ b/main/apps/app_setup/workers/wifi.cpp @@ -0,0 +1,118 @@ +/* + * SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD + * + * SPDX-License-Identifier: MIT + */ +#include "workers.h" +#include +#include +#include +#include + +using namespace uitk; +using namespace uitk::lvgl_cpp; +using namespace setup_workers; + +class WifiWorker::WifiView { +public: + WifiView() + { + _panel = std::make_unique(lv_screen_active()); + _panel->setSize(466, 466); + _panel->setAlign(LV_ALIGN_CENTER); + _panel->setRadius(0); + _panel->setBorderWidth(0); + _panel->setPadding(42, 92, 42, 42); + _panel->setBgColor(lv_color_black()); + _panel->removeFlag(LV_OBJ_FLAG_SCROLLABLE); + + _title = std::make_unique