examples/installer: Ensure wifi passphrase isn't a dead-end
This is important to improve the experience of the installer: always
have a clear "let's continue" option to follow. Backing out through the
few pages of network setup is plain rude.
@@ -36,6 +36,7 @@ module GUI
LVGL::Hacks::LVTask.once(->() do
Hardware::Network.connect_wifi(interface: interface, network: network, passphrase: value) do |success|
if success then
+ @continue_button.set_enabled(true)
@status_text.set_text("Connected successfully.")
else
@status_text.set_text("Failed to connect.")
@@ -47,6 +48,10 @@ module GUI
@status_text = add_text("") # Will be filled on connect
+ @continue_button = add_button("Continue", style: :primary) do
+ MainWindow.instance.present()
+ end
+
@back_button = LVGUI::BackButton.new(@toolbar, self).tap do |button|
add_to_focus_group(button)
button.event_handler = ->(event) do
@@ -68,6 +73,8 @@ module GUI
def refresh_network_information()
return if @refreshing
+ @continue_button.set_enabled(false)
+
@network_name_label.set_text(
"Network: '#{network[:ssid]}'"
)
