Author: bklaas
Date: Thu Apr 17 13:04:04 2008
New Revision: 2269
URL: http://svn.slimdevices.com?rev=2269&root=Jive&view=rev
Log:
Bug: 7261
Description: poach "updating squeezebox firmware" code from SlimBrowser
If new receiver firmware required, a fullscreen popup shows up until the player
is upgraded
Also poach string from Slimbrowser for popup
Modified:
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/strings.txt
Modified:
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua
URL:
http://svn.slimdevices.com/7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua?rev=2269&root=Jive&r1=2268&r2=2269&view=diff
==============================================================================
---
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua
(original)
+++
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/SetupSqueezeboxApplet.lua
Thu Apr 17 13:04:04 2008
@@ -43,10 +43,62 @@
local setupsqueezeboxTitleStyle = 'settingstitle'
local SETUP_TIMEOUT = 45 -- 45 second timeout for each action
local SETUP_EXTENDED_TIMEOUT = 180 -- 180 second timeout in case Squeezebox
is upgrading after first connecting to SC
+local _updatingPlayerPopup = false
module(...)
oo.class(_M, Applet)
+-- _updatingPlayer
+-- full screen popup that appears while player is getting fw update
+local function _updatingPlayer(self)
+ log:info("_updating popup show")
+
+ if _updatingPlayerPopup then
+ -- don't open this popup twice
+ return
+ end
+
+ local popup = Popup("popupIcon")
+ local icon = Icon("iconConnecting")
+ local label = Label("text",
self:string('SQUEEZEBOX_UPDATING_FIRMWARE_SQUEEZEBOX'))
+ popup:addWidget(icon)
+ popup:addWidget(label)
+ popup:setAlwaysOnTop(true)
+
+ -- add a listener for KEY_PRESS that disconnects from the player and
returns to home
+ popup:addListener(
+ EVENT_KEY_PRESS | EVENT_KEY_HOLD,
+ function(event)
+ local evtCode = event:getKeycode()
+
+ if evtCode == KEY_BACK then
+ -- disconnect from player and go home
+ local manager =
AppletManager:getAppletInstance("SlimDiscovery")
+ if manager then
+ manager:setCurrentPlayer(nil)
+ end
+ popup:hide()
+ end
+ -- other keys are disabled when this popup is on screen
+ return EVENT_CONSUME
+
+ end
+ )
+
+ popup:show()
+
+ _updatingPlayerPopup = popup
+end
+
+-- _hidePlayerUpdating
+-- hide the full screen popup that appears until player is updated
+local function _hidePlayerUpdating()
+ if _updatingPlayerPopup then
+ log:info("_updatingPlayer popup hide")
+ _updatingPlayerPopup:hide()
+ _updatingPlayerPopup = false
+ end
+end
function init(self)
self.data1 = {}
@@ -1306,7 +1358,11 @@
-- needed in case the set slimserver udap packets got
lost
_setAction(self, t_waitSlimserver)
self._totalTimeout = SETUP_EXTENDED_TIMEOUT
+
+ _updatingPlayer(self)
return
+ else
+ _hidePlayerUpdating()
end
-- player is connected to slimserver, set as current player
Modified:
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/strings.txt
URL:
http://svn.slimdevices.com/7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/strings.txt?rev=2269&root=Jive&r1=2268&r2=2269&view=diff
==============================================================================
---
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/strings.txt
(original)
+++
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSqueezebox/strings.txt
Thu Apr 17 13:04:04 2008
@@ -213,3 +213,11 @@
IT Squeezebox %s
NL Squeezebox %s
+SQUEEZEBOX_UPDATING_FIRMWARE_SQUEEZEBOX
+ DE Squeezebox-Firmware wird aktualisiert
+ EN Updating Squeezebox firmware
+ ES Actualizando firmware de Squeezebox
+ FR Mise à jour du micrologiciel Squeezebox
+ IT Aggiornamento firmware Squeezebox
+ NL Squeezebox-firmware wordt bijgewerkt
+
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins