Author: titmuss
Date: Thu Jan 31 09:27:20 2008
New Revision: 1724
URL: http://svn.slimdevices.com?rev=1724&root=Jive&view=rev
Log:
Bug: 6764
Description:
Use 'playerRegister' before moving players to SqueezeNetwork with the 'connect'
command.
Modified:
branches/7.0/jive/src/pkg/jive/share/applets/ChooseMusicSource/ChooseMusicSourceApplet.lua
branches/7.0/jive/src/pkg/jive/share/applets/SelectPlayer/SelectPlayerApplet.lua
branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt
branches/7.0/jive/src/pkg/jive/share/jive/slim/Player.lua
Modified:
branches/7.0/jive/src/pkg/jive/share/applets/ChooseMusicSource/ChooseMusicSourceApplet.lua
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/applets/ChooseMusicSource/ChooseMusicSourceApplet.lua?rev=1724&root=Jive&r1=1723&r2=1724&view=diff
==============================================================================
---
branches/7.0/jive/src/pkg/jive/share/applets/ChooseMusicSource/ChooseMusicSourceApplet.lua
(original)
+++
branches/7.0/jive/src/pkg/jive/share/applets/ChooseMusicSource/ChooseMusicSourceApplet.lua
Thu Jan 31 09:27:20 2008
@@ -265,7 +265,6 @@
-- connect player to server
function connectPlayer(self, player, server)
-
-- if connecting to SqueezeNetwork, first check jive is linked
if server:getPin() then
local snpin = appletManager:loadApplet("SqueezeNetworkPIN")
@@ -277,12 +276,29 @@
return
end
+ -- we are now ready to connect to SqueezeCenter
+ if not server:isSqueezeNetwork() then
+ self:_doConnectPlayer(player, server)
+ end
+
-- make sure the player is linked on SqueezeNetwork, this may return an
-- error if the player can't be linked, for example it is linked to
another
-- account already.
- --
- -- XXX send a playerRegister, we'll need to check the response to make
sure
- -- the player is not linked to another account.
+ local cmd = { 'playerRegister', player:getUuid(), player:getId() }
+
+ local playerRegisterSink = function(chunk, err)
+ if chunk.error then
+ self:_playerRegisterFailed(chunk.error)
+ else
+ self:_doConnectPlayer(player, server)
+ end
+ end
+
+ server:request(playerRegisterSink, nil, cmd)
+end
+
+
+function _doConnectPlayer(self, player, server)
-- tell the player to move servers
self.waitForConnect = {
@@ -317,6 +333,32 @@
self:_connectPlayerFailed(player,
server)
end
end)
+
+ self:tieAndShowWindow(window)
+end
+
+
+function _playerRegisterFailed(self, error)
+ local window = Window("wireless", self:string("SQUEEZEBOX_PROBLEM"),
setupsqueezeboxTitleStyle)
+ window:setAllowScreensaver(false)
+
+ local textarea = Textarea("textarea", error)
+
+ local menu = SimpleMenu("menu",
+ {
+ {
+ text =
self:string("SQUEEZEBOX_GO_BACK"),
+ sound = "WINDOWHIDE",
+ callback = function()
+ window:hide()
+ end
+
+ },
+ })
+
+
+ window:addWidget(textarea)
+ window:addWidget(menu)
self:tieAndShowWindow(window)
end
Modified:
branches/7.0/jive/src/pkg/jive/share/applets/SelectPlayer/SelectPlayerApplet.lua
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/applets/SelectPlayer/SelectPlayerApplet.lua?rev=1724&root=Jive&r1=1723&r2=1724&view=diff
==============================================================================
---
branches/7.0/jive/src/pkg/jive/share/applets/SelectPlayer/SelectPlayerApplet.lua
(original)
+++
branches/7.0/jive/src/pkg/jive/share/applets/SelectPlayer/SelectPlayerApplet.lua
Thu Jan 31 09:27:20 2008
@@ -165,6 +165,11 @@
-- if waiting for a SN pin modify name
if player:getPin() then
+ if not self.setupMode then
+ -- Only include Activate SN during setup
+ return
+ end
+
playerName = self:string("SQUEEZEBOX_ACTIVATE", player.name)
playerWeight = 10
end
@@ -274,6 +279,7 @@
menu:setComparator(SimpleMenu.itemComparatorWeightAlpha)
self.playerMenu = menu
+ self.setupMode = setupNext ~= nil
self.setupNext = setupNext or
function()
window:hide(Window.transitionPushLeft)
Modified:
branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua?rev=1724&root=Jive&r1=1723&r2=1724&view=diff
==============================================================================
---
branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
(original)
+++
branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
Thu Jan 31 09:27:20 2008
@@ -146,7 +146,20 @@
local textarea = Textarea("textarea",
self:string("SQUEEZENETWORK_NOT_LINKED"))
+ local menu = SimpleMenu("menu",
+ {
+ {
+ text =
self:string("SQUEEZENETWORK_GO_BACK"),
+ sound = "WINDOWHIDE",
+ callback = function()
+ window:hide()
+ end
+ },
+ })
+
+
window:addWidget(textarea)
+ window:addWidget(menu)
window:addListener(EVENT_KEY_PRESS,
function(event)
Modified:
branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt?rev=1724&root=Jive&r1=1723&r2=1724&view=diff
==============================================================================
--- branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt
(original)
+++ branches/7.0/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt
Thu Jan 31 09:27:20 2008
@@ -30,3 +30,12 @@
IT Impossibile verificare il PIN. Ã stato immesso nel sito Web?
NL Pincode kan niet worden geverifieerd. Heb je deze op de website
ingevoerd?
+SQUEEZENETWORK_GO_BACK
+ DE Zurück
+ EN Go back
+ ES Regresar
+ FR Retour
+ IT Indietro
+ NL Terug
+
+
Modified: branches/7.0/jive/src/pkg/jive/share/jive/slim/Player.lua
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/jive/slim/Player.lua?rev=1724&root=Jive&r1=1723&r2=1724&view=diff
==============================================================================
--- branches/7.0/jive/src/pkg/jive/share/jive/slim/Player.lua (original)
+++ branches/7.0/jive/src/pkg/jive/share/jive/slim/Player.lua Thu Jan 31
09:27:20 2008
@@ -225,6 +225,7 @@
jnt = jnt,
id = playerInfo.playerid,
+ uuid = playerInfo.uuid,
name = playerInfo.name,
model = playerInfo.model,
connected = playerInfo.connected,
@@ -517,6 +518,19 @@
--]]
function getId(self)
return self.id
+end
+
+
+--[[
+
+=head2 jive.slim.Player:getUuid()
+
+Returns the player uuid.
+
+=cut
+--]]
+function getUuid(self)
+ return self.uuid
end
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins