App and Service improvements (#106)
This commit is contained in:
committed by
GitHub
parent
e86a11b7e2
commit
50ee77d572
@@ -3,12 +3,12 @@
|
||||
#include "Parameters.h"
|
||||
#include "WifiConnect.h"
|
||||
|
||||
#include "Log.h"
|
||||
#include "lvgl.h"
|
||||
#include "service/gui/Gui.h"
|
||||
#include "service/wifi/WifiSettings.h"
|
||||
#include "lvgl/Style.h"
|
||||
#include "lvgl/Toolbar.h"
|
||||
#include <TactilityCore.h>
|
||||
|
||||
namespace tt::app::wificonnect {
|
||||
|
||||
@@ -107,7 +107,7 @@ void View::createBottomButtons(WifiConnect* wifi, lv_obj_t* parent) {
|
||||
}
|
||||
|
||||
// TODO: Standardize dialogs
|
||||
void View::init(App& app, WifiConnect* wifiConnect, lv_obj_t* parent) {
|
||||
void View::init(AppContext& app, WifiConnect* wifiConnect, lv_obj_t* parent) {
|
||||
|
||||
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
|
||||
lvgl::toolbar_create(parent, app);
|
||||
@@ -187,15 +187,17 @@ void View::init(App& app, WifiConnect* wifiConnect, lv_obj_t* parent) {
|
||||
service::gui::keyboardAddTextArea(password_textarea);
|
||||
|
||||
// Init from app parameters
|
||||
const Bundle& bundle = app.getParameters();
|
||||
std::string ssid;
|
||||
if (bundle.optString(WIFI_CONNECT_PARAM_SSID, ssid)) {
|
||||
lv_textarea_set_text(ssid_textarea, ssid.c_str());
|
||||
}
|
||||
auto bundle = app.getParameters();
|
||||
if (bundle != nullptr) {
|
||||
std::string ssid;
|
||||
if (bundle->optString(WIFI_CONNECT_PARAM_SSID, ssid)) {
|
||||
lv_textarea_set_text(ssid_textarea, ssid.c_str());
|
||||
}
|
||||
|
||||
std::string password;
|
||||
if (bundle.optString(WIFI_CONNECT_PARAM_PASSWORD, password)) {
|
||||
lv_textarea_set_text(password_textarea, password.c_str());
|
||||
std::string password;
|
||||
if (bundle->optString(WIFI_CONNECT_PARAM_PASSWORD, password)) {
|
||||
lv_textarea_set_text(password_textarea, password.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user