Author: titmuss
Date: Fri Feb 15 03:25:13 2008
New Revision: 1968

URL: http://svn.slimdevices.com?rev=1968&root=Jive&view=rev
Log:
Bug: 7129
Description:
Disconnect from SC/SN before entering suspend mode. This is better practice, 
and 
avoids the problem with show briefly popups not working correctly on resume.


Modified:
    branches/7.0/jive/src/pkg/jive/share/jive/slim/SlimServers.lua
    
branches/7.0/jive/src/pkg/jive_squeezeboxjive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua

Modified: branches/7.0/jive/src/pkg/jive/share/jive/slim/SlimServers.lua
URL: 
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/jive/slim/SlimServers.lua?rev=1968&root=Jive&r1=1967&r2=1968&view=diff
==============================================================================
--- branches/7.0/jive/src/pkg/jive/share/jive/slim/SlimServers.lua (original)
+++ branches/7.0/jive/src/pkg/jive/share/jive/slim/SlimServers.lua Fri Feb 15 
03:25:13 2008
@@ -466,10 +466,13 @@
 function notify_networkConnected(self)
        log:info("network connected")
 
-       -- force reconnection to all servers if we don't have a player
        if not self.currentPlayer then
+               -- force reconnection to all servers if we don't have a player
                self:discover()
                self:connect()
+       else
+               -- otherwise force connection to the current player
+               self.currentPlayer:getSlimServer():connect()
        end
 end
 

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=1968&root=Jive&r1=1967&r2=1968&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
 Fri Feb 15 03:25:13 2008
@@ -926,11 +926,11 @@
        local settings = self:getSettings()
        local wakeAfter = settings.suspendWake and settings.suspendWake or ""
 
-       -- suspend
-       os.execute("/etc/init.d/suspend " .. wakeAfter)
-
-       -- wake up power state
-       self:wakeup()
+       local slimDiscovery = appletManager:getAppletInstance("SlimDiscovery")
+       local slimServers
+       if slimDiscovery then
+               slimServers = slimDiscovery.serversObj
+       end
 
        -- start timer to resume this task every second
        self.suspendPopup:addTimer(1000,
@@ -940,20 +940,43 @@
                        end
                end)
 
+       -- disconnect from all SlimServers
+       if slimServers then
+               slimServers:disconnect()
+
+               local connected
+               repeat
+                       connected = false
+                       for i,server in slimServers:allServers() do
+                               connected = connected or server:isConnected()
+                               log:info("server=", server:getName(), " 
connected=", connected)
+                       end
+
+                       Task:yield(false)
+               until not connected
+       end
+
+
+       -- suspend
+       os.execute("/etc/init.d/suspend " .. wakeAfter)
+
+       -- wake up power state
+       self:wakeup()
+
        while true do
                local status = self.wireless:t_wpaStatus()
 
                -- network connected?
-               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)
+                       log:info("wpa_state=", status.wpa_state, " resume ip=", 
status.ip_address, " zeroconf=", zeroconf)
+               else
+                       log:info("connected=", wirelessWasConnected)
                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
+                       -- force connection to SlimServer
                        if wirelessWasConnected then
                                jnt:notify("networkConnected")
                        end

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to