From 66561c8ba8dc51a26a366d219edfe1e0dca2a6b1 Mon Sep 17 00:00:00 2001 From: "k.stepaniuk" Date: Thu, 2 Apr 2020 09:01:36 +0200 Subject: [PATCH] Correcting state & entry Signed-off-by: k.stepaniuk --- Oobe/OobeWifi/Controls/Wifi/WifiPasswordPopup.cs | 32 +++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Oobe/OobeWifi/Controls/Wifi/WifiPasswordPopup.cs b/Oobe/OobeWifi/Controls/Wifi/WifiPasswordPopup.cs index 9bcd043..3801bd6 100644 --- a/Oobe/OobeWifi/Controls/Wifi/WifiPasswordPopup.cs +++ b/Oobe/OobeWifi/Controls/Wifi/WifiPasswordPopup.cs @@ -30,9 +30,16 @@ namespace Oobe.Wifi.Controls.Wifi Position = new Position(new Position2D(236, 116)); this.wifiAp = wifiAp; + this.Add(new View() //underline + { + Size = new Size(584, 1), + Position = new Position(103, 160), + BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f), + }); + passwordEntry = new PasswordEntry() { - Size = new Size(584, 22), + Size = new Size(584, 26), Position = new Position(112, 134), MaxLength = maxPasswordLength, PixelSize = 22, @@ -45,13 +52,6 @@ namespace Oobe.Wifi.Controls.Wifi this.Add(passwordEntry); - this.Add(new View() //underline - { - Size = new Size(584, 1), - Position = new Position(103, 160), - BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f), - }); - var titleLabel = new TextLabel { Size = new Size(808, 35), @@ -122,17 +122,14 @@ namespace Oobe.Wifi.Controls.Wifi }; okButton.ClickEvent += async (s, e) => { + bool success = false; isConnecting = true; UpdateOKButton(); try { Tizen.Log.Debug("oobe", $"connecting to wifi {wifiAp.NetworkInformation.Essid} with password {Password}"); wifiAp.SecurityInformation.SetPassphrase(Password); - var result = await (wifiAp.ConnectAsync() as Task); - if (result == true) - { - OobeCommon.Utils.Popup.Dismiss(); - } + success = await (wifiAp.ConnectAsync() as Task); } catch (Exception ex) { @@ -142,7 +139,14 @@ namespace Oobe.Wifi.Controls.Wifi { isConnecting = false; UpdateOKButton(); - connectionFailure.Show(); + if (success == true) + { + OobeCommon.Utils.Popup.Dismiss(); + } + else + { + connectionFailure.Show(); + } } }; this.Add(okButton); -- 2.7.4