From 38e217ef4939e5aaba906aa1ad1078fd31419f43 Mon Sep 17 00:00:00 2001 From: cuu Date: Wed, 17 Jul 2019 12:21:11 +0800 Subject: [PATCH] update wifi --- Menu/GameShell/80_SETTINGS/Wifi/net_item.py | 4 +-- Menu/GameShell/80_SETTINGS/Wifi/wifi_list.py | 28 +++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Menu/GameShell/80_SETTINGS/Wifi/net_item.py b/Menu/GameShell/80_SETTINGS/Wifi/net_item.py index dc4ba88..d01b22b 100644 --- a/Menu/GameShell/80_SETTINGS/Wifi/net_item.py +++ b/Menu/GameShell/80_SETTINGS/Wifi/net_item.py @@ -137,13 +137,13 @@ class NetItem(Widget): lock_icon = NetItemIcon() - lock_icon._ImgSurf = MyIconPool._Icons["lock"] + lock_icon._ImgSurf = MyIconPool.GiveIconSurface("lock") lock_icon._CanvasHWND = self._Parent._CanvasHWND lock_icon._Parent = self self._Icons["lock"] = lock_icon done_icon = NetItemIcon() - done_icon._ImgSurf = MyIconPool._Icons["done"] + done_icon._ImgSurf = MyIconPool.GiveIconSurface("done") done_icon._CanvasHWND = self._Parent._CanvasHWND done_icon._Parent = self diff --git a/Menu/GameShell/80_SETTINGS/Wifi/wifi_list.py b/Menu/GameShell/80_SETTINGS/Wifi/wifi_list.py index 5b94e54..c5882d7 100644 --- a/Menu/GameShell/80_SETTINGS/Wifi/wifi_list.py +++ b/Menu/GameShell/80_SETTINGS/Wifi/wifi_list.py @@ -202,7 +202,7 @@ class WifiInfoPage(Page): class WifiListSelector(PageSelector): - _BackgroundColor = MySkinManager.GiveColor('Line') + _BackgroundColor = MySkinManager.GiveColor('Front') def __init__(self): pass @@ -222,9 +222,9 @@ class WifiListSelector(PageSelector): self._PosY = y self._Height = h - #aa_round_rect(self._Parent._CanvasHWND, - # (x,y,self._Width,h),self._BackgroundColor,4,0,self._BackgroundColor) - pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width,h),0) + aa_round_rect(self._Parent._CanvasHWND, + (x,y,self._Width,h),self._BackgroundColor,4,0,self._BackgroundColor) + class WifiListMessageBox(Label): _Parent = None @@ -238,7 +238,7 @@ class WifiListMessageBox(Label): padding = 10 pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),(x-padding,y-padding, w+padding*2,h+padding*2)) - pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),(x-padding,y-padding, w+padding*2,h+padding*2),1) + pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Black'),(x-padding,y-padding, w+padding*2,h+padding*2),1) self._CanvasHWND.blit(my_text,(x,y,w,h)) @@ -568,7 +568,23 @@ class WifiList(Page): password_inputed = "".join(myvars.PasswordPage._Textarea._MyWords) if is_wifi_connected_now() == False: self.ConfigWireless(password_inputed) - + else: + for i in range(0,10): + if is_wifi_connected_now() == True: + self.ShowBox(MyLangManager.Tr("Launching")) + self._Daemon.Disconnect() + self._Daemon.SetForcedDisconnect(True) + self._Connecting = False + else: + break + + pygame.time.delay(100) + + if is_wifi_connected_now() == False: + self.ConfigWireless(password_inputed) + else: + self.ShowBox(MyLangManager.Tr("Disconnect first")) + def OnReturnBackCb(self): pass