1c2806bddf
+ other improvements
45 lines
1.0 KiB
C++
45 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "./Bindings.h"
|
|
#include "./State.h"
|
|
|
|
#include <Tactility/app/AppContext.h>
|
|
#include <Tactility/app/AppPaths.h>
|
|
|
|
#include <lvgl.h>
|
|
|
|
namespace tt::app::wifimanage {
|
|
|
|
class View final {
|
|
|
|
Bindings* bindings;
|
|
State* state;
|
|
std::unique_ptr<AppPaths> paths;
|
|
lv_obj_t* root = nullptr;
|
|
lv_obj_t* enable_switch = nullptr;
|
|
lv_obj_t* enable_on_boot_switch = nullptr;
|
|
lv_obj_t* scanning_spinner = nullptr;
|
|
lv_obj_t* networks_list = nullptr;
|
|
lv_obj_t* connect_to_hidden = nullptr;
|
|
|
|
void updateWifiToggle();
|
|
void updateEnableOnBootToggle();
|
|
void updateScanning();
|
|
void updateNetworkList();
|
|
void updateConnectToHidden();
|
|
void createSsidListItem(const WifiApRecord& record, bool isConnecting, size_t index);
|
|
|
|
static void showDetails(lv_event_t* event);
|
|
static void connect(lv_event_t* event);
|
|
|
|
public:
|
|
|
|
View(Bindings* bindings, State* state) : bindings(bindings), state(state) {}
|
|
|
|
void init(const AppContext& app, lv_obj_t* parent);
|
|
void update();
|
|
};
|
|
|
|
|
|
} // namespace
|