Author: bklaas
Date: Wed Feb 13 09:00:01 2008
New Revision: 1926
URL: http://svn.slimdevices.com?rev=1926&root=Jive&view=rev
Log:
Bug: 7113
Description: fix suspend for when wireless is not connected
Modified:
branches/7.0/jive/src/pkg/jive_squeezeboxjive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
Modified:
branches/7.0/jive/src/pkg/jive_squeezeboxjive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive_squeezeboxjive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua?rev=1926&root=Jive&r1=1925&r2=1926&view=diff
==============================================================================
---
branches/7.0/jive/src/pkg/jive_squeezeboxjive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
(original)
+++
branches/7.0/jive/src/pkg/jive_squeezeboxjive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
Wed Feb 13 09:00:01 2008
@@ -913,7 +913,9 @@
function _suspendTask(self)
-- check existing network config
local status = self.wireless:t_wpaStatus()
- local zeroconf = string.match(status.ip_address, "^169.254.") ~= nil
+ local wirelessWasConnected = (status.wpa_state == 'COMPLETED')
+
+ local zeroconf = status.ip_address and string.match(status.ip_address,
"^169.254.") ~= nil
local settings = self:getSettings()
local wakeAfter = settings.suspendWake and settings.suspendWake or ""
@@ -936,11 +938,19 @@
local status = self.wireless:t_wpaStatus()
-- network connected?
- log:info("resume ip=", status.ip_address, " zeroconf=",
zeroconf)
- if status.wpa_state == "COMPLETED" and status.ip_address and
(not string.match(status.ip_address, "^169.254.") or zeroconf) then
+ log:info('Wireless was connected: ', wirelessWasConnected)
+ if status then
+ log:info('wpa_state=', status.wpa_state)
+ log:info("resume ip=", status.ip_address, " zeroconf=",
zeroconf)
+ end
+
+ if not wirelessWasConnected and status and status.wpa_state
+ or (status.wpa_state == "COMPLETED" and
status.ip_address and (not string.match(status.ip_address, "^169.254.") or
zeroconf)) then
-- force reconnections
- jnt:notify("networkConnected")
+ if wirelessWasConnected then
+ jnt:notify("networkConnected")
+ end
-- close popup
self.suspendPopup:hide()
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins