Author: titmuss
Date: Tue Feb  5 04:18:06 2008
New Revision: 1813

URL: http://svn.slimdevices.com?rev=1813&root=Jive&view=rev
Log:
Bug: 6948
Description:
Fix SN Pin case during Ray setup. This needed code to be copied from 
ChooseMusicSource. The duplication will be removed during refactoring
for bug 6683.


Modified:
    
branches/7.0/jive/src/pkg/jive/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua

Modified: 
branches/7.0/jive/src/pkg/jive/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua
URL: 
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua?rev=1813&root=Jive&r1=1812&r2=1813&view=diff
==============================================================================
--- 
branches/7.0/jive/src/pkg/jive/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua
 (original)
+++ 
branches/7.0/jive/src/pkg/jive/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua
 Tue Feb  5 04:18:06 2008
@@ -31,6 +31,7 @@
 local log                    = 
require("jive.utils.log").logger("applets.setup")
 
 local jnt                    = jnt
+local appletManager          = appletManager
 local socket                 = require("socket")
 
 local EVENT_KEY_PRESS        = jive.ui.EVENT_KEY_PRESS
@@ -1230,7 +1231,29 @@
        end
 
 
+       -- if connecting to SqueezeNetwork, first check jive is linked
+       if slimserver:getPin() then
+               local snpin = appletManager:loadApplet("SqueezeNetworkPIN")
+               snpin:enterPin(slimserver, nil,
+                              function()
+                                      self:_registerPlayer(slimserver)
+                              end)
+
+               return
+       end
+
+       -- we are not SqueezeNetwork, so continue
+       _setAction(self, t_udapSetSlimserver, "connect_slimserver")
+       _setupSqueezebox(self)
+end
+
+
+-- called after pin registration for SN
+function _registerPlayer(self, slimserver)
        if self.uuid then
+               -- XXX don't wait for a reply, Ray should always be
+               -- registered. This will work better after refactoring
+               -- with Bug 6683.
                local cmd = { 'playerRegister', self.uuid, self.mac }
                slimserver:request(nil, nil, cmd)
        end

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

Reply via email to